diff --git a/ChangeLog b/ChangeLog index 68be0800..97a5e4ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ * src/login.c: Copy the name of the user authenticated by PAM to username. This simplify later logging (avoid USE_PAM conditional). + * src/login.c: Check that no username is specified with -r. + * src/login.c: Make sure a username is specified with -f. 2008-09-20 Nicolas François diff --git a/src/login.c b/src/login.c index 60964d3d..5d31df0c 100644 --- a/src/login.c +++ b/src/login.c @@ -339,6 +339,15 @@ static void process_flags (int argc, char *const *argv) ++optind; } +#ifdef RLOGIN + if (rflg && (NULL != username)) { + usage (); + } +#endif /* RLOGIN */ + if (fflg && (NULL == username)) { + usage (); + } + }