From eb742282be55e88bbe11f2e02a56dd83af3c381d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 1 Sep 1995 02:54:48 +0000 Subject: [PATCH] fixed -k load_interfaces() now gets called if FQDN is set -p now works with -s --- sudo.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sudo.c b/sudo.c index 3a6814cf7..a5f4120e8 100644 --- a/sudo.c +++ b/sudo.c @@ -205,6 +205,9 @@ main(argc, argv) case MODE_VALIDATE : cmnd = "validate"; break; + case MODE_KILL : + cmnd = "kill"; + break; case MODE_LIST : cmnd = "list"; printmatches = 1; @@ -212,7 +215,7 @@ main(argc, argv) } /* must have a command to run unless got -s */ - if (Argc == 1 && !(sudo_mode & MODE_SHELL)) + if (cmnd == NULL && Argc == 1 && !(sudo_mode & MODE_SHELL)) usage(1); /* @@ -441,18 +444,18 @@ static void load_globals(sudo_mode) #else } - /* - * load a list of ip addresses and netmasks into - * the interfaces array. - */ - load_interfaces(); - /* * We don't want to return the fully quallified name unless FQDN is set */ if ((p = strchr(host, '.'))) *p = '\0'; #endif /* FQDN */ + + /* + * load a list of ip addresses and netmasks into + * the interfaces array. + */ + load_interfaces(); } @@ -486,7 +489,7 @@ static int parse_args() switch (Argv[1][1]) { case 'p': - if (Argc < 4) + if (Argc + (ret & MODE_SHELL) < 4) usage(1); prompt = Argv[2]; -- 2.40.0