Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-05-02 15:47:53 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2022-05-02 15:47:53 +0300
commit1a290f889c5103d867ba1e0715ae730b394a3a12 (patch)
treedb12eea1fddaaea4c65bef9839fb61fef6205bb4 /init
parent4642cf5b388bf60f6bea67ce3a5031d24bccd48a (diff)
init: do not set HOME
function old new delta .rodata 104906 104899 -7 init_main 786 776 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-17) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'init')
-rw-r--r--init/init.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c
index 785a3b460..1e1ce833d 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1105,10 +1105,14 @@ int init_main(int argc UNUSED_PARAM, char **argv)
setsid();
/* Make sure environs is set to something sane */
- putenv((char *) "HOME=/");
putenv((char *) bb_PATH_root_path);
putenv((char *) "SHELL=/bin/sh");
putenv((char *) "USER=root"); /* needed? why? */
+ /* Linux kernel sets HOME="/" when execing init,
+ * and it can be overridden (but not unset?) on kernel's command line.
+ * We used to set it to "/" here, but now we do not:
+ */
+ //putenv((char *) "HOME=/");
if (argv[1])
xsetenv("RUNLEVEL", argv[1]);