aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-03-06 18:49:40 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-03-06 18:49:40 +0100
commitbd74e3d8beb0fedc4c1fdd9469a9de3f1f04c7b5 (patch)
treef1bf618a965c8a3f01811715f4c9684bee767ad0 /libbb
parent41478ade4f28cbacd954c9663d851c374d33f6b9 (diff)
downloadbusybox-bd74e3d8beb0fedc4c1fdd9469a9de3f1f04c7b5.tar.gz
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.c3
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 @@
void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw)
{
+ if (!shell || !shell[0])
+ shell = DEFAULT_SHELL;
+
/* Change the current working directory to be the home directory
* of the user */
if (chdir(pw->pw_dir)) {