diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2022-05-02 14:47:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2022-05-02 14:47:53 +0200 |
commit | 1a290f889c5103d867ba1e0715ae730b394a3a12 (patch) | |
tree | db12eea1fddaaea4c65bef9839fb61fef6205bb4 | |
parent | 4642cf5b388bf60f6bea67ce3a5031d24bccd48a (diff) | |
download | busybox-w32-1a290f889c5103d867ba1e0715ae730b394a3a12.tar.gz busybox-w32-1a290f889c5103d867ba1e0715ae730b394a3a12.tar.bz2 busybox-w32-1a290f889c5103d867ba1e0715ae730b394a3a12.zip |
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>
-rw-r--r-- | init/init.c | 6 |
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) | |||
1105 | setsid(); | 1105 | setsid(); |
1106 | 1106 | ||
1107 | /* Make sure environs is set to something sane */ | 1107 | /* Make sure environs is set to something sane */ |
1108 | putenv((char *) "HOME=/"); | ||
1109 | putenv((char *) bb_PATH_root_path); | 1108 | putenv((char *) bb_PATH_root_path); |
1110 | putenv((char *) "SHELL=/bin/sh"); | 1109 | putenv((char *) "SHELL=/bin/sh"); |
1111 | putenv((char *) "USER=root"); /* needed? why? */ | 1110 | putenv((char *) "USER=root"); /* needed? why? */ |
1111 | /* Linux kernel sets HOME="/" when execing init, | ||
1112 | * and it can be overridden (but not unset?) on kernel's command line. | ||
1113 | * We used to set it to "/" here, but now we do not: | ||
1114 | */ | ||
1115 | //putenv((char *) "HOME=/"); | ||
1112 | 1116 | ||
1113 | if (argv[1]) | 1117 | if (argv[1]) |
1114 | xsetenv("RUNLEVEL", argv[1]); | 1118 | xsetenv("RUNLEVEL", argv[1]); |