Skip to content

Fix bfscfg argument quoting for paths with spaces - #25

Merged
shschaefer merged 1 commit into
microsoft:mainfrom
shanselman:fix/bfscfg-quote-paths-with-spaces
Mar 5, 2026
Merged

Fix bfscfg argument quoting for paths with spaces#25
shschaefer merged 1 commit into
microsoft:mainfrom
shanselman:fix/bfscfg-quote-paths-with-spaces

Conversation

@shanselman

Copy link
Copy Markdown
Member

Summary

Fixes #24 — filesystem paths containing spaces are not quoted when passed to bfscfg.exe, causing the path to be split into multiple arguments and the policy to silently fail.

What changed

wxc_common/FileSystemBfsManager.cppRunBfsCfg()

Arguments containing spaces are now wrapped in double quotes before being appended to the command line string.

Before: bfscfg.exe --addpolicy --policybroker --filename C:\...\Session Storage --appid Clippy
After: bfscfg.exe --addpolicy --policybroker --filename "C:\...\Session Storage" --appid Clippy

Testing

With a policy containing a path with spaces (e.g. Session Storage):

  • Before: bfscfg.exe exited with code 87 / Unknown option: Storage
  • After: bfscfg process created successfully — policy applied correctly

Paths containing spaces (e.g. 'Session Storage') were passed unquoted to
bfscfg.exe, causing the path to be split into multiple arguments. bfscfg
would then treat the second word as an unknown option and fail with exit
code 87.

Quote any argument containing spaces when building the command line.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes failures when invoking bfscfg.exe with filesystem paths containing spaces by quoting affected arguments in FileSystemBfsManager::RunBfsCfg(), preventing the path from being split into multiple command-line tokens.

Changes:

  • Quote bfscfg.exe arguments that contain spaces when building the CreateProcessW command line.
  • Improve inline documentation describing the command-line construction behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wxc_common/FileSystemBfsManager.cpp
Comment thread wxc_common/FileSystemBfsManager.cpp
@shschaefer
shschaefer merged commit 501cba8 into microsoft:main Mar 5, 2026
6 checks passed
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.

3 participants