a2ps: update to 4.15.6, remove liba2ps/-devel.

This commit is contained in:
Andrew Benson 2024-08-07 20:41:09 -05:00
parent 14900b6c49
commit d24cc14788
6 changed files with 10 additions and 125 deletions

View File

@ -1,69 +0,0 @@
Index: b/lib/routines.c
===================================================================
--- a/lib/routines.c
+++ b/lib/routines.c
@@ -242,3 +242,50 @@
/* Don't complain if you can't unlink. Who cares of a tmp file? */
unlink (filename);
}
+
+/*
+ * Securely generate a temp file, and make sure it gets
+ * deleted upon exit.
+ */
+static char ** tempfiles;
+static unsigned ntempfiles;
+
+static void
+cleanup_tempfiles()
+{
+ while (ntempfiles--)
+ unlink(tempfiles[ntempfiles]);
+}
+
+char *
+safe_tempnam(const char *pfx)
+{
+ char *dirname, *filename;
+ int fd;
+
+ if (!(dirname = getenv("TMPDIR")))
+ dirname = "/tmp";
+
+ tempfiles = (char **) realloc(tempfiles,
+ (ntempfiles+1) * sizeof(char *));
+ if (tempfiles == NULL)
+ return NULL;
+
+ filename = malloc(strlen(dirname) + strlen(pfx) + sizeof("/XXXXXX"));
+ if (!filename)
+ return NULL;
+
+ sprintf(filename, "%s/%sXXXXXX", dirname, pfx);
+
+ if ((fd = mkstemp(filename)) < 0) {
+ free(filename);
+ return NULL;
+ }
+ close(fd);
+
+ if (ntempfiles == 0)
+ atexit(cleanup_tempfiles);
+ tempfiles[ntempfiles++] = filename;
+
+ return filename;
+}
Index: b/lib/routines.h
===================================================================
--- a/lib/routines.h
+++ b/lib/routines.h
@@ -255,7 +255,8 @@
/* If _STR_ is not defined, give it a tempname in _TMPDIR_ */
#define tempname_ensure(Str) \
do { \
- (Str) = (Str) ? (Str) : tempnam (NULL, "a2_"); \
+ (Str) = (Str) ? (Str) : safe_tempnam("a2_"); \
} while (0)
+char * safe_tempnam(const char *);
#endif

View File

@ -1,30 +0,0 @@
Description: CVE-2014-0466: fixps does not invoke gs with -dSAFER
A malicious PostScript file could delete files with the privileges of
the invoking user.
Origin: vendor
Bug-Debian: http://bugs.debian.org/742902
Author: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2014-03-28
--- a/contrib/fixps.in
+++ b/contrib/fixps.in
@@ -389,7 +389,7 @@
eval "$command" ;;
gs)
$verbose "$program: making a full rewrite of the file ($gs)." >&2
- $gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
+ $gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
esac
)
fi
--- a/contrib/fixps.m4
+++ b/contrib/fixps.m4
@@ -307,7 +307,7 @@
eval "$command" ;;
gs)
$verbose "$program: making a full rewrite of the file ($gs)." >&2
- $gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
+ $gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
esac
)
fi

View File

@ -1,18 +1,19 @@
# Template file for 'a2ps'
pkgname=a2ps
version=4.14
revision=5
version=4.15.6
revision=1
configure_args="--sysconfdir=/etc/a2ps --enable-shared --with-medium=A4"
build_style=gnu-configure
hostmakedepends="perl gperf m4"
makedepends="ghostscript psutils groff cups"
depends="$makedepends"
hostmakedepends="perl gperf m4 pkg-config"
_deps="ghostscript psutils groff cups"
makedepends="gc-devel libpaper-devel ${_deps}"
depends="${_deps}"
short_desc="Any to PS filter"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="http://www.gnu.org/software/a2ps/"
distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=f3ae8d3d4564a41b6e2a21f237d2f2b104f48108591e8b83497500182a3ab3a4
checksum=87ff9d801cb11969181d5b8cf8b65e65e5b24bb0c76a1b825e8098f2906fbdf4
conf_files="/etc/a2ps/a2ps.cfg /etc/a2ps/a2ps-site.cfg"
LDFLAGS="-lm"
@ -21,20 +22,3 @@ pre_configure() {
sed -i "s/GPERF --version |/& head -n 1 |/" ./configure
sed -i "s|/usr/local/share|/usr/share|" ./configure
}
liba2ps-devel_package() {
short_desc+=" - development files"
depends="liba2ps>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
}
}
liba2ps_package() {
short_desc+=" - library files"
pkg_install() {
vmove "usr/lib/*.so.*"
}
}

View File

@ -1 +0,0 @@
a2ps

View File

@ -1 +0,0 @@
a2ps

View File

@ -1,6 +1,6 @@
# Template file for 'removed-packages'
pkgname=removed-packages
version=0.1.20240729
version=0.1.20240807
revision=1
build_style=meta
short_desc="Uninstalls packages removed from repository"
@ -326,6 +326,8 @@ replaces="
libXevie<=1.0.3_8
libXfontcache<=1.0.5_2
libXxf86misc<=1.0.4_1
liba2ps-devel<=4.14_5
liba2ps<=4.14.5
libantimicrox-devel<=3.1.3_1
libantimicrox<=3.1.3_1
libapp<=20140527_2