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 :
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];