mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
kconfig: escape arguments properly (#6867)
Previously shell arguments were not escaped properly, leading to breakage on group names containing characters with special meaning to the shell (in particular spaces); theoretically keys containing single quotes would be affected too. Escape all arguments passed to the shell properly instead.
This commit is contained in:
parent
3fbe9a2b76
commit
6695b1d477
1 changed files with 2 additions and 2 deletions
|
|
@ -74,8 +74,8 @@ in
|
|||
lib.mapAttrsToList (group: value: toLine file (path ++ [ group ]) value) value
|
||||
else
|
||||
"run ${pkgs.kdePackages.kconfig}/bin/kwriteconfig6 --file '${configHome}/${file}' ${
|
||||
lib.concatMapStringsSep " " (x: "--group ${x}") (lib.lists.init path)
|
||||
} --key '${lib.lists.last path}' ${toValue value}";
|
||||
lib.concatMapStringsSep " " (x: "--group ${lib.escapeShellArg x}") (lib.lists.init path)
|
||||
} --key ${lib.escapeShellArg (lib.lists.last path)} ${toValue value}";
|
||||
lines = lib.flatten (lib.mapAttrsToList (file: attrs: toLine file [ ] attrs) cfg);
|
||||
in
|
||||
builtins.concatStringsSep "\n" lines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue