[BusyBox-cvs] busybox/loginutils adduser.c, 1.7, 1.8 login.c, 1.12, 1.13 su.c, 1.5, 1.6

Glenn McGrath bug1 at busybox.net
Tue Sep 2 02:36:16 UTC 2003


Update of /var/cvs/busybox/loginutils
In directory winder:/tmp/cvs-serv18900/loginutils

Modified Files:
	adduser.c login.c su.c 
Log Message:
move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107


Index: adduser.c
===================================================================
RCS file: /var/cvs/busybox/loginutils/adduser.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- adduser.c	21 Jun 2003 20:03:07 -0000	1.7
+++ adduser.c	2 Sep 2003 02:36:13 -0000	1.8
@@ -53,7 +53,6 @@
 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 @@
 	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;

Index: su.c
===================================================================
RCS file: /var/cvs/busybox/loginutils/su.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- su.c	29 Aug 2003 07:38:56 -0000	1.5
+++ su.c	2 Sep 2003 02:36:13 -0000	1.6
@@ -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

Index: login.c
===================================================================
RCS file: /var/cvs/busybox/loginutils/login.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- login.c	30 Jul 2003 06:56:07 -0000	1.12
+++ login.c	2 Sep 2003 02:36:13 -0000	1.13
@@ -65,7 +65,7 @@
 	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 @@
 	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




More information about the busybox-cvs mailing list