From: Todd C. Miller Date: Mon, 8 Jul 1996 18:16:45 +0000 (+0000) Subject: fixed -u user support X-Git-Tag: SUDO_1_5_0~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a616c40c518dacfd9d113ed59393d33ac9dd0a2;p=sudo fixed -u user support --- diff --git a/testsudoers.c b/testsudoers.c index a1a562e04..b2d227d61 100644 --- a/testsudoers.c +++ b/testsudoers.c @@ -266,9 +266,15 @@ main(argc, argv) user_pw_ent = &pw_ent; /* need user_pw_ent->pw_name defined */ - cmnd = argv[1]; - pw_ent.pw_name = argv[2]; - strcpy(host, argv[3]); + if (argc == 6) { + cmnd = argv[3]; + pw_ent.pw_name = argv[4]; + strcpy(host, argv[5]); + } else { + cmnd = argv[1]; + pw_ent.pw_name = argv[2]; + strcpy(host, argv[3]); + } if ((p = strchr(host, '.'))) { *p = '\0'; if ((shost = strdup(host)) == NULL) {