diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-06 18:49:40 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-06 18:49:40 +0100 |
| commit | bd74e3d8beb0fedc4c1fdd9469a9de3f1f04c7b5 (patch) | |
| tree | f1bf618a965c8a3f01811715f4c9684bee767ad0 /libbb | |
| parent | 41478ade4f28cbacd954c9663d851c374d33f6b9 (diff) | |
| download | busybox-w32-bd74e3d8beb0fedc4c1fdd9469a9de3f1f04c7b5.tar.gz busybox-w32-bd74e3d8beb0fedc4c1fdd9469a9de3f1f04c7b5.tar.bz2 busybox-w32-bd74e3d8beb0fedc4c1fdd9469a9de3f1f04c7b5.zip | |
libbb/login/su: do not sanitize shell name twice
function old new delta
setup_environment 191 205 +14
login_main 1002 987 -15
su_main 474 458 -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-31) Total: -17 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
| -rw-r--r-- | libbb/setup_environment.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index a95fbc5bf..73229ca6c 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c | |||
| @@ -32,6 +32,9 @@ | |||
| 32 | 32 | ||
| 33 | void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw) | 33 | void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw) |
| 34 | { | 34 | { |
| 35 | if (!shell || !shell[0]) | ||
| 36 | shell = DEFAULT_SHELL; | ||
| 37 | |||
| 35 | /* Change the current working directory to be the home directory | 38 | /* Change the current working directory to be the home directory |
| 36 | * of the user */ | 39 | * of the user */ |
| 37 | if (chdir(pw->pw_dir)) { | 40 | if (chdir(pw->pw_dir)) { |
