Page 1 of 1

Problem with security policy

Posted: 2019-12-19T04:03:12-07:00
by PierreDeQuebec
Hi,

By making use of the moviepy / pygame duo, I receive the following error message in a command console.

Code: Select all

pygame 1.9.4.post1
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "video_pygame_Demo1.py", line 29, in <module>
    txtClip = TextClip('Votre vitesse',color='white', font="Amiri-Bold", kerning = 5, fontsize=100)
  File "/usr/local/lib/python2.7/dist-packages/moviepy/video/VideoClip.py", line 1177, in __init__
    raise IOError(error)
IOError: MoviePy Error: creation of None failed because of the following error:

convert-im6.q16: attempt to perform an operation not allowed by the security policy `@/tmp/tmprPfwrX.txt' @ error/property.c/InterpretImageProperties/3666.
convert-im6.q16: no images defined `PNG32:/tmp/tmpZJ2X_c.png' @ error/convert.c/ConvertImageCommand/3258.
.

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect
Despite what is written in the error message, the files /tmp/tmpZJ2X_c.png and tmprPfwrX.txt exist. So I tried to relax the security by adding the following line in the /etc/ImageMagick-6/policy.xml file.

Code: Select all

  <policy domain="path" rights="read | write" pattern="/tmp/*" />
  <policy domain="coder" rights="read | write" pattern="TXT" />
But I still get the same error message. Is there anything else I can do to resolve my problem?

Cordially

Pierre

Re: Problem with security policy

Posted: 2019-12-19T04:38:00-07:00
by magick
You likely have a policy that prevents indirect image reads:

Code: Select all

<policy domain="path" rights="none" pattern="@*"/>

Re: Problem with security policy

Posted: 2019-12-19T17:17:52-07:00
by PierreDeQuebec
Thank you so much. This solved my problem. Do you have a reference to suggest to me to decode the syntax of the policy configuration file?

Cordialy,

Pierre

Re: Problem with security policy

Posted: 2019-12-19T17:35:57-07:00
by magick

Re: Problem with security policy

Posted: 2019-12-20T05:38:53-07:00
by PierreDeQuebec
Thanks!

Re: Problem with security policy

Posted: 2020-03-26T10:14:50-07:00
by masterov
Is this an all-or-nothing policy? Can one for example allow access to a single directory rather than the entire filesystem?

Re: Problem with security policy

Posted: 2020-03-26T10:23:02-07:00
by snibgo
As far as I know, IM has no security mechanism for directory access.

Operating systems do.

Re: Problem with security policy

Posted: 2020-03-27T09:48:05-07:00
by furushito
That's worked! You saved everything I've done!