Skip to content

Use quotes around default GVFS.Hooks.exe configuration #1838

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

tyrielv
Copy link
Contributor

@tyrielv tyrielv commented May 13, 2025

The default install location on Windows is in C:\Program Files\VFS for Git. When configuring the hook for GVFS.Hooks.exe the absolute path is recorded in pre-command.hooks and post-command.hooks.

GitHooksLoader.exe will read that line verbatim and try to execute it using CreateProcess. This typically works, but it checks for executable files at "C:\Program", "C:\Program.exe", "C:\Program Files\VFS", "C:\Program Files\VFS.exe" etc before resolving to the correct executable.

If a user has a file at C:\Program, then the pre-command hook will try to run it instead, typically failing and blocking all git/gvfs operations.

This pull request puts quotes around the absolute path of GVFS.Hooks.exe when configuring the pre/post command hooks, so that CreateProcess will resolve immediately to the correct executable instead of checking partial paths.

@tyrielv tyrielv merged commit 6b8e93b into microsoft:master May 14, 2025
5 checks passed
@mjcheetham mjcheetham mentioned this pull request May 20, 2025
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.

2 participants