2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Don't need to fill in struct sudo_user since we don't do matching.

This commit is contained in:
Todd C. Miller 2018-02-24 09:28:01 -07:00
parent 5999cfb906
commit 111d79b53c

View 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"));