From: Todd C. Miller Date: Sat, 24 Feb 2018 16:28:01 +0000 (-0700) Subject: Don't need to fill in struct sudo_user since we don't do matching. X-Git-Tag: SUDO_1_8_23^2~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=111d79b53c0469eb5a436c53072c4ea19d13efd1;p=sudo Don't need to fill in struct sudo_user since we don't do matching. --- diff --git a/plugins/sudoers/cvtsudoers.c b/plugins/sudoers/cvtsudoers.c index 728c51ed5..456f7f328 100644 --- a/plugins/sudoers/cvtsudoers.c +++ b/plugins/sudoers/cvtsudoers.c @@ -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"));