jssimporter / JSSImporter

JSSImporter is deprecated. Please see the wiki for alternatives
Apache License 2.0
145 stars 38 forks source link

Double ampersand escape #103

Closed magnusviri closed 6 years ago

magnusviri commented 7 years ago

I don't know if this is a JSSImporter error or a autopkg error. When I use an ampersand in my group name I have to escape it in the plist file, but then I get this error:

 not well-formed (invalid token): line 17, column 22

It turns out that the plist is parsed as xml, I'm assuming in the xml template file. I need to escape my ampersand like this, "&".

jwrn3 commented 7 years ago

This is something I'm finding as well. I'm using the following in my recipe

<key>CATEGORY</key>
<string>Maths &amp; Statistics</string>

This results in an error of:

not well-formed (invalid token): line 9, column 17 Failed.

Changing the Category tag to remove the ampersand allows the recipe to run successfully.

jwrn3 commented 7 years ago

Interestingly I just noticed the following in the verbose output:

JSSImporter: Category type: category-'Maths '&' Statistics' already exists according to JSS, moving on...
JSSImporter: Category type: policy_category-'Maths '&' Statistics' already exists according to JSS, moving on...

The quoting seems to be off, although this may be how the error is presented.

sheagcraig commented 7 years ago

@magnusviri Indeed, plists are a form of XML. I'm surprised that it doesn't work with the correct &amp; escaping.

I will investigate! I bet it's getting double encoded somewhere.

sheagcraig commented 7 years ago

You'll definitely want to do so in a testing environment, but if you try out the beta release, I can't recreate this issue any longer.

Just to confirm, I created a recipe override for a JSS recipe and overrode the CATEGORY to have a value that includes an ampersand, the literal text of the override reads: <string>Productivity &amp; Awesomeness</string>

This both uploaded and came back down as expected. Please let me know if your experience differs!

jwrn3 commented 7 years ago

I cna confirm this is fixed in the beta. Many thanks.

sheagcraig commented 7 years ago

Yes!