Open jc0b opened 9 months ago
I think it's expected that the escaping gets doubled - it has to really, because the mobileconfig is all escaped inside the XML - so for example all the less-than and greater-than symbols also get escaped.
I just want to check that you tried it with a profile that actually has a payload? I'm not sure it's valid to upload a profile with no payload.
Yes, I initially stumbled across this with the ampersand in a payload (for a Google Chrome managed bookmark), rather than just in the title. I could upload the profile through the UI just fine, but uploading it via the API didn't work, which is what caused me to look at the escaping.
Just stumbled across this - I am running into an issue where profiles that contain an ampersand in any field fail to upload to Jamf. It appears that this may be a Jamf bug, but I'm not completely sure.
XML escapes the
&
character to&
in .mobileconfig files. JamfComputerProfileUploader escapes this ampersand again, to&
in the file that gets POSTed to Jamf. I suspect that Jamf might be tripping over this, somehow.To replicate
Using the minimum viable example that can be found in this gist (assuming all of these files are in the same directory, and its your working directory):
autopkg run -vvvv com.jc0b.test.AmpersandBug
This leads to the following recipe output, containing this response from Jamf:
At the same time, you can find this output in the Jamf Pro server logs (edited for length):
Removing the ampersand from the profile causes this issue to go away.
Workaround is to indeed not have ampersands in profiles, but importing profiles from elsewhere may unexpectedly lead to this issue.