]> granicus.if.org Git - shadow/commitdiff
su.c: fix '--' slurping
authorHarm te Hennepe <harm@tehennepe.org>
Mon, 26 Mar 2018 20:37:56 +0000 (22:37 +0200)
committerHarm te Hennepe <harm@tehennepe.org>
Mon, 26 Mar 2018 20:37:56 +0000 (22:37 +0200)
All arguments are already reordered and parsed by getopt_long since e663c69, so manual '--' slurping is wrong.

Closes #101

src/su.c

index 974048e9fccc0e2e898fa338b61197db9076a667..0e5dd6fd32006862cfcfb44a19f9c6aa7027b15f 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -809,10 +809,6 @@ static void process_flags (int argc, char **argv)
        if ((optind < argc) && (strcmp (argv[optind], "-") == 0)) {
                fakelogin = true;
                optind++;
-               if (   (optind < argc)
-                   && (strcmp (argv[optind], "--") == 0)) {
-                       optind++;
-               }
        }
 
        /*
@@ -823,9 +819,6 @@ static void process_flags (int argc, char **argv)
         */
        if ((optind < argc) && ('-' != argv[optind][0])) {
                STRFCPY (name, argv[optind++]); /* use this login id */
-               if ((optind < argc) && (strcmp (argv[optind], "--") == 0)) {
-                       optind++;
-               }
        }
        if ('\0' == name[0]) {          /* use default user */
                struct passwd *root_pw = getpwnam ("root");