mirror of
https://github.com/troglobit/finit.git
synced 2026-10-21 11:29:42 +00:00
Set $SHELL to a sane default value, used by BusyBox
When finit calls out to external tools, like `ifup $IFACE`, that tool in turn may use other external tools. On systems with BusyBox our calling `ifup $IFACE` will result in BusyBox casting a magic spell: if $SHELL is unset it goes looking in the file /etc/passwd for the shell of $USER which may not be set to a Bourne compatible UNIX shell, so commands like `ip link ...` or `run-parts ...` will fail hard. This patch adds SHELL=/bin/sh as a sane early default. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
396c1b491f
commit
a50bfc016e
1 file changed
+2
-1
+2
-1
@@ -282,9 +282,10 @@ int main(int argc, char* argv[])
|
||||
ctx = &loop;
|
||||
|
||||
/*
|
||||
* Set the PATH early to something sane
|
||||
* Set PATH and SHELL early to something sane
|
||||
*/
|
||||
setenv("PATH", _PATH_STDPATH, 1);
|
||||
setenv("SHELL", _PATH_BSHELL, 1);
|
||||
|
||||
/*
|
||||
* Mount base file system, kernel is assumed to run devtmpfs for /dev
|
||||
|
||||
Reference in new issue
Block a user