imagick icon indicating copy to clipboard operation
imagick copied to clipboard

Backticks in XML Comment breaks policy in `/etc/ImageMagick-6/policy.xml`

Open renepupil opened this issue 2 months ago • 1 comments

We overwrite /etc/ImageMagick-6/policy.xml when building the docker image, and a newest change in our policy was to allow the .jpg extension using the coder domain:

<policymap>
    ...
    <!-- Allow `.jpg` explicit, other then the `module` domain, the `coder` does NOT assigns rights to all formats of given patterns, see https://github.com/ImageMagick/ImageMagick/issues/6061 -->
    <policy domain="coder" rights="read|write" pattern="{JPEG,PNG,JPG}" />
</policymap>

To explain the reasoning, I added the comment, above the policy, but this seems to break the policy, as it works when I remove the comment.

I suspect a parsing error, as I use some special characters, like "`", and the URL slashes "/"...

\Imagick::getVersion():

array(2) {
  ["versionNumber"]=>
  int(1691)
  ["versionString"]=>
  string(67) "ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org"
}

renepupil avatar Apr 23 '24 20:04 renepupil

Definitely the backticks are the culprit, this works:

<policymap>
  <!-- Allow ".jpg" explicit, other then the "module" domain, the "coder" does NOT assigns rights to all formats of given patterns, see https://github.com/ImageMagick/ImageMagick/issues/6061 -->
  <policy domain="coder" rights="read|write" pattern="{JPEG,PNG,JPG}" />
</policymap>

renepupil avatar Apr 23 '24 21:04 renepupil