From: nekral-guest Date: Sat, 20 Sep 2008 20:00:51 +0000 (+0000) Subject: * src/login.c: Check that no username is specified with -r. X-Git-Tag: 4.1.3~155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29d453304734ecff0cec73e98f40e36aee843033;p=shadow * src/login.c: Check that no username is specified with -r. * src/login.c: Make sure a username is specified with -f. --- 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 (); + } + }