[systemd-devel] [PATCH] DEFAULT_PATH_SPLIT_USR macro

Shawn Landden shawn at churchofgit.com
Fri Dec 20 15:35:38 PST 2013


---
 src/nspawn/nspawn.c    | 2 +-
 src/shared/path-util.h | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index a85579b..241b4b5 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1243,7 +1243,7 @@ int main(int argc, char *argv[]) {
                         gid_t gid = (gid_t) -1;
                         unsigned n_env = 2;
                         const char *envp[] = {
-                                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+                                "PATH=" DEFAULT_PATH_SPLIT_USR,
                                 "container=systemd-nspawn", /* LXC sets container=lxc, so follow the scheme here */
                                 NULL, /* TERM */
                                 NULL, /* HOME */
diff --git a/src/shared/path-util.h b/src/shared/path-util.h
index 1098f65..90cd964 100644
--- a/src/shared/path-util.h
+++ b/src/shared/path-util.h
@@ -26,8 +26,10 @@
 #include "macro.h"
 #include "time-util.h"
 
+#define DEFAULT_PATH_SPLIT_USR "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
 #ifdef HAVE_SPLIT_USR
-#  define DEFAULT_PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+#  define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR
 #else
 #  define DEFAULT_PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
 #endif
-- 
1.8.5.2



More information about the systemd-devel mailing list