]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Backport fix for mime.types limit (Issue #925)
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 26 Apr 2024 09:17:23 +0000 (11:17 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 26 Apr 2024 09:17:23 +0000 (11:17 +0200)
CHANGES.md
conf/mime.types
doc/help/man-mime.types.html
man/mime.types.5
scheduler/mime.h

index 2871947b90c30ff43f3cbd49eff1b962c37562d3..d8d8c409e4650ece0a452c6d39a94ccaa32e286c 100644 (file)
@@ -10,6 +10,7 @@ Changes in CUPS v2.4.8 (TBA)
   successfully printed jobs (Issue #830)
 - Added support for PAM modules password-auth and system-auth (Issue #892)
 - Updated IPP Everywhere printer creation error reporting (Issue #347)
+- Updated and documented the MIME typing buffering limit (Issue #925)
 - Raised `cups_enum_dests()` timeout for listing available IPP printers
   (Issue #751)
 - Now report an error for temporary printer defaults with lpadmin (Issue #237)
index c8603b02ed8c0073af442e89258edb0947f92364..62c4889d4ae9efb67c7b77f4d4ca8f6a05d893e3 100644 (file)
 application/pdf                        pdf regex(0,^[\n\r]*%PDF)
 application/postscript         ai eps ps string(0,%!) string(0,<04>%!) \
                                contains(0,128,<1B>%-12345X) + \
-                               (contains(0,4096,"LANGUAGE=POSTSCRIPT") \
-                                contains(0,4096,"LANGUAGE = Postscript") \
-                                contains(0,4096,"LANGUAGE = PostScript") \
-                                contains(0,4096,"LANGUAGE = POSTSCRIPT") \
-                                (contains(0,4096,<0a>%!) + \
-                                 !contains(0,4096,"ENTER LANGUAGE")))
+                               (contains(0,8192,"LANGUAGE=POSTSCRIPT") \
+                                contains(0,8192,"LANGUAGE = Postscript") \
+                                contains(0,8192,"LANGUAGE = PostScript") \
+                                contains(0,8192,"LANGUAGE = POSTSCRIPT") \
+                                (contains(0,8192,<0a>%!) + \
+                                 !contains(0,8192,"ENTER LANGUAGE")))
 
 
 ########################################################################
@@ -156,8 +156,8 @@ application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \
 application/vnd.cups-raw       (string(0,<1B>E) + !string(2,<1B>%0B)) \
                                string(0,<1B>@) \
                                (contains(0,128,<1B>%-12345X) + \
-                                (contains(0,4096,"LANGUAGE=PCL") \
-                                 contains(0,4096,"LANGUAGE = PCL")))
+                                (contains(0,8192,"LANGUAGE=PCL") \
+                                 contains(0,8192,"LANGUAGE = PCL")))
 
 ########################################################################
 #
index f60fd56697d7b515cd15baecec979f97d2e0810e..d10559fa1368df4af329914b57a70bd7a3869f38 100644 (file)
@@ -36,9 +36,9 @@ The following functions are available:
 <dt><b>match("</b><i>pattern</i><b>")</b>
 <dd style="margin-left: 5.0em">True if the filename matches the given shell wildcard <i>pattern</i>.
 <dt><b>ascii(</b><i>offset</i><b>,</b><i>length</i><b>)</b>
-<dd style="margin-left: 5.0em">True if the <i>length</i> bytes starting at <i>offset</i> are valid printable ASCII (CR, NL, TAB, BS, 32-126).
+  <dd style="margin-left: 5.0em">True if the <i>length</i> bytes starting at <i>offset</i> are valid printable ASCII (CR, NL, TAB, BS, 32-126). <i>length</i> cannot exceed 8192 bytes.
 <dt><b>printable(</b><i>offset</i><b>,</b><i>length</i><b>)</b>
-<dd style="margin-left: 5.0em">True if the <i>length</i> bytes starting at <i>offset</i> are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
+<dd style="margin-left: 5.0em">True if the <i>length</i> bytes starting at <i>offset</i> are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254). <i>length</i> cannot exceed 8192 bytes.
 <dt><b>priority(</b><i>number</i><b>)</b>
 <dd style="margin-left: 5.0em">Specifies the relative priority of this MIME media type.
 The default priority is 100.
@@ -55,8 +55,8 @@ Larger values have higher priority while smaller values have lower priority.
 <dd style="margin-left: 5.0em">True if the 32-bit big-endian integer at <i>offset</i> is identical to <i>value</i>.
 <dt><b>locale("</b><i>string</i><b>")</b>
 <dd style="margin-left: 5.0em">True if current locale matches <i>string</i>.
-<dt><b>contains(</b><i>offset</i><b>,</b><i>range</i><b>,"</b><i>string</i><b>")</b>
-<dd style="margin-left: 5.0em">True if the bytes starting at <i>offset</i> for <i>range</i> bytes contains <i>string</i>.
+<dt><b>contains(</b><i>offset</i><b>,</b><i>length</i><b>,"</b><i>string</i><b>")</b>
+  <dd style="margin-left: 5.0em">True if the bytes starting at <i>offset</i> for <i>length</i> bytes contains <i>string</i>. <i>length</i> cannot exceed 8192 bytes.
 </dl>
 <h3><a name="STRING_CONSTANTS">String Constants</a></h3>
 String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (&lt;>) for hexadecimal strings.
index 18b6447f6e5f4c2cbfe7a81e7fe1fd503bfeb5e7..d34cad5cc2950bf61eea5f2acbd46e63e669c831 100644 (file)
@@ -45,9 +45,11 @@ True if the filename matches the given shell wildcard \fIpattern\fR.
 .TP 5
 \fBascii(\fIoffset\fB,\fIlength\fB)\fR
 True if the \fIlength\fR bytes starting at \fIoffset\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126).
+\fIlength\fR cannot exceed 8192 bytes.
 .TP 5
 \fBprintable(\fIoffset\fB,\fIlength\fB)\fR
 True if the \fIlength\fR bytes starting at \fIoffset\fR are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
+\fIlength\fR cannot exceed 8192 bytes.
 .TP 5
 \fBpriority(\fInumber\fB)\fR
 Specifies the relative priority of this MIME media type.
@@ -72,8 +74,9 @@ True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\f
 \fBlocale("\fIstring\fB")\fR
 True if current locale matches \fIstring\fR.
 .TP 5
-\fBcontains(\fIoffset\fB,\fIrange\fB,"\fIstring\fB")\fR
-True if the bytes starting at \fIoffset\fR for \fIrange\fR bytes contains \fIstring\fR.
+\fBcontains(\fIoffset\fB,\fIlength\fB,"\fIstring\fB")\fR
+True if the bytes starting at \fIoffset\fR for \fIlength\fR bytes contains \fIstring\fR.
+\fIlength\fR cannot exceed 8192 bytes.
 .SS STRING CONSTANTS
 String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings.
 .SS TYPE MATCHING AND PRIORITY
index d0d15597706d80a4eb6dd8b612f385dfbad10e3f..ba1a73a5327df9246c0e7efda6c6ab3ef2f285b6 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #  define MIME_MAX_SUPER       16              /* Maximum size of supertype name */
 #  define MIME_MAX_TYPE                IPP_MAX_NAME    /* Maximum size of type name */
 #  define MIME_MAX_FILTER      256             /* Maximum size of filter pathname */
-#  define MIME_MAX_BUFFER      4096            /* Maximum size of file buffer */
+#  define MIME_MAX_BUFFER      8192            /* Maximum size of file buffer */
 
 
 /*