]> granicus.if.org Git - shadow/commitdiff
Merge Debian's patch 408_passwd_check_arguments
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 26 Dec 2007 22:17:13 +0000 (22:17 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 26 Dec 2007 22:17:13 +0000 (22:17 +0000)
* NEWS, src/passwd.c: Make sure that no more than one username
argument was provided.

ChangeLog
NEWS
src/passwd.c

index 1f12ae14b7805240a1495a094555d4375c2c4eb5..c4994ab09c363970442e37aa3bf64ac6b5cd2f06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-26  Nicolas François  <nicolas.francois@centraliens.net>
+
+       Merge Debian's patch 408_passwd_check_arguments
+       * NEWS, src/passwd.c: Make sure that no more than one username
+       argument was provided.
+
 2007-12-26  Nicolas François  <nicolas.francois@centraliens.net>
 
        Merge Debian's patch 412_lastlog_-u_numerical_range
diff --git a/NEWS b/NEWS
index 7d9b9b07fb4885348c4d94aeb3a951c4a6c04ed7..6334d05de1365520bdb14470bdb3834dcd2c9290 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ shadow-4.1.0 -> shadow-4.1.1                                          UNRELEASED
 - lastlog
   * Accept users specified as a numerical UID, or ranges of users (-user,
     user-, user1-user2).
+- passwd
+  * Make sure that no more than one username argument was provided.
 
 shadow-4.0.18.2 -> shadow-4.1.0                                                09-12-2008
 
index 364c0ecf8dd86c2e120ba23facfa5ccdac2c371c..9c1c6841f5c8694f3cc82ff23cbfee1b766a14bc 100644 (file)
@@ -788,6 +788,12 @@ int main (int argc, char **argv)
        else
                name = myname;
 
+       /*
+        * Make sure that at most one username was specified.
+        */
+       if (argc > optind+1)
+               usage (E_USAGE);
+
        /*
         * The -a flag requires -S, no other flags, no username, and
         * you must be root.  --marekm