diff --git a/ChangeLog b/ChangeLog index 49b432ce..9b9a741c 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 c6d6fc03..9a37565c 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 653b7227..dd8f1a96 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 (); }