Unverified Commit cc41b47c authored by wrvsrx's avatar wrvsrx
Browse files

nixos/lib: hash triggers after converting them to string in systemd-lib

This change is made for two reasons:

1.  If `toString config.restartTriggers` containes `\n`, systemd unit
    file will be ill-formed.
2.  This change can limit length of the trigger, although it doesn't
    matter in most cases.
parent 12d1034a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -289,9 +289,9 @@ in rec {
        // optionalAttrs (config.requisite != [])
          { Requisite = toString config.requisite; }
        // optionalAttrs (config ? restartTriggers && config.restartTriggers != [])
          { X-Restart-Triggers = toString config.restartTriggers; }
          { X-Restart-Triggers = builtins.hashString "sha512" (toString config.restartTriggers); }
        // optionalAttrs (config ? reloadTriggers && config.reloadTriggers != [])
          { X-Reload-Triggers = toString config.reloadTriggers; }
          { X-Reload-Triggers = builtins.hashString "sha512" (toString config.reloadTriggers); }
        // optionalAttrs (config.description != "") {
          Description = config.description; }
        // optionalAttrs (config.documentation != []) {