Skip to content

Commit 3d467a7

Browse files
committed
rebuild_env: Avoid setting SHELL twice for "sudo -i"
Make sure DID_SHELL is set when we set SHELL in the "sudo -i" case. Otherwise, it will be set again when setting fallback values. Reported by Alejandro López at Red Hat. The code to make sure that SHELL is setu
1 parent c5fc321 commit 3d467a7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugins/sudoers/env.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ rebuild_env(const struct sudoers_context *ctx)
966966
if (ISSET(ctx->mode, MODE_LOGIN_SHELL)) {
967967
CHECK_SETENV2("SHELL", ctx->runas.pw->pw_shell,
968968
ISSET(didvar, DID_SHELL), true);
969+
SET(didvar, DID_SHELL);
969970
#ifdef _AIX
970971
CHECK_SETENV2("LOGIN", ctx->runas.pw->pw_name,
971972
ISSET(didvar, DID_LOGIN), true);

0 commit comments

Comments
 (0)