load_interfaces() now gets called if FQDN is set
-p now works with -s
This commit is contained in:
Todd C. Miller
1995-09-01 02:54:48 +00:00
parent ffbade1541
commit eb742282be

19
sudo.c
View File

@@ -205,6 +205,9 @@ main(argc, argv)
case MODE_VALIDATE : case MODE_VALIDATE :
cmnd = "validate"; cmnd = "validate";
break; break;
case MODE_KILL :
cmnd = "kill";
break;
case MODE_LIST : case MODE_LIST :
cmnd = "list"; cmnd = "list";
printmatches = 1; printmatches = 1;
@@ -212,7 +215,7 @@ main(argc, argv)
} }
/* must have a command to run unless got -s */ /* 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); usage(1);
/* /*
@@ -441,18 +444,18 @@ static void load_globals(sudo_mode)
#else #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 * We don't want to return the fully quallified name unless FQDN is set
*/ */
if ((p = strchr(host, '.'))) if ((p = strchr(host, '.')))
*p = '\0'; *p = '\0';
#endif /* FQDN */ #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]) { switch (Argv[1][1]) {
case 'p': case 'p':
if (Argc < 4) if (Argc + (ret & MODE_SHELL) < 4)
usage(1); usage(1);
prompt = Argv[2]; prompt = Argv[2];