Page 1 of 1
Change policy via command argument or environment variable
Posted: 2018-10-12T10:49:56-07:00
by darkdragon-001
Ubuntu 18.04's version ships with a policy file which includes the following:
Code: Select all
<policy pattern="PDF" domain="coder" rights="none"></policy>
My program wants to use ImageMagick's identify command with PDF files.
How can I overwrite this policy without urging the user to manually change it?
Re: Change policy via command argument or environment variable
Posted: 2018-10-12T10:56:26-07:00
by snibgo
You can't. The file sets limits that can't be overridden. Change the file if you need to.
Re: Change policy via command argument or environment variable
Posted: 2018-10-15T17:48:41-07:00
by rolffagerberg
I have the same recently arisen problem with convert (version ,6.8.9-9). I do not have root priviliges on my Ubuntu system (it is a department wide system run by admins), hence I cannot change the file /etc/ImageMagick-6/policy.xml. I tried to make a changed local copy of policy.xml and setting $MAGICK_CONFIGURE_PATH to the current dir ".", but the system file seems to be loaded last (as "convert -list policy" shows), hence overwriting my changed permissions. It seems really strange that I suddenly cannot invoke convert anymore for my pdf to png conversion (without asking the admins to change the global policies). Is there no way around that?
Re: Change policy via command argument or environment variable
Posted: 2018-10-15T19:33:29-07:00
by fmw42
The policy for PDF was recently added due to recently uncovered security issue with the processing of PDF by Ghostscript. Though I hear that the Ghostscript issue may have been fixed subsequently. So you likely need to bring that to the attention of your hosting provider and see if they will edit the policy.xml file to allow the reading of PDF files.