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.
This commit is contained in:
William Hubbs 2018-02-24 16:24:08 -06:00
parent 16ff3cd8df
commit cfded513cd

View File

@ -35,6 +35,7 @@
#include "rc-wtmp.h" #include "rc-wtmp.h"
#include "version.h" #include "version.h"
static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin";
static const char *rc_default_runlevel = "default"; static const char *rc_default_runlevel = "default";
static pid_t do_openrc(const char *runlevel) static pid_t do_openrc(const char *runlevel)
@ -183,6 +184,9 @@ int main(int argc, char **argv)
sigaction(SIGINT, &sa, NULL); sigaction(SIGINT, &sa, NULL);
reboot(RB_DISABLE_CAD); reboot(RB_DISABLE_CAD);
/* set default path */
setenv("PATH", path_default, 1);
if (! reexec) if (! reexec)
init(default_runlevel); init(default_runlevel);