4.0.8 (all patches merged upstream)

This commit is contained in:
Jiri Popelka 2011-07-25 13:33:49 +02:00
parent b91dc0f404
commit 393874658b
9 changed files with 14 additions and 365 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@
/foomatic-filters-4.0.6.tar.gz
/foomatic-db-engine-4.0.7.tar.gz
/foomatic-filters-4.0.7.tar.gz
/foomatic-db-engine-4.0.8.tar.gz
/foomatic-filters-4.0.8.tar.gz

View File

@ -1,24 +0,0 @@
--- foomatic-db-engine-3.0.2/lib/Foomatic/PPD.pm.bad-utf8 2002-10-11 02:16:34.000000000 +0100
+++ foomatic-db-engine-3.0.2/lib/Foomatic/PPD.pm 2004-11-23 19:32:26.000000000 +0000
@@ -300,11 +300,17 @@
sub xml_esc {
my ($in) = (@_);
- $in =~ s!&!&!g;
- $in =~ s!<!&lt;!g;
- $in =~ s!>!&gt;!g;
+ @chars = split(//,$in);
+ $ascii = "";
+ foreach (@chars) {
+ if (ord ($_) > 127) { $_="?"; }
+ $ascii .= $_;
+ }
+ $ascii =~ s!&!&amp;!g;
+ $ascii =~ s!<!&lt;!g;
+ $ascii =~ s!>!&gt;!g;
- return $in;
+ return $ascii;
}
sub pdq_filter {

View File

@ -1,33 +0,0 @@
diff -up foomatic-db-engine-4.0.7/configure.ac.libdir foomatic-db-engine-4.0.7/configure.ac
--- foomatic-db-engine-4.0.7/configure.ac.libdir 2011-02-18 13:30:22.000000000 +0100
+++ foomatic-db-engine-4.0.7/configure.ac 2011-02-21 12:43:24.000000000 +0100
@@ -69,8 +69,8 @@ LOGSEARCHPATH=/var/log:/usr/log:/usr/loc
SYSCONFSEARCHPATH=/etc:/usr/etc:/usr/local/etc:/var/etc
SBINSEARCHPATH=/usr/sbin:/sbin:/usr/local/sbin:/etc/sbin
BINSEARCHPATH=/usr/bin:/bin:/usr/local/bin
-DATASEARCHPATH=/usr/share:/usr/local/share:/usr/lib:/usr/local/lib:/opt
-LIBSEARCHPATH=/usr/lib:/lib:/usr/local/lib:/usr/local/libexec:/opt
+DATASEARCHPATH=/usr/share:/usr/local/share:$libdir:/usr/local/lib:/opt
+LIBSEARCHPATH=$libdir:/lib:/usr/local/lib:/usr/local/libexec:/opt
PTALPIPESSEARCHPATH=/var/run:/var:/var/ptal:/usr/var/run:/usr/var:/usr/var/ptal:/usr/local/var/run:/usr/local/var:/usr/local/var/ptal:/dev:/dev/ptal
MTINKPIPESSEARCHPATH=/var:/var/run:/usr/var/:/usr/var/run:/usr/local/var:/usr/local/var/run:/dev
@@ -257,15 +257,15 @@ AC_PATH_PROGS(CUPS_LPOPTIONS,lpoptions,/
AC_PATH_PROGS(CUPS_LPINFO,lpinfo,/usr/sbin/lpinfo,$SBINSEARCHPATH)
# Paths for PDQ
-FM_PATH_DIRS(PDQ_CONF,pdq,/usr/lib/pdq,$SYS_LIB_PATH)
+FM_PATH_DIRS(PDQ_CONF,pdq,$libdir/pdq,$SYS_LIB_PATH)
AC_PATH_PROGS(PDQ_PRINTRC,pdq/printrc,$PDQ_CONF/printrc,$SYS_LIB_PATH)
dnl PDQ_FOOMATIC=$PDQ_CONF/drivers/foomatic
AC_PATH_PROGS(PDQ_PRINT,pdq lpr-pdq,/usr/bin/pdq,$BINSEARCHPATH)
dnl PDQ_JOBDIR=~/.printjobs
# Paths for PPR
-AC_PATH_PROGS(PPR_PPRD,ppr/bin/pprd,/usr/lib/ppr/bin/pprd,$LIBSEARCHPATH)
-FM_PATH_DIRS(PPR_INTERFACES,ppr/interfaces,/usr/lib/ppr/interfaces,$LIBSEARCHPATH)
+AC_PATH_PROGS(PPR_PPRD,ppr/bin/pprd,$libdir/ppr/bin/pprd,$LIBSEARCHPATH)
+FM_PATH_DIRS(PPR_INTERFACES,ppr/interfaces,$libdir/ppr/interfaces,$LIBSEARCHPATH)
FM_PATH_DIRS(PPR_PPDFILES,ppr/PPDFiles,/usr/share/ppr/PPDFiles,$DATASEARCHPATH)
FM_PATH_DIRS(PPR_ETC,ppr,/etc/ppr,$SYSCONFSEARCHPATH)
AC_PATH_PROGS(PPR_PPR,ppr lpr-ppr,/usr/bin/ppr,$BINSEARCHPATH)

View File

@ -1,39 +0,0 @@
diff -up foomatic-db-engine-4.0.3/configure.ac.perl foomatic-db-engine-4.0.3/configure.ac
--- foomatic-db-engine-4.0.3/configure.ac.perl 2009-12-04 09:26:14.236782616 +0000
+++ foomatic-db-engine-4.0.3/configure.ac 2009-12-04 09:29:08.819781206 +0000
@@ -184,13 +184,13 @@ else
PREFIX=$prefix
fi
echo -n Checking whether Perl will find libraries installed under $PREFIX...
-if ( $PERL -V | egrep "^ *$PREFIX/lib(/perl[[0-9]]?|)(/site_perl|)/[[0-9]]" > /dev/null); then
+if ( $PERL -V | egrep "^ *$PREFIX/lib(/perl[[0-9]]?|)(/site_perl|)" > /dev/null); then
PERLPREFIX=$PREFIX
echo " yes"
else
echo " no"
echo -n Checking whether Perl will find libraries installed under /usr/local...
- if ( $PERL -V | egrep "^ */usr/local/lib(/perl[[0-9]]?|)(/site_perl|)/[[0-9]]" > /dev/null); then
+ if ( $PERL -V | egrep "^ */usr/local/lib(/perl[[0-9]]?|)(/site_perl|)" > /dev/null); then
PERLPREFIX=/usr/local
echo " yes"
echo Installing the Perl libraries with prefix /usr/local.
diff -up foomatic-db-engine-4.0.3/configure.perl foomatic-db-engine-4.0.3/configure
--- foomatic-db-engine-4.0.3/configure.perl 2009-12-04 09:29:12.117906609 +0000
+++ foomatic-db-engine-4.0.3/configure 2009-12-04 09:29:34.709782105 +0000
@@ -4519,13 +4519,13 @@ else
PREFIX=$prefix
fi
echo -n Checking whether Perl will find libraries installed under $PREFIX...
-if ( $PERL -V | egrep "^ *$PREFIX/lib(/perl[0-9]?|)(/site_perl|)/[0-9]" > /dev/null); then
+if ( $PERL -V | egrep "^ *$PREFIX/lib(/perl[0-9]?|)(/site_perl|)" > /dev/null); then
PERLPREFIX=$PREFIX
echo " yes"
else
echo " no"
echo -n Checking whether Perl will find libraries installed under /usr/local...
- if ( $PERL -V | egrep "^ */usr/local/lib(/perl[0-9]?|)(/site_perl|)/[0-9]" > /dev/null); then
+ if ( $PERL -V | egrep "^ */usr/local/lib(/perl[0-9]?|)(/site_perl|)" > /dev/null); then
PERLPREFIX=/usr/local
echo " yes"
echo Installing the Perl libraries with prefix /usr/local.
diff -up foomatic-db-engine-4.0.3/Makefile.in.perl foomatic-db-engine-4.0.3/Makefile.in

View File

@ -1,209 +0,0 @@
diff -up foomatic-filters-4.0.7/foomaticrip.c.CVE-2011-2697 foomatic-filters-4.0.7/foomaticrip.c
--- foomatic-filters-4.0.7/foomaticrip.c.CVE-2011-2697 2011-07-20 10:41:15.825401233 +0100
+++ foomatic-filters-4.0.7/foomaticrip.c 2011-07-20 10:42:22.784101806 +0100
@@ -1239,8 +1239,11 @@ int main(int argc, char** argv)
}
/* Check for LPRng first so we do not pick up bogus ppd files by the -ppd option */
- if (arglist_remove_flag(arglist, "--lprng"))
- spooler = SPOOLER_LPRNG;
+ if (spooler != SPOOLER_CUPS && spooler != SPOOLER_PPR &&
+ spooler != SPOOLER_PPR_INT) {
+ if (arglist_remove_flag(arglist, "--lprng"))
+ spooler = SPOOLER_LPRNG;
+ }
/* 'PRINTCAP_ENTRY' environment variable is : LPRng
the :ppd=/path/to/ppdfile printcap entry should be used */
@@ -1262,96 +1265,104 @@ int main(int argc, char** argv)
}
}
- /* PPD file name given via the command line
- allow duplicates, and use the last specified one */
- if (spooler != SPOOLER_LPRNG) {
- while ((str = arglist_get_value(arglist, "-p"))) {
- strncpy(job->ppdfile, str, 256);
- arglist_remove(arglist, "-p");
- }
- }
- while ((str = arglist_get_value(arglist, "--ppd"))) {
- strncpy(job->ppdfile, str, 256);
- arglist_remove(arglist, "--ppd");
- }
-
- /* Check for LPD/GNUlpr by typical options which the spooler puts onto
- the filter's command line (options "-w": text width, "-l": text
- length, "-i": indent, "-x", "-y": graphics size, "-c": raw printing,
- "-n": user name, "-h": host name) */
- if ((str = arglist_get_value(arglist, "-h"))) {
- if (spooler != SPOOLER_GNULPR && spooler != SPOOLER_LPRNG)
- spooler = SPOOLER_LPD;
- strncpy(job->host, str, 127);
- job->host[127] = '\0';
- arglist_remove(arglist, "-h");
- }
- if ((str = arglist_get_value(arglist, "-n"))) {
- if (spooler != SPOOLER_GNULPR && spooler != SPOOLER_LPRNG)
- spooler = SPOOLER_LPD;
-
- strncpy(job->user, str, 127);
- job->user[127] = '\0';
- arglist_remove(arglist, "-n");
- }
- if (arglist_remove(arglist, "-w") ||
- arglist_remove(arglist, "-l") ||
- arglist_remove(arglist, "-x") ||
- arglist_remove(arglist, "-y") ||
- arglist_remove(arglist, "-i") ||
- arglist_remove_flag(arglist, "-c")) {
+ /* CUPS calls foomatic-rip only with 5 or 6 positional parameters,
+ not with named options, like for example "-p <string>". Also PPR
+ does not used named options. */
+ if (spooler != SPOOLER_CUPS && spooler != SPOOLER_PPR &&
+ spooler != SPOOLER_PPR_INT) {
+ /* Check for LPD/GNUlpr by typical options which the spooler puts onto
+ the filter's command line (options "-w": text width, "-l": text
+ length, "-i": indent, "-x", "-y": graphics size, "-c": raw printing,
+ "-n": user name, "-h": host name) */
+ if ((str = arglist_get_value(arglist, "-h"))) {
+ if (spooler != SPOOLER_GNULPR && spooler != SPOOLER_LPRNG)
+ spooler = SPOOLER_LPD;
+ strncpy(job->host, str, 127);
+ job->host[127] = '\0';
+ arglist_remove(arglist, "-h");
+ }
+ if ((str = arglist_get_value(arglist, "-n"))) {
if (spooler != SPOOLER_GNULPR && spooler != SPOOLER_LPRNG)
spooler = SPOOLER_LPD;
- }
- /* LPRng delivers the option settings via the "-Z" argument */
- if ((str = arglist_get_value(arglist, "-Z"))) {
- spooler = SPOOLER_LPRNG;
- dstrcatf(job->optstr, "%s ", str);
- arglist_remove(arglist, "-Z");
- }
- /* Job title and options for stock LPD */
- if ((str = arglist_get_value(arglist, "-j")) || (str = arglist_get_value(arglist, "-J"))) {
- strncpy_omit(job->title, str, 128, omit_shellescapes);
- if (spooler == SPOOLER_LPD)
- dstrcatf(job->optstr, "%s ", job->title);
- if (!arglist_remove(arglist, "-j"))
- arglist_remove(arglist, "-J");
- }
- /* Check for CPS */
- if (arglist_remove_flag(arglist, "--cps") > 0)
- spooler = SPOOLER_CPS;
-
- /* Options for spooler-less printing, CPS, or PDQ */
- while ((str = arglist_get_value(arglist, "-o"))) {
- strncpy_omit(tmp, str, 1024, omit_shellescapes);
- dstrcatf(job->optstr, "%s ", tmp);
- arglist_remove(arglist, "-o");
- /* If we don't print as PPR RIP or as CPS filter, we print
- without spooler (we check for PDQ later) */
- if (spooler != SPOOLER_PPR && spooler != SPOOLER_CPS)
- spooler = SPOOLER_DIRECT;
- }
-
- /* Printer for spooler-less printing or PDQ */
- if ((str = arglist_get_value(arglist, "-d"))) {
- strncpy_omit(job->printer, str, 256, omit_shellescapes);
- arglist_remove(arglist, "-d");
- }
-
- /* Printer for spooler-less printing, PDQ, or LPRng */
- if ((str = arglist_get_value(arglist, "-P"))) {
- strncpy_omit(job->printer, str, 256, omit_shellescapes);
- arglist_remove(arglist, "-P");
- }
-
- /* Were we called from a PDQ wrapper? */
- if (arglist_remove_flag(arglist, "--pdq"))
- spooler = SPOOLER_PDQ;
- /* Were we called to build the PDQ driver declaration file? */
- genpdqfile = check_pdq_file(arglist);
- if (genpdqfile)
- spooler = SPOOLER_PDQ;
+ strncpy(job->user, str, 127);
+ job->user[127] = '\0';
+ arglist_remove(arglist, "-n");
+ }
+ if (arglist_remove(arglist, "-w") ||
+ arglist_remove(arglist, "-l") ||
+ arglist_remove(arglist, "-x") ||
+ arglist_remove(arglist, "-y") ||
+ arglist_remove(arglist, "-i") ||
+ arglist_remove_flag(arglist, "-c")) {
+ if (spooler != SPOOLER_GNULPR && spooler != SPOOLER_LPRNG)
+ spooler = SPOOLER_LPD;
+ }
+ /* LPRng delivers the option settings via the "-Z" argument */
+ if ((str = arglist_get_value(arglist, "-Z"))) {
+ spooler = SPOOLER_LPRNG;
+ dstrcatf(job->optstr, "%s ", str);
+ arglist_remove(arglist, "-Z");
+ }
+ /* Job title and options for stock LPD */
+ if ((str = arglist_get_value(arglist, "-j")) || (str = arglist_get_value(arglist, "-J"))) {
+ strncpy_omit(job->title, str, 128, omit_shellescapes);
+ if (spooler == SPOOLER_LPD)
+ dstrcatf(job->optstr, "%s ", job->title);
+ if (!arglist_remove(arglist, "-j"))
+ arglist_remove(arglist, "-J");
+ }
+
+ /* Check for CPS */
+ if (arglist_remove_flag(arglist, "--cps") > 0)
+ spooler = SPOOLER_CPS;
+
+ /* PPD file name given via the command line
+ allow duplicates, and use the last specified one */
+ if (spooler != SPOOLER_GNULPR && spooler != SPOOLER_LPRNG &&
+ spooler != SPOOLER_LPD) {
+ while ((str = arglist_get_value(arglist, "-p"))) {
+ strncpy(job->ppdfile, str, 256);
+ arglist_remove(arglist, "-p");
+ }
+ while ((str = arglist_get_value(arglist, "--ppd"))) {
+ strncpy(job->ppdfile, str, 256);
+ arglist_remove(arglist, "--ppd");
+ }
+ }
+
+ /* Options for spooler-less printing, CPS, or PDQ */
+ while ((str = arglist_get_value(arglist, "-o"))) {
+ strncpy_omit(tmp, str, 1024, omit_shellescapes);
+ dstrcatf(job->optstr, "%s ", tmp);
+ arglist_remove(arglist, "-o");
+ /* If we don't print as PPR RIP or as CPS filter, we print
+ without spooler (we check for PDQ later) */
+ if (spooler != SPOOLER_PPR && spooler != SPOOLER_CPS)
+ spooler = SPOOLER_DIRECT;
+ }
+
+ /* Printer for spooler-less printing or PDQ */
+ if ((str = arglist_get_value(arglist, "-d"))) {
+ strncpy_omit(job->printer, str, 256, omit_shellescapes);
+ arglist_remove(arglist, "-d");
+ }
+
+ /* Printer for spooler-less printing, PDQ, or LPRng */
+ if ((str = arglist_get_value(arglist, "-P"))) {
+ strncpy_omit(job->printer, str, 256, omit_shellescapes);
+ arglist_remove(arglist, "-P");
+ }
+
+ /* Were we called from a PDQ wrapper? */
+ if (arglist_remove_flag(arglist, "--pdq"))
+ spooler = SPOOLER_PDQ;
+
+ /* Were we called to build the PDQ driver declaration file? */
+ genpdqfile = check_pdq_file(arglist);
+ if (genpdqfile)
+ spooler = SPOOLER_PDQ;
+ }
/* spooler specific initialization */
switch (spooler) {

View File

@ -1,12 +0,0 @@
diff -up foomatic-filters-4.0.0/configure.ac.libdir foomatic-filters-4.0.0/configure.ac
--- foomatic-filters-4.0.0/configure.ac.libdir 2009-01-14 19:23:15.000000000 +0000
+++ foomatic-filters-4.0.0/configure.ac 2009-01-15 10:57:55.000000000 +0000
@@ -43,7 +43,7 @@ AC_CHECK_FUNCS([dup2 getcwd gethostname
ETCSEARCHPATH=${prefix}/etc:/usr/etc:/usr/local/etc
-LIBSEARCHPATH=${prefix}/lib:${prefix}/lib64:/usr/lib:/usr/lib64:/usr/local/lib:${prefix}/libexec:/usr/libexec:/usr/local/libexec
+LIBSEARCHPATH=${libdir}:/usr/lib:/usr/lib64:/usr/local/lib:${prefix}/libexec:/usr/libexec:/usr/local/libexec
uname=`uname`
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`

View File

@ -1,20 +0,0 @@
diff -up foomatic-filters-4.0.5/pdf.c.mkstemp foomatic-filters-4.0.5/pdf.c
--- foomatic-filters-4.0.5/pdf.c.mkstemp 2010-08-10 12:08:04.000000000 +0200
+++ foomatic-filters-4.0.5/pdf.c 2010-08-18 12:34:11.000000000 +0200
@@ -110,13 +110,14 @@ static int pdf_extract_pages(char filena
{
char gscommand[4095];
char filename_arg[PATH_MAX], first_arg[50], last_arg[50];
+ int fd;
_log("Extracting pages %d through %d\n", first, last);
snprintf(filename, PATH_MAX, "%s/foomatic-XXXXXX", temp_dir());
- mktemp(filename);
- if (!filename[0])
+ if ((fd = mkstemp(filename)) == -1)
rip_die(EXIT_STARVED, "Unable to create temporary file!\n");
+ close (fd);
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
snprintf(first_arg, 50, "-dFirstPage=%d", first);

View File

@ -1,10 +1,10 @@
%define enginever 4.0.7
%define filtersver 4.0.7
%define enginever 4.0.8
%define filtersver 4.0.8
Summary: Tools for using the foomatic database of printers and printer drivers
Name: foomatic
Version: %{enginever}
Release: 2%{?dist}
Release: 1%{?dist}
License: GPLv2+
Group: System Environment/Libraries
@ -16,24 +16,8 @@ Source1: http://www.openprinting.org/download/foomatic/foomatic-filters-%{filter
## PATCHES FOR FOOMATIC-FILTERS (PATCHES 1 TO 100)
# Use libdir.
Patch1: foomatic-filters-libdir.patch
# Use mkstemp, not mktemp.
Patch2: foomatic-mkstemp.patch
# Fix improper sanitization of command line options (bug #721001,
# CVE-2011-2697).
Patch3: foomatic-filters-CVE-2011-2697.patch
## PATCHES FOR FOOMATIC-DB-ENGINE (PATCHES 101 TO 200)
# Use libdir.
Patch101: foomatic-db-engine-libdir.patch
# Handle non-UTF-8 encodings in imported PPD files.
Patch102: foomatic-bad-utf8.patch
## PATCHES FOR FOOMATIC-DB-HPIJS (PATCHES 201 TO 300)
Url: http://www.linuxprinting.org
@ -42,7 +26,9 @@ BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: libxml2-devel
BuildRequires: autoconf, automake
BuildRequires: cups
Requires: %{name}-filters = %{version}-%{release}
BuildRequires: dbus-devel
Requires: dbus
Requires: %{name}-filters = %{version}-%{release}
Requires: perl >= 3:5.8.1
Requires: %(eval `perl -V:version`; echo "perl(:MODULE_COMPAT_$version)")
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -87,18 +73,13 @@ CUPS print filters for the foomatic package.
%setup -q -c -a 1
pushd foomatic-filters-%{filtersver}
%patch1 -p1 -b .libdir
%patch2 -p1 -b .mkstemp
%patch3 -p1 -b .CVE-2011-2697
aclocal
automake
automake --add-missing
autoconf
popd
pushd foomatic-db-engine-%{enginever}
chmod a+x mkinstalldirs
%patch101 -p1 -b .libdir
%patch102 -p1
aclocal
autoconf
popd
@ -198,6 +179,9 @@ rm -fr %buildroot $RPM_BUILD_DIR/%{name}
%{_mandir}/man1/foomatic-rip.1*
%changelog
* Mon Jul 25 2011 Jiri Popelka <jpopelka@redhat.com> - 4.0.8-1
- 4.0.8 (all patches merged upstream)
* Wed Jul 20 2011 Tim Waugh <twaugh@redhat.com> - 4.0.7-2
- Fix improper sanitization of command line options (bug #721001,
CVE-2011-2697).

View File

@ -1,2 +1,2 @@
fcfa8eb9ce5494b81b58ae983fc2aeb5 foomatic-db-engine-4.0.7.tar.gz
20abd25c1c98b2dae68709062a132a7d foomatic-filters-4.0.7.tar.gz
5283cd5125a96dc0b35d896326512b1a foomatic-db-engine-4.0.8.tar.gz
752324ef037fbb0de18190aa26ceab7d foomatic-filters-4.0.8.tar.gz