fish: Fix manpage completion generation with paths containing spaces (#6703)

Manual pages with spaces in their paths can lead to argument injection.
This commit is contained in:
Zhaofeng Li 2025-03-25 12:13:52 -06:00 committed by GitHub
parent 2980606556
commit e3dded7a85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View file

@ -4,4 +4,5 @@
fish-functions = ./functions.nix;
fish-no-functions = ./no-functions.nix;
fish-plugins = ./plugins.nix;
fish-manpage = ./manpage.nix;
}

View file

@ -0,0 +1,12 @@
{ lib, pkgs, ... }: {
config = {
programs.fish = { enable = true; };
home.packages = [
(pkgs.runCommand "manpage-with-space" { } ''
mkdir -p $out/share/man/man1
echo "It works!" >"$out/share/man/man1/hello -inject.1"
'')
];
};
}