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