OBS User unknown
2007-09-19 17:06:40 +00:00
committed by Git OBS Bridge
parent 0a56bc685c
commit 031e28ec54
4 changed files with 185 additions and 2 deletions

View File

@@ -0,0 +1,145 @@
--- cups-1.2.12/cups/file.c.orig 2007-02-27 16:46:10.000000000 +0100
+++ cups-1.2.12/cups/file.c 2007-09-18 12:06:46.000000000 +0200
@@ -1216,7 +1216,7 @@
if (fp->ptr >= fp->end)
if (cups_fill(fp) <= 0)
{
- DEBUG_printf((" cups_fill() returned -1, total=%d\n", total));
+ DEBUG_printf((" cups_fill() returned -1, total=%d\n", (int)total));
if (total > 0)
return ((ssize_t)total);
@@ -1244,7 +1244,7 @@
* Return the total number of bytes read...
*/
- DEBUG_printf((" total=%d\n", total));
+ DEBUG_printf((" total=%d\n", (int)total));
return ((ssize_t)total);
}
@@ -1712,6 +1712,7 @@
{
ssize_t bytes; /* Number of bytes read */
#ifdef HAVE_LIBZ
+ int status; /* Decompression status */
const unsigned char *ptr, /* Pointer into buffer */
*end; /* End of buffer */
#endif /* HAVE_LIBZ */
@@ -1930,7 +1931,13 @@
fp->stream.next_out = (Bytef *)fp->buf;
fp->stream.avail_out = sizeof(fp->buf);
- if (inflate(&(fp->stream), Z_NO_FLUSH) == Z_STREAM_END)
+ status = inflate(&(fp->stream), Z_NO_FLUSH);
+
+ if (fp->stream.next_out > (Bytef *)fp->buf)
+ fp->crc = crc32(fp->crc, (Bytef *)fp->buf,
+ fp->stream.next_out - (Bytef *)fp->buf);
+
+ if (status == Z_STREAM_END)
{
/*
* Read the CRC and length...
@@ -1959,6 +1966,9 @@
* Bad CRC, mark end-of-file...
*/
+ DEBUG_printf(("cups_fill: tcrc=%08x, fp->crc=%08x\n",
+ (unsigned int)tcrc, (unsigned int)fp->crc));
+
fp->eof = 1;
return (-1);
--- cups-1.2.12/cups/testfile.c.orig 2007-01-10 20:27:04.000000000 +0100
+++ cups-1.2.12/cups/testfile.c 2007-09-18 12:06:46.000000000 +0200
@@ -25,7 +25,8 @@
*
* Contents:
*
- * main() - Main entry.
+ * main() - Main entry.
+ * read_write_tests() - Perform read/write tests.
*/
/*
@@ -158,6 +159,8 @@
unsigned char readbuf[8192], /* Read buffer */
writebuf[8192]; /* Write buffer */
int byte; /* Byte from file */
+ static const char *partial_line = "partial line";
+ /* Partial line */
/*
@@ -262,11 +265,25 @@
fputs("cupsFileWrite(): ", stdout);
- for (i = 0; i < 100; i ++)
+ for (i = 0; i < 10000; i ++)
if (cupsFileWrite(fp, (char *)writebuf, sizeof(writebuf)) < 0)
break;
- if (i >= 100)
+ if (i >= 10000)
+ puts("PASS");
+ else
+ {
+ printf("FAIL (%s)\n", strerror(errno));
+ status ++;
+ }
+
+ /*
+ * cupsFilePuts() with partial line...
+ */
+
+ fputs("cupsFilePuts(\"partial line\"): ", stdout);
+
+ if (cupsFilePuts(fp, partial_line) > 0)
puts("PASS");
else
{
@@ -414,13 +431,13 @@
fputs("cupsFileRead(): ", stdout);
- for (i = 0; i < 100; i ++)
+ for (i = 0; i < 10000; i ++)
if ((byte = cupsFileRead(fp, (char *)readbuf, sizeof(readbuf))) < 0)
break;
else if (memcmp(readbuf, writebuf, sizeof(readbuf)))
break;
- if (i >= 100)
+ if (i >= 10000)
puts("PASS");
else if (byte > 0)
{
@@ -440,6 +457,26 @@
}
/*
+ * cupsFileGetChar() with partial line...
+ */
+
+ fputs("cupsFileGetChar(partial line): ", stdout);
+
+ for (i = 0; i < strlen(partial_line); i ++)
+ if ((byte = cupsFileGetChar(fp)) < 0)
+ break;
+ else if (byte != partial_line[i])
+ break;
+
+ if (!partial_line[i])
+ puts("PASS");
+ else
+ {
+ printf("FAIL (got '%c', expected '%c')\n", byte, partial_line[i]);
+ status ++;
+ }
+
+ /*
* cupsFileClose()
*/

View File

@@ -0,0 +1,20 @@
--- cups-1.2.12/systemv/cupstestppd.c.orig 2007-09-12 10:13:06.000000000 +0200
+++ cups-1.2.12/systemv/cupstestppd.c 2007-09-12 14:40:43.000000000 +0200
@@ -1509,6 +1509,8 @@
c->option2,
c->option1, c->choice1, c->option2, c->choice2);
+ errors ++;
+
continue;
}
@@ -1535,6 +1537,8 @@
c->option2, c->choice2,
c->option1, c->choice1, c->option2, c->choice2);
}
+
+ errors ++;
}
/*

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Sep 18 13:28:30 CEST 2007 - kssingvo@suse.de
- fix for missing newline before EOF in compressed files (bugzilla#309823)
-------------------------------------------------------------------
Mon Sep 17 19:32:08 CEST 2007 - kssingvo@suse.de
- fix for exitcode on uiconstraints in cupstestppd (bugzilla#309822)
-------------------------------------------------------------------
Mon Sep 10 15:16:15 CEST 2007 - kssingvo@suse.de

View File

@@ -12,12 +12,12 @@
Name: cups
BuildRequires: gcc-c++ libpng-devel libtiff-devel openldap2-devel openslp-devel openssl-devel pam-devel tcpd-devel update-desktop-files
URL: http://www.cups.org/
Url: http://www.cups.org/
License: GPL v2 or later, individual distribution permission.
Group: Hardware/Printing
Summary: The Common UNIX Printing System
Version: 1.2.12
Release: 17
Release: 19
Requires: cups-libs = %{version}, cups-client = %{version}
Requires: ghostscript_any, ghostscript-fonts-std, foomatic-filters
Requires: util-linux
@@ -54,6 +54,8 @@ Patch16: cups-1.2.5-desktop_file.patch
Patch17: cups-1.2.6-lppasswd_permission.patch
Patch18: cups-1.2.7-xpdf_CVE_2007_3387.patch
Patch19: cups-1.2.12-testppd_none.patch
Patch20: cups-1.2.12-testppd_uiconstraint.patch
Patch21: cups-1.2.12-testppd_eof_without_nl.patch
Patch100: cups-1.1.23-testpage.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %suse_version >= 801
@@ -148,6 +150,8 @@ Authors:
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
if [ -f /.buildenv ]; then
. /.buildenv
else
@@ -385,6 +389,10 @@ install -m 644 %{SOURCE17} $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/service
%{_datadir}/locale/*/cups_*
%changelog
* Tue Sep 18 2007 - kssingvo@suse.de
- fix for missing newline before EOF in compressed files (bugzilla#309823)
* Mon Sep 17 2007 - kssingvo@suse.de
- fix for exitcode on uiconstraints in cupstestppd (bugzilla#309822)
* Mon Sep 10 2007 - kssingvo@suse.de
- patch: "None" needs to be valid value for cupstestppd (bugzilla#309219)
* Mon Aug 06 2007 - kssingvo@suse.de