From: nekral-guest Date: Wed, 26 Dec 2007 22:17:13 +0000 (+0000) Subject: Merge Debian's patch 408_passwd_check_arguments X-Git-Tag: 4.1.1~280 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5461ff01ec53cabe2ac0fe4dc2b0364b35b61e6;p=shadow Merge Debian's patch 408_passwd_check_arguments * NEWS, src/passwd.c: Make sure that no more than one username argument was provided. --- diff --git a/ChangeLog b/ChangeLog index 1f12ae14..c4994ab0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-26 Nicolas François + + 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 Merge Debian's patch 412_lastlog_-u_numerical_range diff --git a/NEWS b/NEWS index 7d9b9b07..6334d05d 100644 --- 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 diff --git a/src/passwd.c b/src/passwd.c index 364c0ecf..9c1c6841 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -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