From: Todd C. Miller Date: Wed, 12 May 2010 12:32:12 +0000 (-0400) Subject: Call env_init() before we open the sudoers sources as those may X-Git-Tag: SUDO_1_8_0~640 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1487026b03ceff729b187f572db39bb8057d3a1e;p=sudo Call env_init() before we open the sudoers sources as those may call our setenv() replacement. --- diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 6c043df1b..f2ec5edc7 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -208,6 +208,9 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation, sudo_setpwent(); sudo_setgrent(); + /* Initialize environment functions (including replacements). */ + env_init(envp); + /* Setup defaults data structures. */ init_defaults(); @@ -260,9 +263,6 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation, /* Set login class if applicable. */ set_loginclass(sudo_user.pw); - /* Initialize environment functions (including replacements). */ - env_init(envp); - restore_perms(); return TRUE;