diff options
-rw-r--r-- | usr.bin/sudo/sudo.c | 6 |
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); |