Debian Codegraph @

debian/patches/0007-Add-a-debian-policy.patch

raw
1 From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <[email protected]>
2 Date: Sat, 21 Oct 2023 14:11:43 +0000
3 Subject: Add a debian policy
4
5 Install also other policy
6 ---
7 config/Makefile.am | 1 +
8 config/{policy-open.xml => policy-debian.xml} | 26 ++++++++++++--------------
9 configure.ac | 6 +++---
10 3 files changed, 16 insertions(+), 17 deletions(-)
11 copy config/{policy-open.xml => policy-debian.xml} (89%)
12
13 diff --git a/config/Makefile.am b/config/Makefile.am
14 index f6d116f..887fd94 100644
15 --- a/config/Makefile.am
16 +++ b/config/Makefile.am
17 @@ -62,6 +62,7 @@ CONFIG_EXTRA_DIST = \
18 config/locale.xml \
19 config/log.xml \
20 config/mime.xml \
21 + config/policy-debian.xml \
22 config/policy-limited.xml \
23 config/policy-open.xml \
24 config/policy-secure.xml \
25 diff --git a/config/policy-open.xml b/config/policy-debian.xml
26 similarity index 89%
27 copy from config/policy-open.xml
28 copy to config/policy-debian.xml
29 index 0169117..b53790c 100644
30 --- a/config/policy-open.xml
31 +++ b/config/policy-debian.xml
32 @@ -88,8 +88,8 @@
33 <policy domain="Undefined" rights="none"/>
34 <!-- Set maximum parallel threads. -->
35 <!-- <policy domain="resource" name="thread" value="2"/> -->
36 - <!-- Set maximum time to live in seconds or mnemonics, e.g. "2 minutes". When
37 - this limit is exceeded, an exception is thrown and processing stops. -->
38 + <!-- Set maximum time in seconds. When this limit is exceeded, an exception
39 + is thrown and processing stops. -->
40 <!-- <policy domain="resource" name="time" value="120"/> -->
41 <!-- Set maximum number of open pixel cache files. When this limit is
42 exceeded, any subsequent pixels cached to disk are closed and reopened
43 @@ -98,27 +98,27 @@
44 <!-- Set maximum amount of memory in bytes to allocate for the pixel cache
45 from the heap. When this limit is exceeded, the image pixels are cached
46 to memory-mapped disk. -->
47 - <!-- <policy domain="resource" name="memory" value="256MiB"/> -->
48 + <policy domain="resource" name="memory" value="1024MiB"/>
49 <!-- Set maximum amount of memory map in bytes to allocate for the pixel
50 cache. When this limit is exceeded, the image pixels are cached to
51 disk. -->
52 - <!-- <policy domain="resource" name="map" value="512MiB"/> -->
53 + <policy domain="resource" name="map" value="2048MiB"/>
54 <!-- Set the maximum width * height of an image that can reside in the pixel
55 cache memory. Images that exceed the area limit are cached to disk. -->
56 - <!-- <policy domain="resource" name="area" value="16KP"/> -->
57 + <policy domain="resource" name="area" value="256MP"/>
58 <!-- Set maximum amount of disk space in bytes permitted for use by the pixel
59 cache. When this limit is exceeded, the pixel cache is not created
60 and an exception is thrown. -->
61 - <!-- <policy domain="resource" name="disk" value="1GiB"/> -->
62 + <policy domain="resource" name="disk" value="2GiB"/>
63 <!-- Set the maximum length of an image sequence. When this limit is
64 exceeded, an exception is thrown. -->
65 <!-- <policy domain="resource" name="list-length" value="32"/> -->
66 <!-- Set the maximum width of an image. When this limit is exceeded, an
67 exception is thrown. -->
68 - <!-- <policy domain="resource" name="width" value="8KP"/> -->
69 + <policy domain="resource" name="width" value="32KP"/>
70 <!-- Set the maximum height of an image. When this limit is exceeded, an
71 exception is thrown. -->
72 - <!-- <policy domain="resource" name="height" value="8KP"/> -->
73 + <policy domain="resource" name="height" value="32KP"/>
74 <!-- Periodically yield the CPU for at least the time specified in
75 milliseconds. -->
76 <!-- <policy domain="resource" name="throttle" value="2"/> -->
77 @@ -141,9 +141,9 @@
78 <!-- don't read sensitive paths. -->
79 <!-- <policy domain="path" rights="none" pattern="/etc/*"/> -->
80 <!-- Indirect reads are not permitted. -->
81 - <!-- <policy domain="path" rights="none" pattern="@*"/> -->
82 + <policy domain="path" rights="none" pattern="@*"/>
83 <!-- These image types are security risks on read, but write is fine -->
84 - <!-- <policy domain="module" rights="write" pattern="{MSL,MVG,PS,SVG,TXT,URL,XPS}"/> -->
85 + <!-- <policy domain="module" rights="write" pattern="{MSL,MVG,PS,SVG,URL,XPS}"/> -->
86 <!-- This policy sets the number of times to replace content of certain
87 memory buffers and temporary files before they are freed or deleted. -->
88 <!-- <policy domain="system" name="shred" value="1"/> -->
89 @@ -157,8 +157,6 @@
90 <!-- <policy domain="system" name="symlink" rights="none" pattern="follow"/> -->
91 <!-- Blocks all SVG entity‑substitution attempts by denying the svg:substitute-entities define -->
92 <!-- <policy domain="system" name="svg" rights="none" pattern="substitute-entities"/> -->
93 - <!-- Set the maximum distributed pixel cache clients -->
94 - <!-- <policy domain="cache" name="max-dpc-clients" value="128"/> -->
95 - <!-- Set the maximum distributed pixel cache unauthenticated clients -->
96 - <!-- <policy domain="cache" name="max-dpc-unauthenticated-clients" value="16"/> -->
97 + <policy domain="coder" rights="none" pattern="HTTP" />
98 + <policy domain="coder" rights="none" pattern="HTTPS" />
99 </policymap>
100 diff --git a/configure.ac b/configure.ac
101 index 300919a..12e3855 100644
102 --- a/configure.ac
103 +++ b/configure.ac
104 @@ -837,10 +837,10 @@ m4_define([_MAGICK_SECURITY_POLICY],
105 [m4_define([MAGICK_SECURITY_POLICY_DEFAULT], [m4_if($1, limited, limited, m4_if($1, secure, secure, open))])dnl
106 AC_MSG_CHECKING([which variant of security policy to enforce])
107 AC_ARG_WITH([security-policy],
108 - [AS_HELP_STRING([--with-security-policy=open|limited|secure|websafe],
109 + [AS_HELP_STRING([--with-security-policy=open|limited|secure|websafe|debian],
110 [security policy variant to enforce, @<:@default=]MAGICK_SECURITY_POLICY_DEFAULT[@:>@.])],
111 [case $withval in
112 - open|limited|secure|websafe)
113 + open|limited|secure|websafe|debian)
114 security_policy=$withval
115 ;;
116 *)
117 @@ -854,7 +854,7 @@ m4_define([_MAGICK_SECURITY_POLICY],
118 AC_MSG_RESULT([$security_policy])
119 ]) # MAGICK_SECURITY_POLICY
120
121 -_MAGICK_SECURITY_POLICY([open])
122 +_MAGICK_SECURITY_POLICY([debian])
123 AC_SUBST([MAGICK_SECURITY_POLICY])
124
125 # Disable/Enable support for full delegate paths