svn commit: branches/busybox_1_11_stable: include loginutils

aldot at busybox.net aldot at busybox.net
Tue Aug 5 14:33:38 UTC 2008


Author: aldot
Date: 2008-08-05 07:33:37 -0700 (Tue, 05 Aug 2008)
New Revision: 23051

Log:
- don't free user-supplied string (via -e)
- fix helptext
(r23046 from trunk)


Modified:
   branches/busybox_1_11_stable/include/usage.h
   branches/busybox_1_11_stable/loginutils/chpasswd.c


Changeset:
Modified: branches/busybox_1_11_stable/include/usage.h
===================================================================
--- branches/busybox_1_11_stable/include/usage.h	2008-08-05 14:15:19 UTC (rev 23050)
+++ branches/busybox_1_11_stable/include/usage.h	2008-08-05 14:33:37 UTC (rev 23051)
@@ -2916,13 +2916,13 @@
      "\n	-u	Unlock (re-enable) account" \
 
 #define chpasswd_trivial_usage \
-	USE_GETOPT_LONG("[--md5|--encrypt]") SKIP_GETOPT_LONG("[-m|-e]")
+	USE_GETOPT_LONG("[--md5|--encrypted]") SKIP_GETOPT_LONG("[-m|-e]")
 #define chpasswd_full_usage "\n\n" \
-       "Read user:password information from stdin\n" \
+       "Read user:password information from stdin " \
        "and update /etc/passwd accordingly.\n" \
      "\nOptions:" \
 	USE_GETOPT_LONG( \
-     "\n	-e,--encrypt	Supplied passwords are in encrypted form" \
+     "\n	-e,--encrypted	Supplied passwords are in encrypted form" \
      "\n	-m,--md5	Use MD5 encryption instead of DES" \
 	) \
 	SKIP_GETOPT_LONG( \

Modified: branches/busybox_1_11_stable/loginutils/chpasswd.c
===================================================================
--- branches/busybox_1_11_stable/loginutils/chpasswd.c	2008-08-05 14:15:19 UTC (rev 23050)
+++ branches/busybox_1_11_stable/loginutils/chpasswd.c	2008-08-05 14:33:37 UTC (rev 23051)
@@ -65,8 +65,8 @@
 			bb_info_msg("Password for '%s' changed", name);
 		logmode = LOGMODE_STDIO;
 		free(name);
-		free(pass);
+		if (!(opt & OPT_ENC))
+			free(pass);
 	}
-
-	return 0;
+	return EXIT_SUCCESS;
 }




More information about the busybox-cvs mailing list