blob: bf28322ff5480d60d932f4bde6d9da0606d8a66d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#ifndef _NXT_CLONE_H_INCLUDED_
#define _NXT_CLONE_H_INCLUDED_
#if (NXT_HAVE_CLONE_NEWUSER)
typedef int64_t nxt_cred_t;
typedef struct {
nxt_cred_t container;
nxt_cred_t host;
nxt_cred_t size;
} nxt_clone_map_entry_t;
typedef struct {
nxt_uint_t size;
nxt_clone_map_entry_t *map;
} nxt_clone_credential_map_t;
#endif
typedef struct {
nxt_int_t flags;
#if (NXT_HAVE_CLONE_NEWUSER)
nxt_clone_credential_map_t uidmap;
nxt_clone_credential_map_t gidmap;
#endif
} nxt_clone_t;
#define nxt_is_clone_flag_set(flags, test) \
((flags & CLONE_##test) == CLONE_##test)
#if (NXT_HAVE_CLONE_NEWUSER)
NXT_EXPORT nxt_int_t nxt_clone_credential_map(nxt_task_t *task, pid_t pid,
nxt_credential_t *creds, nxt_clone_t *clone);
NXT_EXPORT nxt_int_t nxt_clone_vldt_credential_uidmap(nxt_task_t *task,
nxt_clone_credential_map_t *map, nxt_credential_t *creds);
NXT_EXPORT nxt_int_t nxt_clone_vldt_credential_gidmap(nxt_task_t *task,
nxt_clone_credential_map_t *map, nxt_credential_t *creds);
#endif
#endif /* _NXT_CLONE_H_INCLUDED_ */
|