From 29d453304734ecff0cec73e98f40e36aee843033 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 20 Sep 2008 20:00:51 +0000 Subject: [PATCH] * src/login.c: Check that no username is specified with -r. * src/login.c: Make sure a username is specified with -f. --- ChangeLog | 2 ++ src/login.c | 9 +++++++++ 2 files changed, 11 insertions(+) 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 (); + } + }