Unable to print from Windows (7) on a Cups-Server(2.2.1-1) with german umlauts in the filename (bug #1386751)

This commit is contained in:
Zdenek Dohnal 2016-11-11 14:25:22 +01:00
parent f937296141
commit edf173cdfd
2 changed files with 100 additions and 1 deletions

92
cups-iso88591.patch Normal file
View File

@ -0,0 +1,92 @@
diff -up cups-2.2.1/CHANGES.txt.iso88591 cups-2.2.1/CHANGES.txt
--- cups-2.2.1/CHANGES.txt.iso88591 2016-11-11 13:59:27.597903504 +0100
+++ cups-2.2.1/CHANGES.txt 2016-11-11 14:08:29.149806797 +0100
@@ -1,6 +1,13 @@
-CHANGES.txt - 2.2.1 - 2016-10-03
+CHANGES.txt - 2.2.2 - 2016-10-13
+
--------------------------------
+CHANGES IN CUPS V2.2.2
+
+ - The cups-lpd program did not catch all legacy usage of ISO-8859-1
+ (Issue #4899)
+
+
CHANGES IN CUPS V2.2.1
- Added "CreateSelfSignedCerts" directive for cups-files.conf to
diff -up cups-2.2.1/doc/help/man-backend.html.iso88591 cups-2.2.1/doc/help/man-backend.html
--- cups-2.2.1/doc/help/man-backend.html.iso88591 2016-11-11 14:00:00.589652892 +0100
+++ cups-2.2.1/doc/help/man-backend.html 2016-11-11 14:10:54.663706372 +0100
@@ -61,7 +61,7 @@ function may be used to retrieve the cor
<p>Backends are responsible for reading side-channel requests using the
<b>cupsSideChannelRead</b>()
function and responding with the
-<b>cupsSideChannelWrite()</b>
+<b>cupsSideChannelWrite</b>()
function. The
<b>CUPS_SC_FD</b>
constant defines the file descriptor that should be monitored for incoming requests.
@@ -147,7 +147,7 @@ CUPS backends can expect the following e
<h2 class="title"><a name="FILES">Files</a></h2>
<i>/etc/cups/cups-files.conf</i>
<h2 class="title"><a name="NOTES">Notes</a></h2>
-CUPS backends are not generally design to be run directly by the user. Aside from the device URI issue (
+CUPS backends are not generally designed to be run directly by the user. Aside from the device URI issue (
<i>argv[0]</i>
and
<b>DEVICE_URI</b>
diff -up cups-2.2.1/scheduler/cups-lpd.c.iso88591 cups-2.2.1/scheduler/cups-lpd.c
--- cups-2.2.1/scheduler/cups-lpd.c.iso88591 2016-11-11 14:00:37.140376293 +0100
+++ cups-2.2.1/scheduler/cups-lpd.c 2016-11-11 14:15:09.836776667 +0100
@@ -1650,16 +1650,24 @@ smart_strlcpy(char *dst, /* I - O
*dstptr++ = 0xc0 | (*srcptr >> 6);
*dstptr++ = 0x80 | (*srcptr++ & 0x3f);
}
- else if ((*srcptr & 0xe0) == 0xc0)
+ else if ((*srcptr & 0xe0) == 0xc0 && (srcptr[1] & 0xc0) == 0x80)
{
+ /*
+ * 2-byte UTF-8 sequence...
+ */
+
if (dstptr > (dstend - 2))
break;
*dstptr++ = *srcptr++;
*dstptr++ = *srcptr++;
}
- else if ((*srcptr & 0xf0) == 0xe0)
+ else if ((*srcptr & 0xf0) == 0xe0 && (srcptr[1] & 0xc0) == 0x80 && (srcptr[2] & 0xc0) == 0x80)
{
+ /*
+ * 3-byte UTF-8 sequence...
+ */
+
if (dstptr > (dstend - 3))
break;
@@ -1667,8 +1675,12 @@ smart_strlcpy(char *dst, /* I - O
*dstptr++ = *srcptr++;
*dstptr++ = *srcptr++;
}
- else if ((*srcptr & 0xf8) == 0xf0)
+ else if ((*srcptr & 0xf8) == 0xf0 && (srcptr[1] & 0xc0) == 0x80 && (srcptr[2] & 0xc0) == 0x80 && (srcptr[3] & 0xc0) == 0x80)
{
+ /*
+ * 4-byte UTF-8 sequence...
+ */
+
if (dstptr > (dstend - 4))
break;
@@ -1680,7 +1692,7 @@ smart_strlcpy(char *dst, /* I - O
else
{
/*
- * Orphan UTF-8 sequence, this must be an ISO-8859-1 string...
+ * Bad UTF-8 sequence, this must be an ISO-8859-1 string...
*/
saw_8859 = 1;

View File

@ -15,7 +15,7 @@ Summary: CUPS printing system
Name: cups Name: cups
Epoch: 1 Epoch: 1
Version: 2.2.1 Version: 2.2.1
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv2 License: GPLv2
Url: http://www.cups.org/ Url: http://www.cups.org/
Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz
@ -62,6 +62,7 @@ Patch34: cups-avahi-no-threaded.patch
Patch35: cups-ipp-multifile.patch Patch35: cups-ipp-multifile.patch
Patch36: cups-web-devices-timeout.patch Patch36: cups-web-devices-timeout.patch
Patch37: cups-synconclose.patch Patch37: cups-synconclose.patch
Patch38: cups-iso88591.patch
Patch100: cups-lspp.patch Patch100: cups-lspp.patch
@ -255,6 +256,9 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
%patch36 -p1 -b .web-devices-timeout %patch36 -p1 -b .web-devices-timeout
# Set the default for SyncOnClose to Yes. # Set the default for SyncOnClose to Yes.
%patch37 -p1 -b .synconclose %patch37 -p1 -b .synconclose
# Unable to print from Windows (7) on a Cups-Server(2.2.1-1) with german umlauts in the filename (bug #1386751)
%patch38 -p1 -b .iso88591
%if %{lspp} %if %{lspp}
# LSPP support. # LSPP support.
@ -617,6 +621,9 @@ rm -f %{cups_serverbin}/backend/smb
%{_mandir}/man5/ipptoolfile.5.gz %{_mandir}/man5/ipptoolfile.5.gz
%changelog %changelog
* Fri Nov 11 2016 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.1-3
- Unable to print from Windows (7) on a Cups-Server(2.2.1-1) with german umlauts in the filename (bug #1386751)
* Mon Nov 07 2016 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.1-2 * Mon Nov 07 2016 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.1-2
- #873123 - (cups-usb-quirks) usb printer doesn't print (usblp0: USB Bidirectional printer dev) - #873123 - (cups-usb-quirks) usb printer doesn't print (usblp0: USB Bidirectional printer dev)