From: nekral-guest Date: Tue, 20 Nov 2007 13:09:55 +0000 (+0000) Subject: The -c, -e, and -m options are exclusives. X-Git-Tag: 4.1.0~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a30c0a8192bef527f898c03412ddae4586515928;p=thirdparty%2Fshadow.git The -c, -e, and -m options are exclusives. --- diff --git a/ChangeLog b/ChangeLog index 49b432ce1..9b9a741c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-20 Nicolas François + + * src/chgpasswd.c, src/chpasswd.c: The -c, -e, and -m options are + exclusives. + 2007-11-20 Nicolas François * man/chpasswd.8.xml, man/chgpasswd.8.xml: Document how the diff --git a/src/chgpasswd.c b/src/chgpasswd.c index c6d6fc037..9a37565c9 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -184,9 +184,10 @@ int main (int argc, char **argv) Prog, "-s", "-c"); usage (); } - if (md5flg && cflg) { + if ((eflg && (md5flg || cflg)) || + md5flg && cflg) { fprintf (stderr, - _("%s: the -m and -c flags are exclusive\n"), + _("%s: the -c, -e, and -m flags are exclusive\n"), Prog); usage (); } diff --git a/src/chpasswd.c b/src/chpasswd.c index 653b7227a..dd8f1a961 100644 --- a/src/chpasswd.c +++ b/src/chpasswd.c @@ -178,9 +178,10 @@ int main (int argc, char **argv) Prog, "-s", "-c"); usage (); } - if (md5flg && cflg) { + if ((eflg && (md5flg || cflg)) || + md5flg && cflg) { fprintf (stderr, - _("%s: the -m and -c flags are exclusive\n"), + _("%s: the -c, -e, and -m flags are exclusive\n"), Prog); usage (); }