From cfded513cd9b7febe4b7cf39a80411e4303f0655 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 24 Feb 2018 16:24:08 -0600 Subject: openrc-init: set a default path The default path provided by the system if one isn't set only includes "/bin:/usr/bin". This adds the default path setting from sysvinit. --- src/rc/openrc-init.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/rc/openrc-init.c') diff --git a/src/rc/openrc-init.c b/src/rc/openrc-init.c index eb346f59..de570e56 100644 --- a/src/rc/openrc-init.c +++ b/src/rc/openrc-init.c @@ -35,6 +35,7 @@ #include "rc-wtmp.h" #include "version.h" +static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin"; static const char *rc_default_runlevel = "default"; static pid_t do_openrc(const char *runlevel) @@ -183,6 +184,9 @@ int main(int argc, char **argv) sigaction(SIGINT, &sa, NULL); reboot(RB_DISABLE_CAD); + /* set default path */ + setenv("PATH", path_default, 1); + if (! reexec) init(default_runlevel); -- cgit v1.2.3