summaryrefslogtreecommitdiff
path: root/src/core/execute.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-07-26 17:40:35 +0200
committerLennart Poettering <lennart@poettering.net>2016-08-04 16:27:07 +0200
commitc39f1ce24ddb1aa683991c5099dcc2afbfcbc57c (patch)
tree538eaf7898a78ea07ba33246826e620f322a2812 /src/core/execute.h
parent992e8f224b91cacc3d6589bea7882c7ab9c0911b (diff)
core: turn various execution flags into a proper flags parameter
The ExecParameters structure contains a number of bit-flags, that were so far exposed as bool:1, change this to a proper, single binary bit flag field. This makes things a bit more expressive, and is helpful as we add more flags, since these booleans are passed around in various callers, for example service_spawn(), whose signature can be made much shorter now. Not all bit booleans from ExecParameters are moved into the flags field for now, but this can be added later.
Diffstat (limited to 'src/core/execute.h')
-rw-r--r--src/core/execute.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core/execute.h b/src/core/execute.h
index 48cc18fbb3..77418ea2ad 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -208,6 +208,17 @@ struct ExecContext {
bool no_new_privileges_set:1;
};
+typedef enum ExecFlags {
+ EXEC_CONFIRM_SPAWN = 1U << 0,
+ EXEC_APPLY_PERMISSIONS = 1U << 1,
+ EXEC_APPLY_CHROOT = 1U << 2,
+ EXEC_APPLY_TTY_STDIN = 1U << 3,
+
+ /* The following are not usec by execute.c, but by consumers internally */
+ EXEC_PASS_FDS = 1U << 4,
+ EXEC_IS_CONTROL = 1U << 5,
+} ExecFlags;
+
struct ExecParameters {
char **argv;
char **environment;
@@ -216,11 +227,7 @@ struct ExecParameters {
char **fd_names;
unsigned n_fds;
- bool apply_permissions:1;
- bool apply_chroot:1;
- bool apply_tty_stdin:1;
-
- bool confirm_spawn:1;
+ ExecFlags flags;
bool selinux_context_net:1;
bool cgroup_delegate:1;