[v14] Prevent .tsh/environment values from overloading prior set values#34626
Merged
jentfoo merged 3 commits intobranch/v14from Nov 16, 2023
Merged
[v14] Prevent .tsh/environment values from overloading prior set values#34626jentfoo merged 3 commits intobranch/v14from
.tsh/environment values from overloading prior set values#34626jentfoo merged 3 commits intobranch/v14from
Conversation
It's not possible to have duplicate environment values within an environment. And in fact the last value in the string slice will be preserved. Prior to this change that allows users to possibly change any environment values through the use of the `.tsh/environment` file. This is within user level control, where other environment value sources originate from a more protected location (for example the PAM configuration). Prior to this change that allows users to possibly change any environment passed configuration through the use of the `.tsh/environment` file. This change makes it so that the administrative set values will be preferred, and any duplicate records will be ignored.
This change updates `SafeEnv` to be allow the caller to select if the value should be checked for duplicates. We then leverage this to avoid this check when sourced from a trusted source. But then exclude potential duplicates when sourced from .tsh/environment file or the local environment.
rosstimothy
approved these changes
Nov 15, 2023
zmb3
approved these changes
Nov 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #34277 to branch/v14
changelog: Environment values can not be overridden from the .tsh/environment file, only unique keys will be inserted into the environment.