]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Increase the mime.types limit to 8192 bytes and document it (Issue #925)
authorMichael R Sweet <msweet@msweet.org>
Thu, 18 Apr 2024 23:06:27 +0000 (19:06 -0400)
committerMichael R Sweet <msweet@msweet.org>
Thu, 18 Apr 2024 23:06:27 +0000 (19:06 -0400)
CHANGES.md
conf/mime.types
doc/help/man-mime.types.html
man/mime.types.5
scheduler/mime.h

index 28df48d74bd03713bec70fd8eef0646d11314894..9fabcdfb6e6a14f947edbfe294e82af70d2fc9cc 100644 (file)
@@ -29,6 +29,8 @@ Changes in CUPS v2.5b1 (TBA)
   "print-quality" (Issue #734)
 - Updated `cups_enum_dests()` timeout for listing available IPP printers
   (Issue #751)
+- Updated the `ippeveprinter` program to support the `-f` option with `-a`
+  (Issue #759)
 - Updated default destination documentation (Issue #819)
 - Updated `httpAddrConnect2()` to handle `POLLHUP` together with `POLLIN` or
   `POLLOUT` (Issue #839)
@@ -37,8 +39,7 @@ Changes in CUPS v2.5b1 (TBA)
 - Updated the "get-printer-attributes-suite.test" test file (Issue #909)
 - Updated `cupsRasterReadPixels` and `cupsRasterWritePixels` to not try reading
   or writing if the number of bytes passed is 0 (Issue #914)
-- The `ippeveprinter` program now supports the `-f` option with `-a`
-  (Issue #759)
+- Updated and documented the MIME typing buffering limit (Issue #925)
 - Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error
   handling (fixes CVE-2023-34241)
 - Fixed hanging of `lpstat` on Solaris (Issue #156)
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 55626b24802ce65762bbd9fac8a6b014cd8739ba..bef269887a4825b7193b06e8fcbaf9461afdcdf0 100644 (file)
@@ -39,40 +39,43 @@ See the &quot;TYPE MATCHING AND PRIORITY&quot; section for more information.
 values inside parenthesis.
 The following functions are available:
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>match(&quot;</strong><em>pattern</em><strong>&quot;)</strong><br>
-True if the filename matches the given shell wildcard <em>pattern</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>match(&quot;</strong><em>PATTERN</em><strong>&quot;)</strong><br>
+True if the filename matches the given shell wildcard <em>PATTERN</em>.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ascii(</strong><em>offset</em><strong>,</strong><em>length</em><strong>)</strong><br>
-True if the <em>length</em> bytes starting at <em>offset</em> are valid printable ASCII (CR, NL, TAB, BS, 32-126).
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ascii(</strong><em>OFFSET</em><strong>,</strong><em>LENGTH</em><strong>)</strong><br>
+True if the <em>LENGTH</em> bytes starting at <em>OFFSET</em> are valid printable ASCII (CR, NL, TAB, BS, 32-126).
+<em>LENGTH</em> cannot exceed 8192 bytes.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>printable(</strong><em>offset</em><strong>,</strong><em>length</em><strong>)</strong><br>
-True if the <em>length</em> bytes starting at <em>offset</em> are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>printable(</strong><em>OFFSET</em><strong>,</strong><em>LENGTH</em><strong>)</strong><br>
+True if the <em>LENGTH</em> bytes starting at <em>OFFSET</em> are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
+<em>LENGTH</em> cannot exceed 8192 bytes.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>priority(</strong><em>number</em><strong>)</strong><br>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>priority(</strong><em>NUMBER</em><strong>)</strong><br>
 Specifies the relative priority of this MIME media type.
 The default priority is 100.
 Larger values have higher priority while smaller values have lower priority.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>string(</strong><em>offset</em><strong>,&quot;</strong><em>string</em><strong>&quot;)</strong><br>
-True if the bytes starting at <em>offset</em> are identical to <em>string</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>string(</strong><em>OFFSET</em><strong>,&quot;</strong><em>STRING</em><strong>&quot;)</strong><br>
+True if the bytes starting at <em>OFFSET</em> are identical to <em>STRING</em>.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>istring(</strong><em>offset</em><strong>,&quot;</strong><em>string</em><strong>&quot;)</strong><br>
-True if the bytes starting at <em>offset</em> match <em>string</em> without respect to case.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>istring(</strong><em>OFFSET</em><strong>,&quot;</strong><em>STRING</em><strong>&quot;)</strong><br>
+True if the bytes starting at <em>OFFSET</em> match <em>STRING</em> without respect to case.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>char(</strong><em>offset</em><strong>,</strong><em>value</em><strong>)</strong><br>
-True if the byte at <em>offset</em> is identical to <em>value</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>char(</strong><em>OFFSET</em><strong>,</strong><em>VALUE</em><strong>)</strong><br>
+True if the byte at <em>OFFSET</em> is identical to <em>VALUE</em>.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>short(</strong><em>offset</em><strong>,</strong><em>value</em><strong>)</strong><br>
-True if the 16-bit big-endian integer at <em>offset</em> is identical to <em>value</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>short(</strong><em>OFFSET</em><strong>,</strong><em>VALUE</em><strong>)</strong><br>
+True if the 16-bit big-endian integer at <em>OFFSET</em> is identical to <em>VALUE</em>.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>int(</strong><em>offset</em><strong>,</strong><em>value</em><strong>)</strong><br>
-True if the 32-bit big-endian integer at <em>offset</em> is identical to <em>value</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>int(</strong><em>OFFSET</em><strong>,</strong><em>VALUE</em><strong>)</strong><br>
+True if the 32-bit big-endian integer at <em>OFFSET</em> is identical to <em>VALUE</em>.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>locale(&quot;</strong><em>string</em><strong>&quot;)</strong><br>
-True if current locale matches <em>string</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>locale(&quot;</strong><em>STRING</em><strong>&quot;)</strong><br>
+True if current locale matches <em>STRING</em>.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>contains(</strong><em>offset</em><strong>,</strong><em>range</em><strong>,&quot;</strong><em>string</em><strong>&quot;)</strong><br>
-True if the bytes starting at <em>offset</em> for <em>range</em> bytes contains <em>string</em>.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>contains(</strong><em>OFFSET</em><strong>,</strong><em>LENGTH</em><strong>,&quot;</strong><em>STRING</em><strong>&quot;)</strong><br>
+True if the bytes starting at <em>OFFSET</em> for <em>LENGTH</em> bytes contains <em>STRING</em>.
+<em>LENGTH</em> cannot exceed 8192 bytes.
 </p>
     <h3 id="mime.types-5.description.string-constants">String Constants</h3>
 <p>String constants can be specified inside quotes (&quot;&quot;) for strings containing whitespace and angle brackets (&lt;>) for hexadecimal strings.
index 18b6447f6e5f4c2cbfe7a81e7fe1fd503bfeb5e7..c3eda80ed6f3608d863fe31f3864ec9cd43107e4 100644 (file)
@@ -8,7 +8,7 @@
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH mime.types 5 "CUPS" "2021-02-28" "OpenPrinting"
+.TH mime.types 5 "CUPS" "2024-04-18" "OpenPrinting"
 .SH NAME
 mime.types \- mime type description file for cups
 .SH DESCRIPTION
@@ -40,40 +40,43 @@ Rules take two forms - a filename extension by itself and functions with test
 values inside parenthesis.
 The following functions are available:
 .TP 5
-\fBmatch("\fIpattern\fB")\fR
-True if the filename matches the given shell wildcard \fIpattern\fR.
+\fBmatch("\fIPATTERN\fB")\fR
+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).
+\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).
+\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
+\fBpriority(\fINUMBER\fB)\fR
 Specifies the relative priority of this MIME media type.
 The default priority is 100.
 Larger values have higher priority while smaller values have lower priority.
 .TP 5
-\fBstring(\fIoffset\fB,"\fIstring\fB")\fR
-True if the bytes starting at \fIoffset\fR are identical to \fIstring\fR.
+\fBstring(\fIOFFSET\fB,"\fISTRING\fB")\fR
+True if the bytes starting at \fIOFFSET\fR are identical to \fISTRING\fR.
 .TP 5
-\fBistring(\fIoffset\fB,"\fIstring\fB")\fR
-True if the bytes starting at \fIoffset\fR match \fIstring\fR without respect to case.
+\fBistring(\fIOFFSET\fB,"\fISTRING\fB")\fR
+True if the bytes starting at \fIOFFSET\fR match \fISTRING\fR without respect to case.
 .TP 5
-\fBchar(\fIoffset\fB,\fIvalue\fB)\fR
-True if the byte at \fIoffset\fR is identical to \fIvalue\fR.
+\fBchar(\fIOFFSET\fB,\fIVALUE\fB)\fR
+True if the byte at \fIOFFSET\fR is identical to \fIVALUE\fR.
 .TP 5
-\fBshort(\fIoffset\fB,\fIvalue\fB)\fR
-True if the 16-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
+\fBshort(\fIOFFSET\fB,\fIVALUE\fB)\fR
+True if the 16-bit big-endian integer at \fIOFFSET\fR is identical to \fIVALUE\fR.
 .TP 5
-\fBint(\fIoffset\fB,\fIvalue\fB)\fR
-True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
+\fBint(\fIOFFSET\fB,\fIVALUE\fB)\fR
+True if the 32-bit big-endian integer at \fIOFFSET\fR is identical to \fIVALUE\fR.
 .TP 5
-\fBlocale("\fIstring\fB")\fR
-True if current locale matches \fIstring\fR.
+\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 7bb33f3cbaeca40bc0a915645672698851dde1ce..92e563909f9908886f6fb92ee18eff47379193f6 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #  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
 
 
 //