Pass a pointer to user_env in to the init_session policy plugin
function so session setup can modify the user environment as needed. For PAM authentication, merge the PAM environment with the user environment at init_session time. We no longer need to swap in the user_env for environ during session init, nor do we need to disable the env hooks at init_session time.
This commit is contained in:
@@ -286,7 +286,7 @@ done:
|
||||
}
|
||||
|
||||
int
|
||||
sudo_auth_begin_session(struct passwd *pw)
|
||||
sudo_auth_begin_session(struct passwd *pw, char **user_env[])
|
||||
{
|
||||
sudo_auth *auth;
|
||||
int status;
|
||||
@@ -294,7 +294,7 @@ sudo_auth_begin_session(struct passwd *pw)
|
||||
|
||||
for (auth = auth_switch; auth->name; auth++) {
|
||||
if (auth->begin_session && !IS_DISABLED(auth)) {
|
||||
status = (auth->begin_session)(pw, auth);
|
||||
status = (auth->begin_session)(pw, user_env, auth);
|
||||
if (status == AUTH_FATAL) {
|
||||
/* XXX log */
|
||||
audit_failure(NewArgv, "authentication failure");
|
||||
|
Reference in New Issue
Block a user