File: imagemagick_policy.diff

package info (click to toggle)
ns3 3.45-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 136,192 kB
  • sloc: cpp: 896,731; python: 17,621; ansic: 6,805; makefile: 2,657; sh: 1,123; javascript: 167; perl: 102
file content (45 lines) | stat: -rw-r--r-- 1,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: Override overly strict ImageMagick security policy (#987504)
 This patch derives a more permissive ImageMagick security policy from
 the system default.
 .
 The rational is that we trust the content of the package, so we don't
 need the overly protective restrictions used in ImageMagick by default.
Author: Dennis Filder <d.filder@web.de>
Last-Update: 2021-07-16
Bug-Debian: https://bugs.debian.org/991061
---
 ns-3.45/doc/models/Makefile |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: b/ns-3.45/doc/models/Makefile
===================================================================
--- a/ns-3.45/doc/models/Makefile
+++ b/ns-3.45/doc/models/Makefile
@@ -586,6 +586,8 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(I
 
 RESCALE = ../../utils/rescale-pdf.sh
 
+POLFILE = "/etc/$(shell convert -version|sed -n '/^Version: /s@Version: ImageMagick \([[:digit:]]\+\)\..*@ImageMagick-\1@p')/policy.xml"
+
 %.eps : %.dia
 	@echo dia $(notdir $<)
 	@$(DIA) -t eps $< -e $@ >/dev/null
@@ -596,7 +598,9 @@ RESCALE = ../../utils/rescale-pdf.sh
 
 %.png : %.eps
 	@echo convert $(notdir $<)
-	@$(CONVERT) $< $@ >/dev/null
+	test -d ../../../debian/tmp/ImageMagick || mkdir -p ../../../debian/tmp/ImageMagick
+	test -f ../../../debian/tmp/ImageMagick/policy.xml || sed -e '/<policy domain="coder" rights="none" pattern="PS" .>/s@"none"@"read|write"@' "$(POLFILE)" > ../../../debian/tmp/ImageMagick/policy.xml
+	XDG_CONFIG_HOME="$(shell pwd)/../../../debian/tmp" $(CONVERT) $< $@ >/dev/null
 
 %.pdf : %.eps
 	@echo epstopdf $(notdir $<)
@@ -646,6 +650,7 @@ copy-sources:  $(SOURCES)
 clean:
 	-rm -rf $(BUILDDIR)/*
 	-rm -rf $(SOURCETEMP)
+	-rm -Rf ../../../debian/tmp/ImageMagick
 
 frag: pickle
 	@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi