diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-09 17:21:26 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-09 17:21:26 +0000 |
commit | 84641942e5366b2e09367ba4f4376c99f15ecc8e (patch) | |
tree | eff2511dcc6cb647e0bf898903f86c94b85466ad /libbb/setup_environment.c | |
parent | bacaff6e5474d6c5f080ce4cd2a55e8ff1ba5c94 (diff) | |
download | busybox-w32-1_12_2.tar.gz busybox-w32-1_12_2.tar.bz2 busybox-w32-1_12_2.zip |
apply post-1.12.1 patches, bump version to 1.12.21_12_2
Diffstat (limited to 'libbb/setup_environment.c')
-rw-r--r-- | libbb/setup_environment.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index 04e333fed..78318ce62 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c | |||
@@ -32,16 +32,16 @@ | |||
32 | 32 | ||
33 | void FAST_FUNC setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) | 33 | void FAST_FUNC setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) |
34 | { | 34 | { |
35 | /* Change the current working directory to be the home directory | ||
36 | * of the user */ | ||
37 | if (chdir(pw->pw_dir)) { | ||
38 | xchdir("/"); | ||
39 | bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir); | ||
40 | } | ||
41 | |||
35 | if (clear_env) { | 42 | if (clear_env) { |
36 | const char *term; | 43 | const char *term; |
37 | 44 | ||
38 | /* Change the current working directory to be the home directory | ||
39 | * of the user */ | ||
40 | if (chdir(pw->pw_dir)) { | ||
41 | xchdir("/"); | ||
42 | bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir); | ||
43 | } | ||
44 | |||
45 | /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. | 45 | /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. |
46 | Unset all other environment variables. */ | 46 | Unset all other environment variables. */ |
47 | term = getenv("TERM"); | 47 | term = getenv("TERM"); |