Removed Snap related code from updateService.linux.ts#69979
Merged
joaomoreno merged 1 commit intomicrosoft:masterfrom Mar 8, 2019
Kedstar99:UpdateServiceBranch
Merged
Removed Snap related code from updateService.linux.ts#69979joaomoreno merged 1 commit intomicrosoft:masterfrom Kedstar99:UpdateServiceBranch
joaomoreno merged 1 commit intomicrosoft:masterfrom
Kedstar99:UpdateServiceBranch
Conversation
Fixed updateService.snap to not execute process based on environment variable.
Member
|
Thanks for the cleanup and the fix! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This patch does two things. The first removes the snap update code from updateService.linux.ts.
This is because the code always creates a SnapUpdateService if the environment variables are set. This occurs in vscode/src/vs/code/electron-main/app.ts.
The second change this patch introduces is the removal of spawning processes based on $SNAP_NAME. This is because an attacker could potentially leverage the environment variables SNAP, SNAP_REVISION and SNAP_NAME to enable execution through doQuitAndInstall.
I have instead replaced $SNAP_NAME with path.basename(process.argv[0]). This should be equivalent and should just return the name of the executing process. This will preserve the original behaviour whilst remaining compatible with all the various SNAP update mechanisms. This provides better guarantees of executing vscode than some other arbitrary program.