diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-10-01 10:42:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-10-01 11:02:11 +0200 |
commit | 74e125207283c029b373f9a9b8c0ed32921dc97b (patch) | |
tree | 225486268a06c4fb9cab3b6b9a10586d480e79ab /src/core/execute.h | |
parent | 36296ae2ad0e629be9ba968b66a075213e662cd3 (diff) | |
download | systemd-74e125207283c029b373f9a9b8c0ed32921dc97b.tar.gz |
execute: add helper for checking if root_directory/root_image are set in ExecContext
Diffstat (limited to 'src/core/execute.h')
-rw-r--r-- | src/core/execute.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/execute.h b/src/core/execute.h index c21154bda2..c4345005c1 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -23,6 +23,7 @@ typedef struct Manager Manager; #include "namespace.h" #include "nsflags.h" #include "numa-util.h" +#include "path-util.h" #include "time-util.h" #define EXEC_STDIN_DATA_MAX (64U*1024U*1024U) @@ -325,6 +326,14 @@ static inline bool exec_context_restrict_namespaces_set(const ExecContext *c) { return (c->restrict_namespaces & NAMESPACE_FLAGS_ALL) != NAMESPACE_FLAGS_ALL; } +static inline bool exec_context_with_rootfs(const ExecContext *c) { + assert(c); + + /* Checks if RootDirectory= or RootImage= are used */ + + return !empty_or_root(c->root_directory) || c->root_image; +} + typedef enum ExecFlags { EXEC_APPLY_SANDBOXING = 1 << 0, EXEC_APPLY_CHROOT = 1 << 1, |