From fb4271bdf9f063e783289a93d8266b95e35adabc Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 18 May 2008 14:54:35 +0000 Subject: [PATCH] Import Debian patch 434_login_stop_checking_args_after-- * NEWS, src/login.c (check_flags): Stop checking the arguments after --. The later options will be sent to the shell, and do not need to be checked. --- ChangeLog | 7 +++++++ NEWS | 3 +++ src/login.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 84d1e260..8d7d79c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-18 Nicolas François + + Import Debian patch 434_login_stop_checking_args_after-- + * NEWS, src/login.c (check_flags): Stop checking the arguments + after --. The later options will be sent to the shell, and do not + need to be checked. + 2008-05-18 Nicolas François * src/vipw.c, src/su.c, src/newgrp.c: Harmonize the children's diff --git a/NEWS b/NEWS index c0e1c5b6..ffdbb201 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ shadow-4.1.1 -> shadow-4.1.2 UNRELEASED - chfn * Allow non-US-ASCII characters in the GECOS fields ("name", "room number", and "other info" fields). +- login + * Do not fail if a shell option, specified after --, has more than 2 + letters. - su * If the SULOG_FILE does not exist when an su session is logged, make sure the file is created with group root, instead of using the group diff --git a/src/login.c b/src/login.c index b4ade95e..9920840b 100644 --- a/src/login.c +++ b/src/login.c @@ -251,6 +251,9 @@ static void check_flags (int argc, char *const *argv) for (arg = 1; arg < argc; arg++) { if (argv[arg][0] == '-' && strlen (argv[arg]) > 2) usage (); + if (strcmp(argv[arg], "--") == 0) { + break; /* stop checking on a "--" */ + } } }