-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set SHELL env var in launcher if unset to avoid issues in Code's shel…
…l detection (#284) * Detect shell in launcher and set env var if unset Before launching Code, if the SHELL environment variable is unset, set it to something before launching: - If SHELL is unset and /bin/bash is installed, use that - Otherwise, fall back to /bin/sh as a 'safe' option This is necessary to avoid internal shell-detection logic in Code, which reads /etc/passwd when SHELL is not set. This is an issue when running in e.g. OpenShift, where cri-o will add a user entry to /etc/passwd containing /sbin/nologin as the login shell. * Add test cases to cover setting SHELL env var in launcher * Fixup typo in workspace file creation logs * Check /etc/passwd in launcher and only set SHELL if needed When launching Code, add an additional check to read /etc/passwd and check if the user has a (non-/sbin/nologin) shell defined there. If /etc/passwd contains any other shell (e.g. /bin/zsh, /bin/bash, etc.), then let Code read that shell from /etc/passwd instead of overriding it by setting the SHELL environment variable. --------- Signed-off-by: Angel Misevski <amisevsk@redhat.com>
- Loading branch information
Showing
3 changed files
with
271 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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