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(git): Don't execute autostart programs when executing git commands #3993

Merged
merged 1 commit into from
May 21, 2020
Merged

fix(git): Don't execute autostart programs when executing git commands #3993

merged 1 commit into from
May 21, 2020

Conversation

greg-hutchinson
Copy link
Contributor

The way the current code works is that it has side effects when trying to execute a git command.
(This comes from the file git.ps1 in the lib directory).
(i.e current code
& "$env:COMSPEC" /c $cmd
)
Without the /d parameter, it also executes code that is in the windows autostart sections of the registry.
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

by adding the /d switch
& "$env:COMSPEC" /d /c $cmd
no extra autorun programs will be executed.

Normally, this does not have any adverse effects (it is just possibly slower), however, if there is an error in the autostart entries, it ends up returning errors to scoop that get interpreted incorrectly. In my case, I also had invalid entries left in the autostart and was receiving the error message -

"The system cannot find the path specified". And scoop was failing.

I have seen this reported on several bugs as well.

Of course, there are several fixes to this - remove the entries from the registry, but I believe by adding the /d switch to the line below, will save scoop reporting errors that are non-related to scoop and it will run potentially faster when the autostart programs are time-consuming.

@r15ch13 r15ch13 changed the title Don't execute autostart programs when executing git commands fix(git): Don't execute autostart programs when executing git commands May 21, 2020
@r15ch13 r15ch13 merged commit 22fd698 into ScoopInstaller:develop May 21, 2020
@greg-hutchinson greg-hutchinson deleted the develop branch June 1, 2020 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants