LXC
attach_options.h
Go to the documentation of this file.
1 
25 #ifndef __LXC_ATTACH_OPTIONS_H
26 #define __LXC_ATTACH_OPTIONS_H
27 
28 #include <sys/types.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
41 
42 enum {
43  /* the following are on by default: */
47  LXC_ATTACH_LSM_EXEC = 0x00000008,
48 
49  /* the following are off by default */
51  LXC_ATTACH_LSM_NOW = 0x00020000,
52 
53  /* we have 16 bits for things that are on by default
54  * and 16 bits that are off by default, that should
55  * be sufficient to keep binary compatibility for
56  * a while
57  */
58  LXC_ATTACH_DEFAULT = 0x0000FFFF
59 };
60 
62 #define LXC_ATTACH_LSM (LXC_ATTACH_LSM_EXEC | LXC_ATTACH_LSM_NOW)
63 
72 typedef int (*lxc_attach_exec_t)(void* payload);
73 
77 typedef struct lxc_attach_options_t {
80 
83 
88 
93  char* initial_cwd;
94 
100  uid_t uid;
101 
107  gid_t gid;
108 
110  lxc_attach_env_policy_t env_policy;
111 
114 
119 
128  int stdin_fd;
129  int stdout_fd;
130  int stderr_fd;
133 
135 #define LXC_ATTACH_OPTIONS_DEFAULT \
136  { \
137  /* .attach_flags = */ LXC_ATTACH_DEFAULT, \
138  /* .namespaces = */ -1, \
139  /* .personality = */ -1, \
140  /* .initial_cwd = */ NULL, \
141  /* .uid = */ (uid_t)-1, \
142  /* .gid = */ (gid_t)-1, \
143  /* .env_policy = */ LXC_ATTACH_KEEP_ENV, \
144  /* .extra_env_vars = */ NULL, \
145  /* .extra_keep_env = */ NULL, \
146  /* .stdin_fd = */ 0, 1, 2 \
147  }
148 
152 typedef struct lxc_attach_command_t {
153  char* program;
154  char** argv;
156 
164 extern int lxc_attach_run_command(void* payload);
165 
173 extern int lxc_attach_run_shell(void* payload);
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif
int stdin_fd
Definition: attach_options.h:128
Definition: attach_options.h:152
int namespaces
Definition: attach_options.h:82
char * program
Definition: attach_options.h:153
uid_t uid
Definition: attach_options.h:100
Move to cgroup.
Definition: attach_options.h:44
int stderr_fd
Definition: attach_options.h:130
char ** extra_env_vars
Definition: attach_options.h:113
Mask of flags to apply by default.
Definition: attach_options.h:58
Retain the environment.
Definition: attach_options.h:38
lxc_attach_env_policy_t
Definition: attach_options.h:37
char ** extra_keep_env
Definition: attach_options.h:118
FIXME: unknown.
Definition: attach_options.h:51
int attach_flags
Definition: attach_options.h:79
struct lxc_attach_options_t lxc_attach_options_t
char ** argv
Definition: attach_options.h:154
Clear the environment.
Definition: attach_options.h:39
gid_t gid
Definition: attach_options.h:107
int lxc_attach_run_command(void *payload)
Run a command in the container.
int(* lxc_attach_exec_t)(void *payload)
Definition: attach_options.h:72
long personality
Definition: attach_options.h:87
struct lxc_attach_command_t lxc_attach_command_t
Execute under a Linux Security Module.
Definition: attach_options.h:47
lxc_attach_env_policy_t env_policy
Definition: attach_options.h:110
Definition: attach_options.h:77
Remount /proc filesystem.
Definition: attach_options.h:50
Set personality.
Definition: attach_options.h:46
char * initial_cwd
Definition: attach_options.h:93
int lxc_attach_run_shell(void *payload)
Run a shell command in the container.
Drop capabilities.
Definition: attach_options.h:45
int stdout_fd
Definition: attach_options.h:129