[BUG] mac_xattr execution module fails on binary plist attributes #63779
Labels
Bug
broken, incorrect, or confusing behavior
bytes-vs-strings
py2 vs py3 bytes vs strings encode/decode errors
Execution-Module
MacOS
pertains to the OS of fruit
Milestone
Description
Apple stores some file attribute information as binary plists, and in such a way that the bytes return from xattr cause a
UnicodeDecodeError
.Setup
Salt 3004.2, masterless, on an M1 Mac.
Steps to Reproduce the behavior
sudo salt-call xattr.read ~/Downloads/ghostunnel-darwin-universal com.apple.metadata:kMDItemWhereFroms
For what it's worth, the bytes returned also fail when trying to
plistlib.loads
so there's not an easy path here to just use that.Expected behavior
Ideally the plist would be parsed and returned in a nicely formatted str, but I can't figure out how to coerce the builtin plistlib to handle it.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: