summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2005-01-31 18:53:33 +0000
committermillert <millert@openbsd.org>2005-01-31 18:53:33 +0000
commit3edac170f1e21ac33efac671a671dac1b2fbedd6 (patch)
tree56b2a5b33ff3d067174afe8bfd72702eefa66244
parentDon't malloc fds each time, just realloc() as needed. (diff)
downloadwireguard-openbsd-3edac170f1e21ac33efac671a671dac1b2fbedd6.tar.xz
wireguard-openbsd-3edac170f1e21ac33efac671a671dac1b2fbedd6.zip
Warn if the user tries to use the -u option w/o running a command.
-rw-r--r--usr.bin/sudo/sudo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/sudo/sudo.c b/usr.bin/sudo/sudo.c
index 09449113b71..31edb653603 100644
--- a/usr.bin/sudo/sudo.c
+++ b/usr.bin/sudo/sudo.c
@@ -837,6 +837,12 @@ parse_args(argc, argv)
NewArgv++;
}
+ if (user_runas != NULL && !ISSET(rval, (MODE_EDIT|MODE_RUN))) {
+ if (excl != '\0')
+ warnx("the `-u' and '-%c' options may not be used together", excl);
+ usage(1);
+ }
+
if ((NewArgc == 0 && (rval & MODE_EDIT)) ||
(NewArgc > 0 && !(rval & (MODE_RUN | MODE_EDIT))))
usage(1);