launchd requires self closing tag for boolean
Originator: | vrantchan | ||
Number: | rdar://47256054 | Date Originated: | 01/14/2019 |
Status: | Resolved: | ||
Product: | macOS | Product Version: | 10.14.2 |
Classification: | Reproducible: | yes |
Summary: LaunchD will not load Property List files with boolean properties unless they have a self closing tag. ex ``` <key>RunAtLoad</key> <true></true> ``` results in ``` victor@kl ~> sudo launchctl load -w /Library/LaunchDaemons/co.kolide.runload.plist /Library/LaunchDaemons/co.kolide.runload.plist: Invalid property list ``` but changing the value to `<true/>` the plist loads. `plutil -lint` validates both. Steps to Reproduce: Load this plist with launchd on 10.14 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>co.kolide.runload</string> <key>Program</key> <string>/Users/me/run.sh</string> <key>RunAtLoad</key> <true></true> </dict> </plist> Expected Results: LaunchDaemon loads Actual Results: ``` /Library/LaunchDaemons/co.kolide.runload.plist: Invalid property list ``` Version/Build: macOS 10.14.2 18C54
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Notable, is that this passes
plutil -lint
`
Label
co.kolide.runload
Program
/Users/me/run.sh
RunAtLoad
$ cat /tmp/boolean.plutil <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
$ plutil -lint /tmp/boolean.plutil /tmp/boolean.plutil: OK `