aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-09-02 02:36:18 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-09-02 02:36:18 +0000
commitdc4e75ef7ca135c836d22e380847672cf5b3773b (patch)
treed2ff4fef7b9192de63761935103699569ecbb2ee /loginutils
parent005f83adf511ab89296639abbef737ad4e5826f9 (diff)
downloadbusybox-dc4e75ef7ca135c836d22e380847672cf5b3773b.tar.gz
move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant. Vodz last_patch_107
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/adduser.c3
-rw-r--r--loginutils/login.c10
-rw-r--r--loginutils/su.c1
3 files changed, 7 insertions, 7 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 41dc9f019..c4ab557d0 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -53,7 +53,6 @@ typedef struct {
static const char default_passwd[] = "x";
static const char default_gecos[] = "Linux User,,,";
static const char default_home_prefix[] = "/home";
-static const char default_shell[] = "/bin/sh";
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
/* shadow in use? */
@@ -257,7 +256,7 @@ int adduser_main(int argc, char **argv)
const char *login;
const char *gecos = default_gecos;
const char *home = NULL;
- const char *shell = default_shell;
+ const char *shell = DEFAULT_SHELL;
const char *usegroup = NULL;
int flags;
int setpass = 1;
diff --git a/loginutils/login.c b/loginutils/login.c
index c2bada258..3fca899c0 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -65,7 +65,7 @@ extern int login_main(int argc, char **argv)
char full_tty[200];
char fromhost[512];
char username[USERNAME_SIZE];
- char *tmp;
+ const char *tmp;
int amroot;
int flag;
int failed;
@@ -267,15 +267,17 @@ auth_ok:
chmod ( full_tty, 0600 );
change_identity ( pw );
- setup_environment ( pw-> pw_shell, 1, !opt_preserve, pw );
+ tmp = pw-> pw_shell;
+ if(!tmp || !*tmp)
+ tmp = DEFAULT_SHELL;
+ setup_environment ( tmp, 1, !opt_preserve, pw );
motd ( );
signal ( SIGALRM, SIG_DFL ); /* default alarm signal */
if ( pw-> pw_uid == 0 )
syslog ( LOG_INFO, "root login %s\n", fromhost );
-
- run_shell ( pw-> pw_shell, 1, 0, 0
+ run_shell ( tmp, 1, 0, 0
#ifdef CONFIG_SELINUX
, sid
#endif
diff --git a/loginutils/su.c b/loginutils/su.c
index 04c213e4e..2d7a7ac05 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -21,7 +21,6 @@
/* The shell to run if none is given in the user's passwd entry. */
-#define DEFAULT_SHELL "/bin/sh"
#define DEFAULT_USER "root"
//#define SYSLOG_SUCCESS