chiark / gitweb /
DEFAULT_PATH_SPLIT_USR macro
authorShawn Landden <shawn@churchofgit.com>
Fri, 20 Dec 2013 23:35:38 +0000 (15:35 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 21 Dec 2013 04:14:21 +0000 (23:14 -0500)
src/nspawn/nspawn.c
src/shared/path-util.h

index a85579b..241b4b5 100644 (file)
@@ -1243,7 +1243,7 @@ int main(int argc, char *argv[]) {
                         gid_t gid = (gid_t) -1;
                         unsigned n_env = 2;
                         const char *envp[] = {
                         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 */
                                 "container=systemd-nspawn", /* LXC sets container=lxc, so follow the scheme here */
                                 NULL, /* TERM */
                                 NULL, /* HOME */
index 1098f65..4b74fe0 100644 (file)
 #include "macro.h"
 #include "time-util.h"
 
 #include "macro.h"
 #include "time-util.h"
 
+#define DEFAULT_PATH_NORMAL "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
+#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin"
+
 #ifdef HAVE_SPLIT_USR
 #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
 #else
-#  define DEFAULT_PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
+#  define DEFAULT_PATH DEFAULT_PATH_NORMAL
 #endif
 
 bool is_path(const char *p) _pure_;
 #endif
 
 bool is_path(const char *p) _pure_;