]> granicus.if.org Git - sudo/commitdiff
if SHELL_IF_NO_ARGS is set, "sudo -- foo" now runs a shell
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 10 Sep 1995 01:00:24 +0000 (01:00 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 10 Sep 1995 01:00:24 +0000 (01:00 +0000)
and passes along foo as the arguments

sudo.c

diff --git a/sudo.c b/sudo.c
index 958c77b4063edc5a1cd742a84d43181183114ce6..bc303c935582f9d9e92f80276afe370227967f75 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -551,6 +551,10 @@ static int parse_args()
                Argc--;
                Argv++;
                Argv[0] = progname;
+#ifdef SHELL_IF_NO_ARGS
+               if (ret == MODE_RUN)
+                   ret |= MODE_SHELL;
+#endif /* SHELL_IF_NO_ARGS */
                return(ret);
            case '\0':
                (void) fprintf(stderr, "%s: '-' requires an argument\n",