]> granicus.if.org Git - sudo/commitdiff
Don't need to fill in struct sudo_user since we don't do matching.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Sat, 24 Feb 2018 16:28:01 +0000 (09:28 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Sat, 24 Feb 2018 16:28:01 +0000 (09:28 -0700)
plugins/sudoers/cvtsudoers.c

index 728c51ed575502cd8bdbc74b87a1bf7a74498b18..456f7f3283aef817a64f6720d26aca89700911e1 100644 (file)
@@ -100,7 +100,7 @@ main(int argc, char *argv[])
     if (!sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale))
        sudo_fatalx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
     sudo_warn_set_locale_func(sudoers_warn_setlocale);
-    bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have visudo domain */
+    bindtextdomain("sudoers", LOCALEDIR);
     textdomain("sudoers");
 
     /* Read debug and plugin sections of sudo.conf. */
@@ -249,20 +249,6 @@ main(int argc, char *argv[])
        }
     }
 
-    /* Mock up a fake sudo_user struct. */
-    /* XXX - should not be required */
-    user_cmnd = user_base = "";
-    if (geteuid() == 0) {
-       const char *user = getenv("SUDO_USER");
-       if (user != NULL && *user != '\0')
-           sudo_user.pw = sudo_getpwnam(user);
-    }
-    if (sudo_user.pw == NULL) {
-       if ((sudo_user.pw = sudo_getpwuid(getuid())) == NULL)
-           sudo_fatalx(U_("you do not exist in the %s database"), "passwd");
-    }
-    get_hostname();
-
     /* Setup defaults data structures. */
     if (!init_defaults())
        sudo_fatalx(U_("unable to initialize sudoers default values"));