]> granicus.if.org Git - sudo/commitdiff
fixed -u user support
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 8 Jul 1996 18:16:45 +0000 (18:16 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 8 Jul 1996 18:16:45 +0000 (18:16 +0000)
testsudoers.c

index a1a562e0447f22d4c409ffcde2ae2ab38639eda8..b2d227d6190645f2455a5531132dce05081c5ef1 100644 (file)
@@ -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) {