diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-04-20 11:36:25 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-04-20 11:36:25 +0200 |
commit | 0c300adfa4c166bc13fc0847bec19f257fc79f97 (patch) | |
tree | 93fdd7f1590fc99ac66d923216993cf8b328c1ce /src/basic/path-util.h | |
parent | Merge pull request #8754 from poettering/sysusers-fix (diff) | |
download | systemd-0c300adfa4c166bc13fc0847bec19f257fc79f97.tar.xz systemd-0c300adfa4c166bc13fc0847bec19f257fc79f97.zip |
nspawn: when running nspawn, set a $PATH including both bin + sbin by default (#8756)
We don't know what the container payload needs, hence default to a PATH
with both bin and sbin included, as well as / and /usr.
Follow-up for #8324
Fixes: #8698
Diffstat (limited to 'src/basic/path-util.h')
-rw-r--r-- | src/basic/path-util.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/basic/path-util.h b/src/basic/path-util.h index fa8f8e4eab..fd3143d9ac 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -15,18 +15,25 @@ #include "string-util.h" #include "time-util.h" +#define PATH_SPLIT_SBIN_BIN(x) x "sbin:" x "bin" +#define PATH_SPLIT_SBIN_BIN_NULSTR(x) x "sbin\0" x "bin\0" + +#define PATH_NORMAL_SBIN_BIN(x) x "bin" +#define PATH_NORMAL_SBIN_BIN_NULSTR(x) x "bin\0" + #if HAVE_SPLIT_BIN -# define PATH_SBIN_BIN(x) x "sbin:" x "bin" -# define PATH_SBIN_BIN_NULSTR(x) x "sbin\0" x "bin\0" +# define PATH_SBIN_BIN(x) PATH_SPLIT_SBIN_BIN(x) +# define PATH_SBIN_BIN_NULSTR(x) PATH_SPLIT_SBIN_BIN_NULSTR(x) #else -# define PATH_SBIN_BIN(x) x "bin" -# define PATH_SBIN_BIN_NULSTR(x) x "bin\0" +# define PATH_SBIN_BIN(x) PATH_NORMAL_SBIN_BIN(x) +# define PATH_SBIN_BIN_NULSTR(x) PATH_NORMAL_SBIN_BIN_NULSTR(x) #endif #define DEFAULT_PATH_NORMAL PATH_SBIN_BIN("/usr/local/") ":" PATH_SBIN_BIN("/usr/") #define DEFAULT_PATH_NORMAL_NULSTR PATH_SBIN_BIN_NULSTR("/usr/local/") PATH_SBIN_BIN_NULSTR("/usr/") #define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":" PATH_SBIN_BIN("/") #define DEFAULT_PATH_SPLIT_USR_NULSTR DEFAULT_PATH_NORMAL_NULSTR PATH_SBIN_BIN_NULSTR("/") +#define DEFAULT_PATH_COMPAT PATH_SPLIT_SBIN_BIN("/usr/local/") ":" PATH_SPLIT_SBIN_BIN("/usr/") ":" PATH_SPLIT_SBIN_BIN("/") #if HAVE_SPLIT_USR # define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR |