Skip to content

Conversation

@hatch01
Copy link

@hatch01 hatch01 commented Nov 2, 2025

Currently my use case was to add Windows GPG to extraBin; however, the path is "/mnt/c/Program Files (x86)/GnuPG/bin/gpg.exe" which contains spaces and parentheses that need to be escaped.
Without any modification, the string goes as is in the init script, and the cp/ln commands are just broken.
I temporarily fixed it by escaping the chars in the nix string "/mnt/c/Program\ Files\ \(x86\)/GnuPG/bin/gpg.exe".
However, it would, I think, be way better to escape the params at the script generation.

Summarry :

  • Added escapeShellArg to both source and destination arguments in cp and ln commands for entries in config.wsl.extraBin and cfg.extraBin, ensuring safer shell command execution.

@hatch01 hatch01 marked this pull request as ready for review November 2, 2025 16:00
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.

1 participant