]> err.no Git - systemd/commitdiff
main: set $PATH if it isn't set
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Apr 2010 21:24:41 +0000 (23:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Apr 2010 21:24:50 +0000 (23:24 +0200)
main.c

diff --git a/main.c b/main.c
index 397e868e97461e37871b74d5b8391bd0d624848b..ea001b18b0266fa92d1c9c38728d17e56cbe3785 100644 (file)
--- a/main.c
+++ b/main.c
@@ -272,6 +272,9 @@ int main(int argc, char *argv[]) {
 
         assert_se(action == ACTION_RUN || action == ACTION_TEST);
 
+        /* Set up PATH unless it is already set */
+        setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", false);
+
         /* Move out of the way, so that we won't block unmounts */
         assert_se(chdir("/")  == 0);