Browse Source

upgrading package: a2ps 4.13b -> 4.14

master
parent
commit
480b9c80a5
  1. 125
      a2ps/a2ps.patch
  2. 27
      a2ps/a2ps.spec

125
a2ps/a2ps.patch

@ -1,125 +0,0 @@
Index: lib/quotearg.c
--- lib/quotearg.c.orig 2000-01-19 09:19:48 +0100
+++ lib/quotearg.c 2004-08-06 13:34:41 +0200
@@ -59,6 +59,9 @@
#endif
#if HAVE_MBRTOWC && HAVE_WCHAR_H
+#if defined(__hpux)
+# include<sys/_mbstate_t.h>
+#endif
# include <wchar.h>
#else
# define iswprint(wc) 1
Index: lib/strftime.c
--- lib/strftime.c.orig 2000-01-02 08:10:09 +0100
+++ lib/strftime.c 2004-08-06 13:35:34 +0200
@@ -67,6 +67,9 @@
#if DO_MULTIBYTE
# if HAVE_MBRLEN
+# if defined(__hpux)
+# include<sys/_mbstate_t.h>
+# endif
# include <wchar.h>
# else
/* Simulate mbrlen with mblen as best we can. */
Index: lib/path-concat.c
--- lib/path-concat.c.orig 1999-10-10 20:34:46 +0200
+++ lib/path-concat.c 2004-08-18 19:56:40 +0200
@@ -31,8 +31,6 @@
#endif
#include <sys/types.h>
-char *malloc ();
-
#ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
#endif
Index: etc/Makefile.in
--- etc/Makefile.in.orig 2000-02-24 18:55:34 +0100
+++ etc/Makefile.in 2006-09-10 18:56:23 +0200
@@ -131,7 +131,7 @@
lispdir = @lispdir@
-ogonkifydir = $(datadir)/ogonkify
+ogonkifydir = $(datadir)/a2ps/ogonkify
libpath = $(pkgdatadir)/sheets:$(pkgdatadir)/ps:$(pkgdatadir)/encoding:$(pkgdatadir)/afm:$(ogonkifydir)/afm:$(pkgdatadir)/ppd:$(pkgdatadir)/fonts:$(ogonkifydir)/fonts:$(pkgdatadir)
pkgdata_DATA = README
Index: ogonkify/Makefile.in
--- ogonkify/Makefile.in.orig 2000-01-07 14:00:49 +0100
+++ ogonkify/Makefile.in 2006-09-10 18:57:37 +0200
@@ -33,7 +33,7 @@
DESTDIR =
-pkgdatadir = $(datadir)/@PACKAGE@
+pkgdatadir = $(datadir)/a2ps/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-1170
a2ps 4.13 allows remote attackers to execute arbitrary commands via
shell metacharacters in the filename.
source: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/print/a2ps-letter/files/patch-select.c?rev=1.1&content-type=text/plain
--- src/select.c.orig Thu Dec 16 02:04:56 1999
+++ src/select.c Sat Aug 21 12:05:31 2004
@@ -131,6 +131,36 @@
return 1;
}
+/* escapes the name of a file so that the shell groks it in 'single' q.marks.
+ The resulting pointer has to be free()ed when not longer used. */
+char *
+shell_escape(const char *fn)
+{
+ size_t len = 0;
+ const char *inp;
+ char *retval, *outp;
+
+ for(inp = fn; *inp; ++inp)
+ switch(*inp)
+ {
+ case '\'': len += 4; break;
+ default: len += 1; break;
+ }
+
+ outp = retval = malloc(len + 1);
+ if(!outp)
+ return NULL; /* perhaps one should do better error handling here */
+ for(inp = fn; *inp; ++inp)
+ switch(*inp)
+ {
+ case '\'': *outp++ = '\''; *outp++ = '\\'; *outp++ = '\'', *outp++ = '\''; break;
+ default: *outp++ = *inp; break;
+ }
+ *outp = 0;
+
+ return retval;
+}
+
/* What says file about the type of a file (result is malloc'd). NULL
if could not be run. */
@@ -144,11 +174,15 @@
if (IS_EMPTY (job->file_command))
return NULL;
+ filename = shell_escape(filename);
+ if(filename == NULL)
+ return NULL;
/* Call file(1) with the correct option */
- command = ALLOCA (char, (2
+ command = ALLOCA (char, (4
+ strlen (job->file_command)
+ ustrlen (filename)));
- sprintf (command, "%s %s", job->file_command, (const char *) filename);
+ sprintf (command, "%s '%s'", job->file_command, (const char *) filename);
+ free(filename);
message (msg_tool, (stderr, "Reading pipe: `%s'\n", command));
file_out = popen (command, "r");

27
a2ps/a2ps.spec

@ -21,10 +21,6 @@
## SUCH DAMAGE.
##
# package version
%define V_major 4.13
%define V_minor b
# package information
Name: a2ps
Summary: Any to Postscript Conversion Tool
@ -35,16 +31,15 @@ Distribution: OpenPKG Community
Class: BASE
Group: Postscript
License: GPL
Version: %{V_major}%{V_minor}
Release: 20080101
Version: 4.14
Release: 20150117
# list of sources
Source0: ftp://ftp.enst.fr/pub/unix/a2ps/a2ps-%{V_major}%{V_minor}.tar.gz
Patch0: a2ps.patch
Source0: http://ftp.gnu.org/gnu/a2ps/a2ps-%{version}.tar.gz
# build information
BuildPreReq: OpenPKG, openpkg >= 20100101, psutils, flex, bison, config
PreReq: OpenPKG, openpkg >= 20100101, psutils
BuildPreReq: OpenPKG, openpkg >= 20140101, psutils, flex, bison
PreReq: OpenPKG, openpkg >= 20140101, psutils
%description
a2ps is an Any to PostScript filter. It started as a Text to
@ -56,23 +51,20 @@ PreReq: OpenPKG, openpkg >= 20100101, psutils
%track
prog a2ps = {
version = %{version}
url = ftp://ftp.enst.fr/pub/unix/a2ps/
url = http://ftp.gnu.org/gnu/a2ps/
regex = a2ps-(__VER__)\.tar\.gz
}
%prep
%setup -q -n a2ps-%{V_major}
%patch -p0
%{l_prefix}/bin/config install auxdir
%setup -q
%build
( echo "ac_cv_c_inline=no"
) >config.cache
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--cache-file=./config.cache \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man \
--infodir=%{l_prefix}/info \
--sysconfdir=%{l_prefix}/etc/a2ps \
--disable-shared \
--disable-nls
@ -81,7 +73,6 @@ PreReq: OpenPKG, openpkg >= 20100101, psutils
%install
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}

Loading…
Cancel
Save