2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-28 21:07:55 +00:00

Add -U sudoers_uid option to testsudoers.

This commit is contained in:
Todd C. Miller 2012-05-18 14:29:29 -04:00
parent fe5bf03061
commit b35cd75533

View File

@ -160,7 +160,7 @@ main(int argc, char *argv[])
dflag = 0; dflag = 0;
grfile = pwfile = NULL; grfile = pwfile = NULL;
while ((ch = getopt(argc, argv, "dg:G:h:p:tu:")) != -1) { while ((ch = getopt(argc, argv, "dg:G:h:p:tu:U:")) != -1) {
switch (ch) { switch (ch) {
case 'd': case 'd':
dflag = 1; dflag = 1;
@ -180,6 +180,9 @@ main(int argc, char *argv[])
case 't': case 't':
trace_print = testsudoers_print; trace_print = testsudoers_print;
break; break;
case 'U':
sudoers_uid = atoi(optarg);
break;
case 'u': case 'u':
runas_user = optarg; runas_user = optarg;
break; break;
@ -677,6 +680,6 @@ static int testsudoers_print(const char *msg)
void void
usage(void) usage(void)
{ {
(void) fprintf(stderr, "usage: %s [-dt] [-G grfile] [-g group] [-h host] [-p pwfile] [-u user] <user> <command> [args]\n", getprogname()); (void) fprintf(stderr, "usage: %s [-dt] [-G grfile] [-g group] [-h host] [-p pwfile] [-U sudoers_uid] [-u user] <user> <command> [args]\n", getprogname());
exit(1); exit(1);
} }