Skip to content

Commit

Permalink
nixos: escape brackets in systemd units
Browse files Browse the repository at this point in the history
One day we should just whitelist instead of blacklist chars.

Fixes NixOS/nixops#614

(cherry picked from commit 635822d)
Signed-off-by: Domen Kožar <domen@dev.si>
  • Loading branch information
domenkozar committed Apr 12, 2017
1 parent a9fb947 commit 7ad99e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/systemd-lib.nix
Expand Up @@ -10,7 +10,7 @@ rec {

makeUnit = name: unit:
let
pathSafeName = lib.replaceChars ["@" ":" "\\"] ["-" "-" "-"] name;
pathSafeName = lib.replaceChars ["@" ":" "\\" "[" "]"] ["-" "-" "-" "" ""] name;
in
if unit.enable then
pkgs.runCommand "unit-${pathSafeName}"
Expand Down

0 comments on commit 7ad99e9

Please sign in to comment.