mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-28 21:07:55 +00:00
Don't need to fill in struct sudo_user since we don't do matching.
This commit is contained in:
parent
5999cfb906
commit
111d79b53c
@ -100,7 +100,7 @@ main(int argc, char *argv[])
|
|||||||
if (!sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale))
|
if (!sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale))
|
||||||
sudo_fatalx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
sudo_fatalx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
||||||
sudo_warn_set_locale_func(sudoers_warn_setlocale);
|
sudo_warn_set_locale_func(sudoers_warn_setlocale);
|
||||||
bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have visudo domain */
|
bindtextdomain("sudoers", LOCALEDIR);
|
||||||
textdomain("sudoers");
|
textdomain("sudoers");
|
||||||
|
|
||||||
/* Read debug and plugin sections of sudo.conf. */
|
/* 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. */
|
/* Setup defaults data structures. */
|
||||||
if (!init_defaults())
|
if (!init_defaults())
|
||||||
sudo_fatalx(U_("unable to initialize sudoers default values"));
|
sudo_fatalx(U_("unable to initialize sudoers default values"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user