File ImageMagick-allow-override-system-policy.patch of Package ImageMagick

Index: ImageMagick-6.8.8-1/magick/policy.c
===================================================================
--- ImageMagick-6.8.8-1.orig/magick/policy.c	2013-12-01 15:47:50.000000000 +0100
+++ ImageMagick-6.8.8-1/magick/policy.c	2018-11-30 11:35:25.298185618 +0100
@@ -495,20 +495,20 @@ MagickExport MagickBooleanType IsRightsA
   LockSemaphoreInfo(policy_semaphore);
   ResetLinkedListIterator(policy_list);
   p=(PolicyInfo *) GetNextValueInLinkedList(policy_list);
-  while ((p != (PolicyInfo *) NULL) && (authorized != MagickFalse))
+  while (p != (PolicyInfo *) NULL)
   {
     if ((p->domain == domain) &&
         (GlobExpression(pattern,p->pattern,MagickFalse) != MagickFalse))
       {
-        if (((rights & ReadPolicyRights) != 0) &&
-            ((p->rights & ReadPolicyRights) == 0))
-          authorized=MagickFalse;
-        if (((rights & WritePolicyRights) != 0) &&
-            ((p->rights & WritePolicyRights) == 0))
-          authorized=MagickFalse;
-        if (((rights & ExecutePolicyRights) != 0) &&
-            ((p->rights & ExecutePolicyRights) == 0))
-          authorized=MagickFalse;
+        if ((rights & ReadPolicyRights) != 0)
+          authorized=(p->rights & ReadPolicyRights) != 0 ? MagickTrue :
+            MagickFalse;
+        if ((rights & WritePolicyRights) != 0)
+          authorized=(p->rights & WritePolicyRights) != 0 ? MagickTrue :
+            MagickFalse;
+        if ((rights & ExecutePolicyRights) != 0)
+          authorized=(p->rights & ExecutePolicyRights) != 0 ? MagickTrue :
+            MagickFalse;
       }
     p=(PolicyInfo *) GetNextValueInLinkedList(policy_list);
   }
openSUSE Build Service is sponsored by