Config files XML format is not true XML
Posted: 2017-01-08T21:03:35-07:00
Hi.
We use automated configuration management for all our config files. So we use augeas to add/remove some features to .xml files.
We recently tried to add a restriction into policy.xml like this:
/etc/ImageMagic/policy.xml:
This was done automatically by augeas. This is absolutely correct XML tag which SHOULD BE EQUIVALENT to self-closing tag like <policy domain="resource" name="disk" value="512MiB"/>
But this limit was surprisingly not used by 'convert':
Next we edited the policy.xml file and replaced questionable 'disk' limit with self closing tag:
And we see that this limit is now applied:
So the bug is in the .XML interpretation. You should support equivalent XML tags with empty bodies.
We use automated configuration management for all our config files. So we use augeas to add/remove some features to .xml files.
We recently tried to add a restriction into policy.xml like this:
/etc/ImageMagic/policy.xml:
Code: Select all
<policy domain="resource" name="disk" value="512MiB"></policy>
But this limit was surprisingly not used by 'convert':
Code: Select all
convert -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
768 12.511GB 5.826GiB 11.652GiB unlimited 6 unlimited
Code: Select all
<policy domain="resource" name="disk" value="512MiB"/>
Code: Select all
convert -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
768 12.511GB 5.826GiB 11.652GiB 512MiB 6 unlimited