1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

launchd+targets/darwin: Escape XML in plists (#7356)

This patch updates all usage of toPlist such that it escapes any strings
in the final output.

The motication for this change is to avoid confusion when end-users of
home-manager's APIs are not aware that the option values they set end up
being passed un-escaped to XML files.

BREAKING CHANGE: Consumers doing manual escaping will now be doubly escaped.

Co-authored-by: Linnnus <linnnus@users.noreply.github.com>
This commit is contained in:
lignus 2025-08-09 18:22:08 +02:00 committed by GitHub
parent cc2fa2331a
commit 3ec1cd9a07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 35 additions and 4 deletions

View file

@ -14,6 +14,7 @@
};
ProcessType = "Background";
UnrecognizedByHomeManager = "should make it to the resulting plist";
"\"Special\" characters" = "<should be escaped>";
};
};

View file

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>&quot;Special&quot; characters</key>
<string>&lt;should be escaped&gt;</string>
<key>KeepAlive</key>
<dict>
<key>Crashed</key>