update to 10.86.39 [release 10.86.39-1mamba;Tue Dec 12 2023]

This commit is contained in:
Silvan Calarco 2024-01-06 07:35:55 +01:00
parent 02dc7f0039
commit 1d84c7f28c
14 changed files with 105 additions and 3188 deletions

View File

@ -1,12 +0,0 @@
--- netpbm-10.15/lib/Makefile.orig 2003-01-19 20:49:07.000000000 +0100
+++ netpbm-10.15/lib/Makefile 2003-05-17 23:06:16.000000000 +0200
@@ -186,7 +186,8 @@
libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) $(PKGDIR)/lib/
cd $(PKGDIR)/lib/ ; \
rm -f libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ); \
- $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) $(SONAME)
+ $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) $(SONAME); \
+ $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) libnetpbm.$(NETPBMLIBSUFFIX)
endif
ifeq ($(NETPBMLIBTYPE),dll)
#install a Windows DLL shared library

View File

@ -1,20 +0,0 @@
--- netpbm-10.20/converter/other/pnmtopng.c.orig 2005-10-19 13:41:17.000000000 +0200
+++ netpbm-10.20/converter/other/pnmtopng.c 2005-10-19 13:42:13.000000000 +0200
@@ -152,7 +152,7 @@ closestColorInPalette(pixel con
unsigned int * const bestMatchP) {
unsigned int paletteIndex;
- unsigned int bestIndex;
+ unsigned int bestIndex = 0;
unsigned int bestMatch;
bestMatch = UINT_MAX;
@@ -1359,7 +1359,7 @@ convertpnm(FILE * const ifp,
/* The color part of the color/alpha palette passed to the PNG
compressor
*/
- unsigned int palette_size;
+ unsigned int palette_size = MAXCOLORS;
gray trans_pnm[MAXCOLORS];
png_byte trans[MAXCOLORS];

View File

@ -1,419 +0,0 @@
--- netpbm-10.28/converter/other/anytopnm.security2 2005-05-27 00:10:39.000000000 +0200
+++ netpbm-10.28/converter/other/anytopnm 2005-06-10 09:42:48.609492080 +0200
@@ -522,11 +522,7 @@ else
inputFile="-"
fi
-tempdir="${TMPDIR-/tmp}/anytopnm.$$"
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
-chmod 700 $tempdir
-
-trap 'rm -rf $tempdir' 0
+tempdir=$(mktemp -d -t anytopnm.XXXXXXXXXX) || exit 1
findAwk;
@@ -549,9 +545,17 @@ if [ "$filetype" = "unknown" ]; then
echo "$progname: unknown file type. " \
"'file' says mime type is '$mimeType', " 1>&2
echo "type description is '$typeDescription'" 1>&2
+ if [ -d "$tempdir" ] ; then
+ rm -rf "$tempdir"
+ fi
+
exit 1
fi
convertIt $file $filetype
+if [ -d "$tempdir" ] ; then
+ rm -rf "$tempdir"
+fi
+
exit 0
--- netpbm-10.28/editor/ppmfade.security2 2005-03-16 22:10:39.000000000 +0100
+++ netpbm-10.28/editor/ppmfade 2005-06-10 09:02:04.545046352 +0200
@@ -14,6 +14,7 @@
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
use strict;
+use File::Temp "tempdir";
my $SPREAD = 1;
my $SHIFT = 2;
@@ -116,20 +117,26 @@ if ($first_file ne "undefined") {
print("Frames are " . $width . "W x " . $height . "H\n");
+#
+# We create a tmp-directory right here
+#
+my $tmpdir = tempdir("ppmfade.XXXXXX", CLEANUP => 1);
+
+
if ($first_file eq "undefined") {
print "Fading from black to ";
- system("ppmmake \\#000 $width $height >junk1$$.ppm");
+ system("ppmmake \\#000 $width $height >$tmpdir/junk1$$.ppm");
} else {
print "Fading from $first_file to ";
- system("cp", $first_file, "junk1$$.ppm");
+ system("cp", $first_file, "$tmpdir/junk1$$.ppm");
}
if ($last_file eq "undefined") {
print "black.\n";
- system("ppmmake \\#000 $width $height >junk2$$.ppm");
+ system("ppmmake \\#000 $width $height >$tmpdir/junk2$$.ppm");
} else {
print "$last_file\n";
- system("cp", $last_file, "junk2$$.ppm");
+ system("cp", $last_file, "$tmpdir/junk2$$.ppm");
}
#
@@ -137,14 +144,14 @@ if ($last_file eq "undefined") {
#
# Here's what our temporary files are:
-# junk1$$.ppm: The original (fade-from) image
-# junk2$$.ppm: The target (fade-from) image
-# junk3$$.ppm: The frame of the fade for the current iteration of the
-# the for loop.
-# junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
-# image to another, this is the first frame of that
-# sequence.
-# junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
+# $tmpdir/junk1$$.ppm: The original (fade-from) image
+# $tmpdir/junk2$$.ppm: The target (fade-from) image
+# $tmpdir/junk3$$.ppm: The frame of the fade for the current iteration of the
+# the for loop.
+# $tmpdir/junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
+# image to another, this is the first frame of that
+# sequence.
+# $tmpdir/junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
my $i; # Frame number
for ($i = 1; $i <= $nframes; $i++) {
@@ -152,148 +159,148 @@ for ($i = 1; $i <= $nframes; $i++) {
if ($mode eq $SPREAD) {
if ($i <= 10) {
my $n = $spline20[$i] * 100;
- system("ppmspread $n junk1$$.ppm >junk3$$.ppm");
+ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n;
$n = $spline20[$i] * 100;
- system("ppmspread $n junk1$$.ppm >junk1a$$.ppm");
+ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
$n = (1-$spline20[$i-10]) * 100;
- system("ppmspread $n junk2$$.ppm >junk2a$$.ppm");
+ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
$n = $spline10[$i-10];
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = (1-$spline20[$i-10])*100;
- system("ppmspread $n junk2$$.ppm >junk3$$.ppm");
+ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
}
} elsif ($mode eq $SHIFT) {
if ($i <= 10) {
my $n = $spline20[$i] * 100;
- system("ppmshift $n junk1$$.ppm >junk3$$.ppm");
+ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n;
$n = $spline20[$i] * 100;
- system("ppmshift $n junk1$$.ppm >junk1a$$.ppm");
+ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
$n = (1-$spline20[$i-10])*100;
- system("ppmshift $n junk2$$.ppm >junk2a$$.ppm");
+ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
$n = $spline10[$i-10];
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = (1-$spline20[$i-10]) * 100;
- system("ppmshift $n junk2$$.ppm >junk3$$.ppm");
+ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
}
} elsif ($mode eq $RELIEF) {
if ($i == 1) {
- system("ppmrelief junk1$$.ppm >junk1r$$.ppm");
+ system("ppmrelief $tmpdir/junk1$$.ppm >$tmpdir/junk1r$$.ppm");
}
if ($i <= 10) {
my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1r$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1r$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n = $spline10[$i-10];
- system("ppmmix $n junk1r$$.ppm junk2r$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1r$$.ppm $tmpdir/junk2r$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = $spline10[$i-20];
- system("ppmmix $n junk2r$$.ppm junk2$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk2r$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
}
if ($i == 10) {
- system("ppmrelief junk2$$.ppm >junk2r$$.ppm");
+ system("ppmrelief $tmpdir/junk2$$.ppm >$tmpdir/junk2r$$.ppm");
}
} elsif ($mode eq $OIL) {
if ($i == 1) {
- system("ppmtopgm junk1$$.ppm | pgmoil >junko$$.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
- ">junk1o$$.ppm");
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
+ ">$tmpdir/junk1o$$.ppm");
}
if ($i <= 10) {
my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n = $spline10[$i-10];
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = $spline10[$i-20];
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
}
if ($i == 10) {
- system("ppmtopgm junk2$$.ppm | pgmoil >junko$$.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
- ">junk2o$$.ppm");
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
+ ">$tmpdir/junk2o$$.ppm");
}
} elsif ($mode eq $EDGE) {
if ($i == 1) {
- system("ppmtopgm junk1$$.ppm | pgmedge >junko$$.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
- ">junk1o$$.ppm");
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
+ ">$tmpdir/junk1o$$.ppm");
}
if ($i <= 10) {
my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n = $spline10[$i-10];
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = $spline10[$i-20];
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
}
if ($i == 10) {
- system("ppmtopgm junk2$$.ppm | pgmedge >junko$$.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
- ">junk2o$$.ppm");
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
+ ">$tmpdir/junk2o$$.ppm");
}
} elsif ($mode eq $BENTLEY) {
if ($i == 1) {
- system("ppmtopgm junk1$$.ppm | pgmbentley >junko$$.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
- ">junk1o$$.ppm");
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
+ ">$tmpdir/junk1o$$.ppm");
}
if ($i <= 10) {
my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n = $spline10[$i-10];
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = $spline10[$i-20];
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
}
if ($i == 10) {
- system("ppmtopgm junk2$$.ppm | pgmbentley >junko$$.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
- ">junk2o$$.ppm");
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
+ ">$tmpdir/junk2o$$.ppm");
}
} elsif ($mode eq $BLOCK) {
if ($i <= 10) {
my $n = 1 - 1.9*$spline20[$i];
- system("pamscale $n junk1$$.ppm | " .
- "pamscale -width $width -height $height >junk3$$.ppm");
+ system("pamscale $n $tmpdir/junk1$$.ppm | " .
+ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n = $spline10[$i-10];
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
} else {
my $n = 1 - 1.9*$spline20[31-$i];
- system("pamscale $n junk2$$.ppm | " .
- "pamscale -width $width -height $height >junk3$$.ppm");
+ system("pamscale $n $tmpdir/junk2$$.ppm | " .
+ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
}
if ($i == 10) {
- system("cp", "junk3$$.ppm", "junk1a$$.ppm");
- system("pamscale $n junk2$$.ppm | " .
- "pamscale -width $width -height $height >junk2a$$.ppm");
+ system("cp", "$tmpdir/junk3$$.ppm", "$tmpdir/junk1a$$.ppm");
+ system("pamscale $n $tmpdir/junk2$$.ppm | " .
+ "pamscale -width $width -height $height >$tmpdir/junk2a$$.ppm");
}
} elsif ($mode eq $MIX) {
my $fade_factor = sqrt(1/($nframes-$i+1));
- system("ppmmix $fade_factor junk1$$.ppm junk2$$.ppm >junk3$$.ppm");
+ system("ppmmix $fade_factor $tmpdir/junk1$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
} else {
print("Internal error: impossible mode value '$mode'\n");
}
my $outfile = sprintf("%s.%04d.ppm", $base_name, $i);
- system("cp", "junk3$$.ppm", $outfile);
+ system("cp", "$tmpdir/junk3$$.ppm", $outfile);
}
#
# Clean up shop.
#
-system("rm junk*$$.ppm");
+system("rm $tmpdir/junk*$$.ppm");
exit(0);
--- netpbm-10.28/editor/ppmquantall.security2 2005-03-17 00:44:03.000000000 +0100
+++ netpbm-10.28/editor/ppmquantall 2005-06-10 09:02:04.547046048 +0200
@@ -63,13 +63,8 @@ for i in ${files[@]}; do
heights=(${heights[*]} `grep -v '^#' $i | sed '1d; s/.* //; 2q'`)
done
-tempdir="${TMPDIR-/tmp}/ppmquantall.$$"
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
-chmod 700 $tempdir
-
-trap 'rm -rf $tempdir' 0 1 3 15
-
-all=$tempdir/pqa.all.$$
+all=$(mktemp -t pqa.all.XXXXXXXXXX) || exit 1
+rm -f $all
pnmcat -topbottom -jleft -white ${files[@]} | pnmquant $newcolors > $all
if [ $? != 0 ]; then
--- netpbm-10.28/editor/pnmmargin.security2 2003-12-31 05:01:26.000000000 +0100
+++ netpbm-10.28/editor/pnmmargin 2005-06-10 09:02:04.549045744 +0200
@@ -11,16 +11,11 @@
# documentation. This software is provided "as is" without express or
# implied warranty.
-tempdir="${TMPDIR-/tmp}/pnmmargin.$$"
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
-chmod 700 $tempdir
-
-trap 'rm -rf $tempdir' 0 1 3 15
-
-tmp1=$tempdir/pnmm1
-tmp2=$tempdir/pnmm2
-tmp3=$tempdir/pnmm3
-tmp4=$tempdir/pnmm4
+tmpdir=$(mktemp -d -t ppmmargin.XXXXXXX) || exit 1
+tmp1="$tmpdir/tmp1"
+tmp2="$tmpdir/tmp2"
+tmp3="$tmpdir/tmp3"
+tmp4="$tmpdir/tmp4"
color="-gofigure"
@@ -39,6 +34,9 @@ while true ; do
shift
if [ ! ${1-""} ] ; then
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
+ if [ -d "$tmpdir" ]; then
+ rm -rf "$tmpdir"
+ fi
exit 1
fi
color="$1"
@@ -46,6 +44,9 @@ while true ; do
;;
-* )
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
+ if [ -d "$tmpdir" ]; then
+ rm -rf "$tmpdir"
+ fi
exit 1
;;
* )
@@ -56,6 +57,9 @@ done
if [ ! ${1-""} ] ; then
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
+ if [ -d "$tmpdir" ]; then
+ rm -rf "$tmpdir"
+ fi
exit 1
fi
size="$1"
@@ -63,6 +67,9 @@ shift
if [ ${2-""} ] ; then
echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
+ if [ -d "$tmpdir" ]; then
+ rm -rf "$tmpdir"
+ fi
exit 1
fi
@@ -86,3 +93,7 @@ pamflip -rotate90 $tmp2 > $tmp3
# Cat things together.
pnmcat -lr $tmp2 $tmp1 $tmp2 > $tmp4
pnmcat -tb $tmp3 $tmp4 $tmp3
+
+if [ -d "$tmpdir" ]; then
+ rm -rf "$tmpdir"
+fi
--- netpbm-10.28/editor/pamstretch-gen.security2 2004-07-25 02:01:24.000000000 +0200
+++ netpbm-10.28/editor/pamstretch-gen 2005-06-10 09:02:04.550045592 +0200
@@ -31,10 +31,7 @@ if [ "$1" = "" ]; then
exit 1
fi
-tempdir="${TMPDIR-/tmp}/pamstretch-gen.$$"
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
-chmod 700 $tempdir
-tempfile=$tempdir/pnmig
+tempfile=$(mktemp /tmp/pnmig.XXXXXXXXXX) || exit 1
trap 'rm -rf $tempdir' 0 1 3 15
--- netpbm-10.28/editor/ppmshadow.security2 2005-04-23 23:16:16.000000000 +0200
+++ netpbm-10.28/editor/ppmshadow 2005-06-10 09:37:19.253561792 +0200
@@ -72,9 +72,10 @@ sub makeConvolutionKernel($$) {
my $tmpdir = $ENV{TMPDIR} || "/tmp";
-my $ourtmp = "$tmpdir/ppmshadow$$";
-mkdir($ourtmp, 0777) or
- die("Unable to create directory for temporary files '$ourtmp");
+chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`);
+if ($? >> 8) {
+ die "Can't create directory for temporary files";
+}
# Process command line options

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
--- netpbm-10.27/converter/other/bmptopnm.c.bmptopnm 2005-05-09 10:06:05.707795976 +0200
+++ netpbm-10.27/converter/other/bmptopnm.c 2005-05-09 10:29:30.498235368 +0200
@@ -932,7 +932,7 @@ readBmp(FILE * const ifP,
xel ** const colormapP,
bool const verbose) {
- xel * colormap; /* malloc'ed */
+ xel * colormap = NULL; /* malloc'ed */
unsigned int pos;
/* The following are all information from the BMP headers */
@@ -1106,7 +1106,7 @@ main(int argc, char ** argv) {
writeRaster(BMPraster, cols, rows, outputType, cBitCount, pixelformat,
colormap);
- free(colormap);
+ if (colormap) free(colormap);
free(BMPraster);
exit(0);

View File

@ -1,20 +0,0 @@
--- netpbm-10.30/lib/pm.h.gcc4 2005-10-21 12:19:56.000000000 +0200
+++ netpbm-10.30/lib/pm.h 2005-10-21 12:20:03.000000000 +0200
@@ -18,6 +18,7 @@
#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
+#include <string.h>
#include <errno.h>
#include <setjmp.h>
#include <sys/stat.h>
--- netpbm-10.30/urt/rle.h.gcc4 2005-10-21 12:19:56.000000000 +0200
+++ netpbm-10.30/urt/rle.h 2005-10-21 12:21:31.000000000 +0200
@@ -36,6 +36,7 @@
#include "rle_config.h" /* Configuration parameters. */
#include <stdio.h> /* Declare FILE. */
+#include <string.h>
#ifdef c_plusplus
#define USE_PROTOTYPES

View File

@ -1,11 +0,0 @@
--- netpbm-10.30/Makefile.common 2005-10-08 04:36:12.000000000 +0200
+++ netpbm-10.30-fix/Makefile.common 2005-10-19 14:41:41.000000000 +0200
@@ -383,7 +383,7 @@
MANUALS1 = $(BINARIES) $(SCRIPTS)
-PKGMANDIR = man
+PKGMANDIR = share/man
install.man1: $(PKGDIR)/$(PKGMANDIR)/man1 $(MANUALS1:%=%_installman1)

View File

@ -1,21 +0,0 @@
--- netpbm-10.33/converter/other/pamtofits.c.21444 2006-05-26 15:51:05.000000000 +0200
+++ netpbm-10.33/converter/other/pamtofits.c 2006-05-26 15:51:34.000000000 +0200
@@ -58,13 +58,13 @@ writeFitsHeader(int const bitpix,
sprintf(card, "%-20.20s%10d%-50.50s", "NAXIS3 =", 3, "");
writeCard(card); ++cardsWritten;
}
- sprintf(card, "%-18.18s%E%-51.51s", "BSCALE =", bscale, "");
+ sprintf(card, "%-18.18s%E%-50.50s", "BSCALE =", bscale, "");
writeCard(card); ++cardsWritten;
- sprintf(card, "%-18.18s%E%-51.51s", "BZERO =", fitsBzero, "");
+ sprintf(card, "%-18.18s%E%-50.50s", "BZERO =", fitsBzero, "");
writeCard(card); ++cardsWritten;
- sprintf(card, "%-18.18s%E%-51.51s", "DATAMAX =", datamax, "");
+ sprintf(card, "%-18.18s%E%-50.50s", "DATAMAX =", datamax, "");
writeCard(card); ++cardsWritten;
- sprintf(card, "%-18.18s%E%-51.51s", "DATAMIN =", datamin, "");
+ sprintf(card, "%-18.18s%E%-50.50s", "DATAMIN =", datamin, "");
writeCard(card); ++cardsWritten;
sprintf(card, "%-80.80s", "HISTORY Created by pnmtofits.");
writeCard(card); ++cardsWritten;

View File

@ -1,16 +0,0 @@
diff -aur netpbm-10.73.31.old/buildtools/manpage.mk netpbm-10.73.31/buildtools/manpage.mk
--- netpbm-10.73.31.old/buildtools/manpage.mk 2020-05-28 18:41:20.400790506 +0200
+++ netpbm-10.73.31/buildtools/manpage.mk 2020-05-28 18:50:50.444143414 +0200
@@ -388,9 +388,9 @@
# This will install the generated man pages
installman:
set -x
- for f in netpbm.1 $(MAN1); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man1/$$f.gz; fi; done
- for f in $(MAN3); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man3/$$f.gz; fi; done
- for f in $(MAN5); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man5/$$f.gz; fi; done
+ for f in netpbm.1 $(MAN1); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man1/$$f.gz; fi; done
+ for f in $(MAN3); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man3/$$f.gz; fi; done
+ for f in $(MAN5); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man5/$$f.gz; fi; done
# This will uninstall them
uninstallman:

View File

@ -1,9 +1,9 @@
--- netpbm-10.29/converter/other/pstopnm.c.CAN-2005-2471 2005-08-15 02:39:46.000000000 +0200 --- netpbm-10.29/converter/other/pstopnm.c.CAN-2005-2471 2005-08-15 02:39:46.000000000 +0200
+++ netpbm-10.29/converter/other/pstopnm.c 2005-08-16 15:38:15.000000000 +0200 +++ netpbm-10.29/converter/other/pstopnm.c 2005-08-16 15:38:15.000000000 +0200
@@ -818,11 +818,11 @@ @@ -896,11 +896,11 @@
ghostscriptProg, arg0, ghostscriptProg, arg0,
deviceopt, outfileopt, gopt, ropt, textalphabitsopt, deviceopt, outfileopt, gopt, ropt, textalphabitsopt,
"-q", "-dNOPAUSE", "-q", "-dNOPAUSE",
- "-dSAFER", "-"); - "-dSAFER", "-");
+ "-dPARANOIDSAFER", "-"); + "-dPARANOIDSAFER", "-");
} }
@ -11,6 +11,6 @@
execl(ghostscriptProg, arg0, deviceopt, outfileopt, gopt, ropt, execl(ghostscriptProg, arg0, deviceopt, outfileopt, gopt, ropt,
- textalphabitsopt, "-q", "-dNOPAUSE", "-dSAFER", "-", NULL); - textalphabitsopt, "-q", "-dNOPAUSE", "-dSAFER", "-", NULL);
+ textalphabitsopt, "-q", "-dNOPAUSE", "-dPARANOIDSAFER", "-", NULL); + textalphabitsopt, "-q", "-dNOPAUSE", "-dPARANOIDSAFER", "-", NULL);
pm_error("execl() of Ghostscript ('%s') failed, errno=%d (%s)", pm_error("execl() of Ghostscript ('%s') failed, errno=%d (%s)",
ghostscriptProg, errno, strerror(errno)); ghostscriptProg, errno, strerror(errno));

View File

@ -0,0 +1,16 @@
diff -aur netpbm-10.73.31.old/buildtools/manpage.mk netpbm-10.73.31/buildtools/manpage.mk
--- netpbm-10.73.31.old/buildtools/manpage.mk 2020-05-28 18:41:20.400790506 +0200
+++ netpbm-10.73.31/buildtools/manpage.mk 2020-05-28 18:50:50.444143414 +0200
@@ -388,9 +388,9 @@
.PHONY : installman
installman: report
set -x
- for f in $(wildcard $(MAN1)); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man1/$$f.gz; fi; done
- for f in $(wildcard $(MAN3)); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man3/$$f.gz; fi; done
- for f in $(wildcard $(MAN5)); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man5/$$f.gz; fi; done
+ for f in $(wildcard $(MAN1)); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man1/$$f.gz; fi; done
+ for f in $(wildcard $(MAN3)); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man3/$$f.gz; fi; done
+ for f in $(wildcard $(MAN5)); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man5/$$f.gz; fi; done
# This will uninstall the man pages.

View File

@ -32,13 +32,13 @@ index aac7479..5f1a51a 100644
--- a/converter/other/gemtopnm.c --- a/converter/other/gemtopnm.c
+++ b/converter/other/gemtopnm.c +++ b/converter/other/gemtopnm.c
@@ -106,6 +106,7 @@ main(argc, argv) @@ -106,6 +106,7 @@ main(argc, argv)
else
pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 ); type = PPM_TYPE;
+ overflow_add(cols, padright); + overflow_add(cols, padright);
{ pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 );
/* allocate input row data structure */
int plane; {
diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c
index ab3b18e..c324b86 100644 index ab3b18e..c324b86 100644
--- a/converter/other/jpegtopnm.c --- a/converter/other/jpegtopnm.c
@ -318,21 +318,21 @@ index 2f8a42b..1c8d236 100644
--- a/converter/pbm/pbmtoppa/pbm.c --- a/converter/pbm/pbmtoppa/pbm.c
+++ b/converter/pbm/pbmtoppa/pbm.c +++ b/converter/pbm/pbmtoppa/pbm.c
@@ -106,6 +106,7 @@ int pbm_readline(pbm_stat* pbm,unsigned char* data) @@ -106,6 +106,7 @@ int pbm_readline(pbm_stat* pbm,unsigned char* data)
return 0; break;
case P4: {
int tmp, tmp2;
+ overflow_add(pbmStatP->width, 7);
tmp = (pbmStatP->width+7)/8;
tmp2 = fread(data,1,tmp,pbmStatP->fptr);
if (tmp2 == tmp) {
@@ -185,6 +186,7 @@ void pbm_unreadline (pbm_stat *pbm, void *data)
case P4: if (!pbmStatP->unread) {
+ overflow_add(pbm->width, 7); pbmStatP->unread = 1;
tmp=(pbm->width+7)/8; + overflow_add(pbmStatP->width, 7);
tmp2=fread(data,1,tmp,pbm->fptr); pbmStatP->revdata = malloc ((pbmStatP->width+7)/8);
if(tmp2 == tmp) memcpy(pbmStatP->revdata, data, (pbmStatP->width+7)/8);
@@ -130,6 +131,7 @@ void pbm_unreadline (pbm_stat *pbm, void *data) --pbmStatP->current_line;
return;
pbm->unread = 1;
+ overflow_add(pbm->width, 7);
pbm->revdata = malloc ((pbm->width+7)/8);
memcpy (pbm->revdata, data, (pbm->width+7)/8);
pbm->current_line--;
diff --git a/converter/pbm/pbmtoppa/pbmtoppa.c b/converter/pbm/pbmtoppa/pbmtoppa.c diff --git a/converter/pbm/pbmtoppa/pbmtoppa.c b/converter/pbm/pbmtoppa/pbmtoppa.c
index f43c08a..98e0284 100644 index f43c08a..98e0284 100644
--- a/converter/pbm/pbmtoppa/pbmtoppa.c --- a/converter/pbm/pbmtoppa/pbmtoppa.c
@ -491,7 +491,7 @@ index 662be0b..2a86efc 100644
@@ -1355,6 +1373,9 @@ dcol_to_ppm(FILE * const ifP, @@ -1355,6 +1373,9 @@ dcol_to_ppm(FILE * const ifP,
if( redmaxval != maxval || greenmaxval != maxval || bluemaxval != maxval ) if( redmaxval != maxval || greenmaxval != maxval || bluemaxval != maxval )
pm_message("scaling colors to %d bits", pm_maxvaltobits(maxval)); pm_message("scaling colors to %d bits", pm_maxvaltobits(maxval));
+ overflow_add(redmaxval, 1); + overflow_add(redmaxval, 1);
+ overflow_add(greenmaxval, 1); + overflow_add(greenmaxval, 1);
+ overflow_add(bluemaxval, 1); + overflow_add(bluemaxval, 1);
@ -500,14 +500,14 @@ index 662be0b..2a86efc 100644
MALLOCARRAY_NOFAIL(bluetable, bluemaxval +1); MALLOCARRAY_NOFAIL(bluetable, bluemaxval +1);
@@ -1784,7 +1805,9 @@ PCHG_ConvertSmall(PCHG, cmap, mask, datasize) @@ -1784,7 +1805,9 @@ PCHG_ConvertSmall(PCHG, cmap, mask, datasize)
ChangeCount32 = *data++; ChangeCount32 = *data++;
datasize -= 2; remDataSize -= 2;
+ overflow_add(ChangeCount16, ChangeCount32); + overflow_add(ChangeCount16, ChangeCount32);
changes = ChangeCount16 + ChangeCount32; changes = ChangeCount16 + ChangeCount32;
+ overflow_add(changes, 1); + overflow_add(changes, 1);
for( i = 0; i < changes; i++ ) { for (i = 0; i < changes; ++i) {
if( totalchanges >= PCHG->TotalChanges ) goto fail; if (totalchanges >= pchgP->TotalChanges) goto fail;
if( datasize < 2 ) goto fail; if (remDataSize < 2) goto fail;
@@ -2049,6 +2072,9 @@ read_pchg(FILE * const ifP, @@ -2049,6 +2072,9 @@ read_pchg(FILE * const ifP,
cmap->mp_change[i] = NULL; cmap->mp_change[i] = NULL;
if( PCHG.StartLine < 0 ) { if( PCHG.StartLine < 0 ) {
@ -579,51 +579,37 @@ diff --git a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c
index 7b694fb..62ce77e 100644 index 7b694fb..62ce77e 100644
--- a/converter/ppm/pjtoppm.c --- a/converter/ppm/pjtoppm.c
+++ b/converter/ppm/pjtoppm.c +++ b/converter/ppm/pjtoppm.c
@@ -127,20 +127,22 @@ main(argc, argv) @@ -127,11 +127,15 @@ main(argc, argv)
case 'V': /* send plane */ case 'V': /* send plane */
case 'W': /* send last plane */ case 'W': /* send last plane */
if (rows == -1 || r >= rows || image == NULL) { if (row >= rowsX || image == NULL) {
- if (rows == -1 || r >= rows) - if (row >= rowsX)
+ if (rows == -1 || r >= rows) { + if (row >= rowsX) {
+ overflow_add(rows, 100); + overflow_add(rowsX, 100);
rows += 100; rowsX += 100;
+ } + }
+ +
if (image == NULL) { if (image == NULL) {
- MALLOCARRAY(image, rows * planes); - MALLOCARRAY(image, uintProduct(rowsX, planes));
- MALLOCARRAY(imlen, rows * planes); - MALLOCARRAY(imlen, uintProduct(rowsX, planes));
+ image = (unsigned char **) + image = (unsigned char **)
+ malloc3(rows , planes , sizeof(unsigned char *)); + malloc3(rowsX , planes , sizeof(unsigned char *));
+ imlen = (int *) malloc3(rows , planes, sizeof(int)); + imlen = (int *) malloc3(rowsX , planes, sizeof(int));
} } else {
else { REALLOCARRAY(image, uintProduct(rowsX, planes));
- image = (unsigned char **) REALLOCARRAY(imlen, uintProduct(rowsX, planes));
- realloc(image,
- rows * planes *
- sizeof(unsigned char *));
- imlen = (int *)
- realloc(imlen, rows * planes * sizeof(int));
- }
+ overflow2(rows,planes);
+ image = (unsigned char **)
+ realloc2(image, rows * planes,
+ sizeof(unsigned char *));
+ imlen = (int *) realloc2(imlen, rows * planes, sizeof(int)); }
}
if (image == NULL || imlen == NULL)
pm_error("out of memory");
@@ -212,8 +214,10 @@ main(argc, argv) @@ -212,8 +214,10 @@ main(argc, argv)
for (i = 0, c = 0; c < imlen[p + r * planes]; c += 2) col += 2)
for (cmd = image[p + r * planes][c], for (cmd = image[plane + row * planes][col],
val = image[p + r * planes][c+1]; val = image[plane + row * planes][col+1];
- cmd >= 0 && i < newcols; cmd--, i++) - cmd >= 0 && i < newcols; cmd--, i++)
+ cmd >= 0 && i < newcols; cmd--, i++) { + cmd >= 0 && i < newcols; cmd--, i++) {
buf[i] = val; buf[i] = val;
+ overflow_add(i, 1); + overflow_add(i, 1);
+ } + }
cols = cols > i ? cols : i; cols = MAX(cols, i);
free(image[p + r * planes]); free(image[plane + row * planes]);
/* /*
@@ -224,6 +228,7 @@ main(argc, argv) @@ -224,6 +228,7 @@ main(argc, argv)
image[p + r * planes] = (unsigned char *) realloc(buf, i); image[p + r * planes] = (unsigned char *) realloc(buf, i);
} }
@ -831,9 +817,9 @@ index 6ba4cb4..fc6a498 100644
--- a/converter/ppm/sldtoppm.c --- a/converter/ppm/sldtoppm.c
+++ b/converter/ppm/sldtoppm.c +++ b/converter/ppm/sldtoppm.c
@@ -464,6 +464,8 @@ slider(slvecfn slvec, @@ -464,6 +464,8 @@ slider(slvecfn slvec,
/* Allocate image buffer and clear it to black. */ /* Allocate image buffer and clear it to black. */
+ overflow_add(ixdots, 1); + overflow_add(ixdots, 1);
+ overflow_add(iydots, 1); + overflow_add(iydots, 1);
pixels = ppm_allocarray(pixcols = ixdots + 1, pixrows = iydots + 1); pixels = ppm_allocarray(pixcols = ixdots + 1, pixrows = iydots + 1);
@ -869,13 +855,13 @@ index f49c8d9..580e5e0 100644
--- a/editor/pbmreduce.c --- a/editor/pbmreduce.c
+++ b/editor/pbmreduce.c +++ b/editor/pbmreduce.c
@@ -94,6 +94,7 @@ main( argc, argv ) @@ -94,6 +94,7 @@ main( argc, argv )
if (halftone == QT_FS) {
unsigned int col; unsigned int col;
/* Initialize Floyd-Steinberg. */
+ overflow_add(newcols, 2); + overflow_add(newcols, 2);
MALLOCARRAY(thiserr, newcols + 2); MALLOCARRAY(fsP->thiserr, newcols + 2);
MALLOCARRAY(nexterr, newcols + 2); MALLOCARRAY(fsP->nexterr, newcols + 2);
if (thiserr == NULL || nexterr == NULL)
diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c
index b357b0d..ec612d3 100644 index b357b0d..ec612d3 100644
--- a/editor/pnmgamma.c --- a/editor/pnmgamma.c
@ -939,12 +925,12 @@ index b2448cb..b924120 100644
MALLOCARRAY(fserrP->thiserr, pamP->depth); MALLOCARRAY(fserrP->thiserr, pamP->depth);
@@ -465,6 +466,7 @@ floydInitRow(struct pam * const pamP, struct fserr * const fserrP) { @@ -465,6 +466,7 @@ floydInitRow(struct pam * const pamP, struct fserr * const fserrP) {
int col; unsigned int col;
+ overflow_add(pamP->width, 2); + overflow_add(pamP->width, 2);
for (col = 0; col < pamP->width + 2; ++col) { for (col = 0; col < pamP->width + 2; ++col) {
unsigned int plane; unsigned int plane;
for (plane = 0; plane < pamP->depth; ++plane) for (plane = 0; plane < pamP->depth; ++plane)
diff --git a/editor/pnmscalefixed.c b/editor/pnmscalefixed.c diff --git a/editor/pnmscalefixed.c b/editor/pnmscalefixed.c
index 884ca31..747cd8f 100644 index 884ca31..747cd8f 100644
--- a/editor/pnmscalefixed.c --- a/editor/pnmscalefixed.c
@ -1004,42 +990,6 @@ index 6cb8d3a..6f4bde9 100644
MALLOCARRAY(hist, inpam.maxval + 1); MALLOCARRAY(hist, inpam.maxval + 1);
if (hist == NULL) if (hist == NULL)
pm_error("Unable to allocate memory for histogram."); pm_error("Unable to allocate memory for histogram.");
diff --git a/generator/pbmtext.c b/generator/pbmtext.c
index 9f4366d..445d718 100644
--- a/generator/pbmtext.c
+++ b/generator/pbmtext.c
@@ -96,12 +96,14 @@ parseCommandLine(int argc, const char ** argv,
for (i = 1; i < argc; ++i) {
if (i > 1) {
+ overflow_add(totaltextsize, 1);
totaltextsize += 1;
text = realloc(text, totaltextsize);
if (text == NULL)
pm_error("out of memory allocating space for input text");
strcat(text, " ");
- }
+ }
+ overflow_add(totaltextsize, strlen(argv[i]));
totaltextsize += strlen(argv[i]);
text = realloc(text, totaltextsize);
if (text == NULL)
@@ -712,6 +714,7 @@ getText(const char cmdline_text[],
pm_error("A line of input text is longer than %u characters."
"Cannot process.", (unsigned)sizeof(buf)-1);
if (lineCount >= maxlines) {
+ overflow2(maxlines, 2);
maxlines *= 2;
REALLOCARRAY(text_array, maxlines);
if (text_array == NULL)
@@ -832,6 +835,7 @@ main(int argc, const char *argv[]) {
hmargin = fontP->maxwidth;
} else {
vmargin = fontP->maxheight;
+ overflow2(2, fontP->maxwidth);
hmargin = 2 * fontP->maxwidth;
}
}
diff --git a/lib/libpam.c b/lib/libpam.c diff --git a/lib/libpam.c b/lib/libpam.c
index cc6368e..4e10572 100644 index cc6368e..4e10572 100644
--- a/lib/libpam.c --- a/lib/libpam.c
@ -1049,13 +999,13 @@ index cc6368e..4e10572 100644
tuple * tuplerow; tuple * tuplerow;
- tuplerow = malloc(pamP->width * (sizeof(tuple *) + bytesPerTuple)); - tuplerow = malloc(pamP->width * (sizeof(tuple *) + bytesPerTuple));
- -
+ overflow_add(sizeof(tuple *), bytesPerTuple); + overflow_add(sizeof(tuple *), bytesPerTuple);
+ tuplerow = malloc2(pamP->width, (sizeof(tuple *) + bytesPerTuple)); + tuplerow = malloc2(pamP->width, (sizeof(tuple *) + bytesPerTuple));
+ +
if (tuplerow != NULL) { if (tuplerow != NULL) {
/* Now we initialize the pointers to the individual tuples /* Now we initialize the pointers to the individual tuples
to make this a regulation C two dimensional array. to make this a regulation C two dimensional array.
diff --git a/lib/libpammap.c b/lib/libpammap.c diff --git a/lib/libpammap.c b/lib/libpammap.c
index 55e1d3f..04b1ba3 100644 index 55e1d3f..04b1ba3 100644
--- a/lib/libpammap.c --- a/lib/libpammap.c
@ -1143,7 +1093,7 @@ index e9f1405..da54391 100644
+void __overflow2(int, int); +void __overflow2(int, int);
+void overflow3(int, int, int); +void overflow3(int, int, int);
+void overflow_add(int, int); +void overflow_add(int, int);
+ +void *realloc2(void*, int, int);
#endif #endif
diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c

View File

@ -2,18 +2,6 @@ diff --git a/converter/other/anytopnm b/converter/other/anytopnm
index acf8813..335312a 100755 index acf8813..335312a 100755
--- a/converter/other/anytopnm --- a/converter/other/anytopnm
+++ b/converter/other/anytopnm +++ b/converter/other/anytopnm
@@ -511,10 +511,7 @@ else
inputFile="-"
fi
-tempdir="${TMPDIR-/tmp}/anytopnm.$$"
-mkdir -m 0700 $tempdir || \
- { echo "Could not create temporary file. Exiting."; exit 1;}
-trap 'rm -rf $tempdir' 0
+tempdir=$(mktemp -d -t anytopnm.XXXXXXXXXX) || exit 1
# Take out all spaces
# Find the filename extension for last-ditch efforts later
@@ -537,12 +534,17 @@ typeDescription=`file "$file" | cut -d: -f2- | cut -c2-` @@ -537,12 +534,17 @@ typeDescription=`file "$file" | cut -d: -f2- | cut -c2-`
determineType "$file" "$mimeType" "$typeDescription" "$fileExtension" determineType "$file" "$mimeType" "$typeDescription" "$fileExtension"
@ -35,38 +23,10 @@ index acf8813..335312a 100755
+fi +fi
+ +
exit 0 exit 0
diff --git a/editor/pamstretch-gen b/editor/pamstretch-gen
index ba0e818..250fca0 100755
--- a/editor/pamstretch-gen
+++ b/editor/pamstretch-gen
@@ -31,9 +31,7 @@ if [ "$1" = "" ]; then
exit 1
fi
-tempdir="${TMPDIR-/tmp}/pamstretch-gen.$$"
-mkdir -m 0700 $tempdir || \
- { echo "Could not create temporary file. Exiting."; exit 1;}
+tempfile=$(mktemp /tmp/pnmig.XXXXXXXXXX) || exit 1
trap 'rm -rf $tempdir' 0 1 3 15
tempfile=$tempdir/pnmig
diff --git a/editor/pnmmargin b/editor/pnmmargin diff --git a/editor/pnmmargin b/editor/pnmmargin
index 0f57d1d..e0d3625 100755 index 0f57d1d..e0d3625 100755
--- a/editor/pnmmargin --- a/editor/pnmmargin
+++ b/editor/pnmmargin +++ b/editor/pnmmargin
@@ -11,11 +11,7 @@
# documentation. This software is provided "as is" without express or
# implied warranty.
-tempdir="${TMPDIR-/tmp}/pnmmargin.$$"
-mkdir -m 0700 $tempdir || \
- { echo "Could not create temporary file. Exiting." 1>&2; exit 1;}
-trap 'rm -rf $tempdir' 0 1 3 15
-
+tempdir=$(mktemp -d -t ppmmargin.XXXXXXX) || exit 1
tmp1=$tempdir/pnmm1
tmp2=$tempdir/pnmm2
tmp3=$tempdir/pnmm3
@@ -90,6 +86,7 @@ else @@ -90,6 +86,7 @@ else
-white | -black ) -white | -black )
pnmpad $plainopt $color \ pnmpad $plainopt $color \
@ -348,22 +308,5 @@ index 027fc79..8eb094f 100755
+system("rm $tmpdir/junk*$$.ppm"); +system("rm $tmpdir/junk*$$.ppm");
exit(0); exit(0);
diff --git a/editor/ppmshadow b/editor/ppmshadow
index 62cdf8b..72e1b22 100755
--- a/editor/ppmshadow
+++ b/editor/ppmshadow
@@ -97,9 +97,10 @@ sub makeConvolutionKernel($$) {
my $tmpdir = $ENV{TMPDIR} || "/tmp";
-my $ourtmp = "$tmpdir/ppmshadow$$";
-mkdir($ourtmp, 0777) or
- die("Unable to create directory for temporary files '$ourtmp");
+my $ourtmp; chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`);
+if ($? >> 8) {
+ die "Can't create directory for temporary files";
+}
# Process command line options

View File

@ -1,5 +1,5 @@
Name: netpbm Name: netpbm
Version: 10.73.42 Version: 10.86.39
Release: 1mamba Release: 1mamba
Summary: Tools for manipulating graphics files in netpbm supported formats Summary: Tools for manipulating graphics files in netpbm supported formats
Group: Applications/Multimedia Group: Applications/Multimedia
@ -7,38 +7,29 @@ Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://netpbm.sourceforge.net/ URL: https://netpbm.sourceforge.net/
Source0: https://downloads.sourceforge.net/project/netpbm/super_stable/%{version}/netpbm-%{version}.tgz Source0: https://sourceforge.net/projects/netpbm/files/super_stable/%{version}/netpbm-%{version}.tgz
#Source: http://www12.frugalware.org/mirrors/ftp.frugalware.org/pub/other/sources/netpbm/netpbm-%{version}.tar.bz2 #Source: http://www12.frugalware.org/mirrors/ftp.frugalware.org/pub/other/sources/netpbm/netpbm-%{version}.tar.bz2
#Source: http://archlinux.c3sl.ufpr.br/other/packages/netpbm/netpbm-%{version}.tar.xz #Source: http://archlinux.c3sl.ufpr.br/other/packages/netpbm/netpbm-%{version}.tar.xz
Source1: https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz Source1: https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz
Source2: %{name}-10.51.00-config.mk Source2: %{name}-10.51.00-config.mk
Patch0: %{name}-10.15-make.patch Patch1: netpbm-10.86.39-CAN-2005-2471.patch
Patch1: %{name}-10.30-manpath.patch Patch2: netpbm-10.86.39-security-code.patch
Patch2: %{name}-10.22-security_mktemp.patch Patch3: netpbm-10.86.39-security-scripts.patch
Patch3: %{name}-10.23-security-rh.patch Patch4: netpbm-10.86.39-reproducible-man-gzip.patch
Patch4: %{name}-10.27-bmptopnm.patch
Patch5: %{name}-10.73.33-CAN-2005-2471.patch
Patch6: %{name}-10.28-gcc4.patch
Patch7: %{name}-10.20-CAN-2005-2978.patch
Patch8: %{name}-10.30-pamtofits.patch
Patch9: netpbm-10.73.38-security-code.patch
Patch10: netpbm-10.73.33-security-scripts.patch
Patch11: netpbm-10.73.33-reproducible-man-gzip.patch
License: Freeware License: Freeware
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libX11-devel
BuildRequires: libjbig-devel
BuildRequires: libjpeg-devel BuildRequires: libjpeg-devel
BuildRequires: libperl
BuildRequires: libpng-devel BuildRequires: libpng-devel
BuildRequires: libtiff-devel BuildRequires: libtiff-devel
%if "%{stage1}" != "1"
BuildRequires: libX11-devel
%endif
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: libz-devel BuildRequires: libz-devel
BuildRequires: perl-devel BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires: libnetpbm = %{?epoch:%epoch:}%{version}-%{release} Requires: libnetpbm = %{?epoch:%epoch:}%{version}-%{release}
## AUTOBUILDREQ-END
%description %description
Netpbm is a toolkit for manipulation of graphic images, including conversion of images between a variety of different formats. Netpbm is a toolkit for manipulation of graphic images, including conversion of images between a variety of different formats.
@ -92,10 +83,10 @@ This package contains static libraries and header files need for development.
#-D -T #-D -T
#:<< _EOF #:<< _EOF
%define _default_patch_fuzz 2 %define _default_patch_fuzz 2
%patch5 -p1 %patch 1 -p1
%patch9 -p1 %patch 2 -p1
%patch10 -p1 %patch 3 -p1
%patch11 -p1 %patch 4 -p1
cp config.mk.in config.mk cp config.mk.in config.mk
@ -105,9 +96,9 @@ cp config.mk.in config.mk
#sed -i "s|X11LIB =.*|X11LIB = NONE|" config.mk #sed -i "s|X11LIB =.*|X11LIB = NONE|" config.mk
#%endif #%endif
#%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
echo 'CFLAGS_SHLIB = -fPIC' >> config.mk echo 'CFLAGS_SHLIB = -fPIC' >> config.mk
#%endif %endif
echo "NETPBM_DOCURL = file://${PWD}/doc" >> config.mk echo "NETPBM_DOCURL = file://${PWD}/doc" >> config.mk
echo 'TIFFLIB = libtiff.so' >> config.mk echo 'TIFFLIB = libtiff.so' >> config.mk
echo 'JPEGLIB = libjpeg.so' >> config.mk echo 'JPEGLIB = libjpeg.so' >> config.mk
@ -132,7 +123,7 @@ sed -i 's|install.manwebmain install.manweb install.man|install.man|' GNUmakefil
make pkgdir=%{buildroot}%{_prefix} PKGMANDIR=share/man install-run install-dev make pkgdir=%{buildroot}%{_prefix} PKGMANDIR=share/man install-run install-dev
# Removing dummy man pages # Removing dummy man pages
rm %{buildroot}%{_mandir}/man{1,3,5}/* #rm %{buildroot}%{_mandir}/man{1,3,5}/*
#make MAKEMAN=${PWD}/buildtools/makeman MANDIR=%{buildroot}%{_mandir} \ #make MAKEMAN=${PWD}/buildtools/makeman MANDIR=%{buildroot}%{_mandir} \
# -C doc -f ${PWD}/buildtools/manpage.mk installman # -C doc -f ${PWD}/buildtools/manpage.mk installman
@ -140,12 +131,17 @@ rm %{buildroot}%{_mandir}/man{1,3,5}/*
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
mv %{buildroot}%{_prefix}/lib %{buildroot}%{_libdir} mv %{buildroot}%{_prefix}/lib %{buildroot}%{_libdir}
rm -f %{buildroot}%{_libdir}/libnetpbm.so rm -f %{buildroot}%{_libdir}/libnetpbm.so
ln -s libnetpbm.so.11 %{buildroot}%{_libdir}/libnetpbm.so
%endif %endif
ln -s libnetpbm.so.11 %{buildroot}%{_libdir}/libnetpbm.so
# Replace obsolete utility # Replace obsolete utility
echo -e '#!/bin/sh\npamditherbw $@ | pamtopnm\n' > %{buildroot}%{_bindir}/pgmtopbm echo -e '#!/bin/sh\npamditherbw $@ | pamtopnm\n' > %{buildroot}%{_bindir}/pgmtopbm
# FIXME: unexpected dirs, removing
rm -f %{buildroot}%{_datadir}dlink/libnetpbm.so
rm -f %{buildroot}/usr/staticlink/libnetpbm.a
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -166,14 +162,18 @@ echo -e '#!/bin/sh\npamditherbw $@ | pamtopnm\n' > %{buildroot}%{_bindir}/pgmtop
%files -n libnetpbm-devel %files -n libnetpbm-devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_includedir}/* %dir %{_includedir}/netpbm
%{_libdir}/libnetpbm.a %{_includedir}/netpbm/*
#%{_libdir}/libnetpbm.a
%{_libdir}/libnetpbm.so %{_libdir}/libnetpbm.so
#%{_mandir}/man3/* #%{_mandir}/man3/*
%doc README doc/{HISTORY,USERDOC} %doc README doc/{HISTORY,USERDOC}
#%doc netpbm.sourceforge.net #%doc netpbm.sourceforge.net
%changelog %changelog
* Tue Dec 12 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 10.86.39-1mamba
- update to 10.86.39
* Sun Jan 01 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 10.73.42-1mamba * Sun Jan 01 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 10.73.42-1mamba
- update to 10.73.42 - update to 10.73.42