Repository navigation
fix(safe-env): skip readonly EUID and PPID variables under set -e - #5126
Closed
vaibhavsrv wants to merge 1 commit into
Closed
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
This was referenced Sep 15, 2026
Collaborator
|
Thanks for this contribution. |
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.
Why this matters
ods/lib/safe-env.shparses.envfiles and script outputs to export variables for Docker Compose and ODS lifecycle commands. Previously, a guard was added skipping Bash's readonly variableUID. However, container wrapper scripts and multi-user environments frequently defineEUIDandPPID(e.g. for user/group mapping or process ancestry).Because Bash enforces
EUIDandPPIDas readonly shell variables, attemptingexport EUID=...orexport PPID=...underset -etriggers an immediate fatal error (bash: line X: EUID: readonly variable) and terminates ODS lifecycle commands before reaching Compose.Skipping
EUIDandPPIDalongsideUIDin bothload_env_fileandload_env_from_outputavoids aborting execution while allowing the rest of the.envfile to load normally.Overlap check
Searched live open/closed PRs by
safe-env,readonly,load_env_file, andlib/safe-env.sh. #3820 merged the initialUIDreadonly variable check, #3718 merged inline comments handling, and #3712 normalized CRLF line endings. None coversEUIDorPPID. This change directly hardens the existing readonly variable filter without conflicting with pending.envserializers.Validation
bash ods/tests/test-safe-env.sh: All 14 test groups pass, including the expanded Test 10 asserting thatUID,EUID, andPPIDin.envare skipped without failing underset -e.bash ods/tests/test-validate-env.shandbash ods/tests/test-dotenv-serializer.sh: Both pass cleanly.ods/lib/safe-env.sh.Review status and composition
Independent human review welcome. Change is 4 lines in
ods/lib/safe-env.shand 8 lines inods/tests/test-safe-env.sh. Composes cleanly with upstreampublic-betaHEAD33155fb5.