svn commit: trunk/busybox: examples/udhcp loginutils

vda at busybox.net vda at busybox.net
Tue Dec 26 17:37:40 UTC 2006


Author: vda
Date: 2006-12-26 09:37:38 -0800 (Tue, 26 Dec 2006)
New Revision: 17082

Log:
adduser: trivial code movement


Modified:
   trunk/busybox/Config.in
   trunk/busybox/examples/udhcp/udhcpd.conf
   trunk/busybox/loginutils/adduser.c


Changeset:
Modified: trunk/busybox/Config.in
===================================================================
--- trunk/busybox/Config.in	2006-12-26 10:42:51 UTC (rev 17081)
+++ trunk/busybox/Config.in	2006-12-26 17:37:38 UTC (rev 17082)
@@ -441,7 +441,7 @@
        prompt "not installed"
        depends on FEATURE_INSTALLER || FEATURE_SH_STANDALONE_SHELL
        help
-         Do not install applets links. Usefull when using the -install feature
+         Do not install applet links. Useful when using the -install feature
          or a standalone shell for rescue pruposes.
 
 endchoice

Modified: trunk/busybox/examples/udhcp/udhcpd.conf
===================================================================
--- trunk/busybox/examples/udhcp/udhcpd.conf	2006-12-26 10:42:51 UTC (rev 17081)
+++ trunk/busybox/examples/udhcp/udhcpd.conf	2006-12-26 17:37:38 UTC (rev 17082)
@@ -67,7 +67,7 @@
 
 #notify_file				#default: (no script)
 
-#notify_file	dumpleases 	# <--- usefull for debugging
+#notify_file	dumpleases 	# <--- useful for debugging
 
 # The following are bootp specific options, setable by udhcpd.
 

Modified: trunk/busybox/loginutils/adduser.c
===================================================================
--- trunk/busybox/loginutils/adduser.c	2006-12-26 10:42:51 UTC (rev 17081)
+++ trunk/busybox/loginutils/adduser.c	2006-12-26 17:37:38 UTC (rev 17082)
@@ -164,6 +164,11 @@
 	const char *usegroup = NULL;
 	unsigned long flags;
 
+	/* got root? */
+	if (geteuid()) {
+		bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
+	}
+
 	pw.pw_gecos = "Linux User,,,";
 	pw.pw_shell = (char *)DEFAULT_SHELL;
 	pw.pw_dir = NULL;
@@ -172,15 +177,10 @@
 	opt_complementary = "-1:?1:?";
 	flags = getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup);
 
-	/* got root? */
-	if(geteuid()) {
-		bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
-	}
-
 	/* create string for $HOME if not specified already */
 	if (!pw.pw_dir) {
 		snprintf(bb_common_bufsiz1, BUFSIZ, "/home/%s", argv[optind]);
-		pw.pw_dir = &bb_common_bufsiz1[0];
+		pw.pw_dir = bb_common_bufsiz1;
 	}
 
 	/* create a passwd struct */




More information about the busybox-cvs mailing list