mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
now give usage warning if use -l,-v,-k with args
This commit is contained in:
7
sudo.c
7
sudo.c
@@ -211,11 +211,9 @@ int main(argc, argv)
|
||||
break;
|
||||
case MODE_VALIDATE:
|
||||
cmnd = "validate";
|
||||
NewArgc = 1;
|
||||
break;
|
||||
case MODE_KILL:
|
||||
cmnd = "kill";
|
||||
NewArgc = 1;
|
||||
break;
|
||||
case MODE_LIST:
|
||||
/*
|
||||
@@ -227,7 +225,6 @@ int main(argc, argv)
|
||||
*/
|
||||
cmnd = "list";
|
||||
printmatches = 1;
|
||||
NewArgc = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -602,6 +599,10 @@ static int parse_args()
|
||||
NewArgv++;
|
||||
}
|
||||
|
||||
if (NewArgc > 0 && (ret == MODE_VALIDATE || ret == MODE_KILL ||
|
||||
ret == MODE_LIST))
|
||||
usage(1);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user