← Commit list

1a290f889

Denys Vlasenko
Denys Vlasenko
2022-05-02
SUCCESS Duration: 162s

Subject

init: do not set HOME

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

init/init.c+5 -1
@@ -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]);