mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
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:
parent
2980606556
commit
e3dded7a85
3 changed files with 14 additions and 1 deletions
|
|
@ -449,7 +449,7 @@ in {
|
||||||
for src in $srcs; do
|
for src in $srcs; do
|
||||||
if [ -d $src/share/man ]; then
|
if [ -d $src/share/man ]; then
|
||||||
find -L $src/share/man -type f \
|
find -L $src/share/man -type f \
|
||||||
| xargs python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out \
|
-exec python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out {} + \
|
||||||
> /dev/null
|
> /dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@
|
||||||
fish-functions = ./functions.nix;
|
fish-functions = ./functions.nix;
|
||||||
fish-no-functions = ./no-functions.nix;
|
fish-no-functions = ./no-functions.nix;
|
||||||
fish-plugins = ./plugins.nix;
|
fish-plugins = ./plugins.nix;
|
||||||
|
fish-manpage = ./manpage.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
tests/modules/programs/fish/manpage.nix
Normal file
12
tests/modules/programs/fish/manpage.nix
Normal 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"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue