Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: snap env variables leaking into terminal env #185834

Merged
merged 2 commits into from
Jun 22, 2023
Merged

Conversation

deepak1556
Copy link
Contributor

Fixes #179917
Fixes #179086

@deepak1556 deepak1556 self-assigned this Jun 22, 2023
@deepak1556 deepak1556 added this to the June 2023 milestone Jun 22, 2023
@deepak1556 deepak1556 marked this pull request as ready for review June 22, 2023 09:24
@deepak1556 deepak1556 enabled auto-merge (squash) June 22, 2023 09:24
@deepak1556 deepak1556 marked this pull request as draft June 22, 2023 09:41
auto-merge was automatically disabled June 22, 2023 09:41

Pull request was converted to draft

@deepak1556 deepak1556 marked this pull request as ready for review June 22, 2023 09:52
@deepak1556 deepak1556 merged commit 42457bd into main Jun 22, 2023
6 checks passed
@deepak1556 deepak1556 deleted the robo/fix_snap_env branch June 22, 2023 12:52
for (const key in process.env) {
if (key.endsWith('_VSCODE_SNAP_ORIG')) {
const originalKey = key.slice(0, -17); // Remove the _VSCODE_SNAP_ORIG suffix
if (this._snapEnv[originalKey]) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems suspicious.
Is it checking the _snapEnv[originalKey] is empty or not?
If it is not empty then it will skip the the complete loop logic following it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_snapEnv[originalKey] will not be defined when this function gets called, this is only present when multiple unsetSnapExportedVariables() calls are made without calling to restoreSnapExportedVariables(), which does not happen today.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GTK+ module libcanberra-gtk-module.so cannot be loaded Snap: no links open at all
3 participants