diff options
author | ache <ache@FreeBSD.org> | 2003-06-14 12:41:50 +0800 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2003-06-14 12:41:50 +0800 |
commit | a30d5cd527641ce003492e26262ab14704490dc9 (patch) | |
tree | e442a81a4b9fb436c882ab37a57a78f1d90c24a7 | |
parent | e5ea5491614cf5d509ca7137df930993eb94cd80 (diff) | |
download | freebsd-ports-gnome-a30d5cd527641ce003492e26262ab14704490dc9.tar.gz freebsd-ports-gnome-a30d5cd527641ce003492e26262ab14704490dc9.tar.zst freebsd-ports-gnome-a30d5cd527641ce003492e26262ab14704490dc9.zip |
Yet another overflow check, better temp file name & misc cleanups
Submitted by: kris & Debian (edited by me)
-rw-r--r-- | converters/mpack/Makefile | 2 | ||||
-rw-r--r-- | converters/mpack/files/patch-aa | 98 | ||||
-rw-r--r-- | converters/mpack/files/patch-ac | 35 | ||||
-rw-r--r-- | converters/mpack/files/patch-ae | 46 | ||||
-rw-r--r-- | converters/mpack/files/patch-codes_c | 14 | ||||
-rw-r--r-- | converters/mpack/files/patch-decode_c | 64 | ||||
-rw-r--r-- | converters/mpack/files/patch-magic_c | 11 | ||||
-rw-r--r-- | converters/mpack/files/patch-unixpk_c | 12 | ||||
-rw-r--r-- | converters/mpack/files/patch-unixunpk_c | 12 |
9 files changed, 157 insertions, 137 deletions
diff --git a/converters/mpack/Makefile b/converters/mpack/Makefile index 0031a84b1e58..2d02ba2a7fbd 100644 --- a/converters/mpack/Makefile +++ b/converters/mpack/Makefile @@ -7,7 +7,7 @@ PORTNAME= mpack PORTVERSION= 1.5 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= converters mail news MASTER_SITES= ftp://ftp.andrew.cmu.edu/pub/mpack/ DISTNAME= ${PORTNAME}-${PORTVERSION}-src diff --git a/converters/mpack/files/patch-aa b/converters/mpack/files/patch-aa index a71a359dc72f..eca638fd34b9 100644 --- a/converters/mpack/files/patch-aa +++ b/converters/mpack/files/patch-aa @@ -1,55 +1,43 @@ -*** Makefile.orig Thu Feb 16 15:39:41 1995 ---- Makefile Sat May 15 19:18:04 1999 -*************** -*** 1,5 **** -! CFLAGS=$(OPT) $(DEFINES) -! OPT=-O - - - #Uncomment the following line if your system does not have strchr() ---- 1,5 ---- -! CFLAGS+=$(OPT) $(DEFINES) -! #OPT=-O - - - #Uncomment the following line if your system does not have strchr() -*************** -*** 28,34 **** - UNPACKOBJS = unixunpk.o decode.o uudecode.o codes.o unixos.o string.o \ - part.o xmalloc.o md5c.o getopt.o - -! DESTDIR=/usr/local - - all: mpack munpack - ---- 28,34 ---- - UNPACKOBJS = unixunpk.o decode.o uudecode.o codes.o unixos.o string.o \ - part.o xmalloc.o md5c.o getopt.o - -! DESTDIR?=/usr/local - - all: mpack munpack - -*************** -*** 42,51 **** - -mkdir $(DESTDIR)/bin - -mkdir $(DESTDIR)/man - -mkdir $(DESTDIR)/man/man1 -! install -s -m 755 mpack $(DESTDIR)/bin -! install -s -m 755 munpack $(DESTDIR)/bin -! install -m 644 unixpk.man $(DESTDIR)/man/man1/mpack.1 -! install -m 644 unixunpk.man $(DESTDIR)/man/man1/munpack.1 - - clean: - rm -f *.o mpack munpack ---- 42,51 ---- - -mkdir $(DESTDIR)/bin - -mkdir $(DESTDIR)/man - -mkdir $(DESTDIR)/man/man1 -! install -c -s -m 755 mpack $(DESTDIR)/bin -! install -c -s -m 755 munpack $(DESTDIR)/bin -! install -c -m 644 unixpk.man $(DESTDIR)/man/man1/mpack.1 -! install -c -m 644 unixunpk.man $(DESTDIR)/man/man1/munpack.1 - - clean: - rm -f *.o mpack munpack +--- Makefile.orig Thu Feb 16 13:39:41 1995 ++++ Makefile Fri Jun 13 14:45:29 2003 +@@ -1,5 +1,5 @@ +-CFLAGS=$(OPT) $(DEFINES) +-OPT=-O ++#CFLAGS=$(OPT) $(DEFINES) ++#OPT=-O + + + #Uncomment the following line if your system does not have strchr() +@@ -22,13 +22,14 @@ + #Uncomment the following lines on SVR4 + #LIBS=-lsocket -lnsl + ++LIBS=-lmd + + PACKOBJS = unixpk.o encode.o codes.o magic.o unixos.o string.o \ +- xmalloc.o md5c.o getopt.o ++ xmalloc.o + UNPACKOBJS = unixunpk.o decode.o uudecode.o codes.o unixos.o string.o \ +- part.o xmalloc.o md5c.o getopt.o ++ part.o xmalloc.o + +-DESTDIR=/usr/local ++DESTDIR?=/usr/local + + all: mpack munpack + +@@ -42,10 +43,10 @@ + -mkdir $(DESTDIR)/bin + -mkdir $(DESTDIR)/man + -mkdir $(DESTDIR)/man/man1 +- install -s -m 755 mpack $(DESTDIR)/bin +- install -s -m 755 munpack $(DESTDIR)/bin +- install -m 644 unixpk.man $(DESTDIR)/man/man1/mpack.1 +- install -m 644 unixunpk.man $(DESTDIR)/man/man1/munpack.1 ++ install -c -s -m 755 mpack $(DESTDIR)/bin ++ install -c -s -m 755 munpack $(DESTDIR)/bin ++ install -c -m 644 unixpk.man $(DESTDIR)/man/man1/mpack.1 ++ install -c -m 644 unixunpk.man $(DESTDIR)/man/man1/munpack.1 + + clean: + rm -f *.o mpack munpack diff --git a/converters/mpack/files/patch-ac b/converters/mpack/files/patch-ac deleted file mode 100644 index afc0f317b995..000000000000 --- a/converters/mpack/files/patch-ac +++ /dev/null @@ -1,35 +0,0 @@ -diff -ruN mpack-1.5/decode.c mpack/decode.c ---- decode.c Fri Feb 17 08:39:44 1995 -+++ decode.c Thu Nov 1 10:40:23 2001 -@@ -467,6 +467,7 @@ - if (!--left) { - alloced += VALUEGROWSIZE; - value = xrealloc(value, alloced); -+ left = VALUEGROWSIZE; - to = value + alloced - left - 2; - } - if (*from == '\\') { -@@ -483,6 +484,7 @@ - if (!--left) { - alloced += VALUEGROWSIZE; - value = xrealloc(value, alloced); -+ left = VALUEGROWSIZE; - to = value + alloced - left - 2; - } - *to++ = *from++; -@@ -572,6 +574,7 @@ - if (!--left) { - alloced += VALUEGROWSIZE; - value = xrealloc(value, alloced); -+ left = VALUEGROWSIZE; - to = value + alloced - left - 2; - } - if (*disposition == '\\') { -@@ -589,6 +592,7 @@ - if (!--left) { - alloced += VALUEGROWSIZE; - value = xrealloc(value, alloced); -+ left = VALUEGROWSIZE; - to = value + alloced - left - 2; - } - *to++ = *disposition++; diff --git a/converters/mpack/files/patch-ae b/converters/mpack/files/patch-ae deleted file mode 100644 index 7f156b4361a5..000000000000 --- a/converters/mpack/files/patch-ae +++ /dev/null @@ -1,46 +0,0 @@ ---- unixos.c.orig Fri Feb 17 00:39:50 1995 -+++ unixos.c Wed Aug 28 19:56:07 2002 -@@ -80,7 +80,7 @@ - - /* Create and return directory for a message-id */ - char *os_idtodir(id) --char *id; -+unsigned char *id; - { - static char buf[4096]; - char *p; -@@ -89,7 +89,11 @@ - strcpy(buf, getenv("TMPDIR")); - } - else { -+#ifdef __FreeBSD__ -+ strcpy(buf, "/var/tmp"); -+#else - strcpy(buf, "/usr/tmp"); -+#endif - } - strcat(buf, "/m-prts-"); - p = getenv("USER"); -@@ -144,7 +148,7 @@ - int flags; - params contentParams; - { -- char *p; -+ unsigned char *p; - static int filesuffix=0; - char buf[128], *descfname=0; - FILE *outfile = 0; -@@ -160,6 +164,13 @@ - /* Get rid of leading ~ or ~/ */ - while (*fname == '~' || *fname == '/') fname++; - -+ for (p=fname; *p; p += 3) { -+ if (!strncmp(p, "../", 3)) { -+ p[0] = p[1] = 'X'; -+ } else -+ break; -+ } -+ - /* Clean out bad characters, create directories along path */ - for (p=fname; *p; p++) { - if (*p == '/') { diff --git a/converters/mpack/files/patch-codes_c b/converters/mpack/files/patch-codes_c new file mode 100644 index 000000000000..fe70e2927934 --- /dev/null +++ b/converters/mpack/files/patch-codes_c @@ -0,0 +1,14 @@ +$OpenBSD: patch-codes_c,v 1.1 2002/08/09 01:15:19 naddy Exp $ +--- codes.c.orig Fri Aug 9 02:55:28 2002 ++++ codes.c Fri Aug 9 02:56:20 2002 +@@ -38,8 +38,9 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE + #include <stdio.h> + #include <string.h> + #include <ctype.h> ++#include <sys/types.h> ++#include <md5.h> + #include "xmalloc.h" +-#include "md5.h" + + static char basis_64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/converters/mpack/files/patch-decode_c b/converters/mpack/files/patch-decode_c new file mode 100644 index 000000000000..caaef4c709c6 --- /dev/null +++ b/converters/mpack/files/patch-decode_c @@ -0,0 +1,64 @@ +$OpenBSD: patch-decode_c,v 1.1 2002/08/09 01:15:19 naddy Exp $ +--- decode.c.orig Thu Feb 16 22:39:44 1995 ++++ decode.c Fri Aug 9 03:03:32 2002 +@@ -28,10 +28,11 @@ + #include <stdio.h> + #include <string.h> + #include <ctype.h> ++#include <sys/types.h> ++#include <md5.h> + #include "xmalloc.h" + #include "common.h" + #include "part.h" +-#include "md5.h" + + extern char *os_idtodir(); + extern FILE *os_newtypedfile(); +@@ -416,6 +416,15 @@ char **headerp; + } + if (*header) *header++ = '\0'; + } ++ ++ /* ++ * Debian fix: if there was only an empty parameter list (a bare ++ * semicolon) then there is no guarantee that param[nparam] exists. ++ * Therefore, treat it as if there is no parameter list. ++ */ ++ if (nparam == 0) ++ return 0; ++ + param[nparam] = 0; + return param; + } +@@ -466,6 +475,7 @@ char *key; + while (*from && *from != '\"') { + if (!--left) { + alloced += VALUEGROWSIZE; ++ left += VALUEGROWSIZE; + value = xrealloc(value, alloced); + to = value + alloced - left - 2; + } +@@ -482,6 +492,7 @@ char *key; + while (*from && !isspace(*from)) { + if (!--left) { + alloced += VALUEGROWSIZE; ++ left += VALUEGROWSIZE; + value = xrealloc(value, alloced); + to = value + alloced - left - 2; + } +@@ -571,6 +582,7 @@ char *disposition; + while (*disposition && *disposition != '\"') { + if (!--left) { + alloced += VALUEGROWSIZE; ++ left += VALUEGROWSIZE; + value = xrealloc(value, alloced); + to = value + alloced - left - 2; + } +@@ -588,6 +600,7 @@ char *disposition; + *disposition != '(') { + if (!--left) { + alloced += VALUEGROWSIZE; ++ left += VALUEGROWSIZE; + value = xrealloc(value, alloced); + to = value + alloced - left - 2; + } diff --git a/converters/mpack/files/patch-magic_c b/converters/mpack/files/patch-magic_c new file mode 100644 index 000000000000..100f1e2f1565 --- /dev/null +++ b/converters/mpack/files/patch-magic_c @@ -0,0 +1,11 @@ +$OpenBSD: patch-magic_c,v 1.1 2002/08/09 01:15:19 naddy Exp $ +--- magic.c.orig Fri Aug 9 02:36:58 2002 ++++ magic.c Fri Aug 9 02:37:21 2002 +@@ -23,6 +23,7 @@ + * SOFTWARE. + */ + #include <stdio.h> ++#include <string.h> + + /* Description of the various file formats and their magic numbers */ + struct magic { diff --git a/converters/mpack/files/patch-unixpk_c b/converters/mpack/files/patch-unixpk_c new file mode 100644 index 000000000000..5aeee88f91ca --- /dev/null +++ b/converters/mpack/files/patch-unixpk_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-unixpk_c,v 1.1 2002/08/09 01:15:19 naddy Exp $ +--- unixpk.c.orig Thu Feb 16 22:39:50 1995 ++++ unixpk.c Mon Aug 5 12:30:30 2002 +@@ -165,7 +165,7 @@ char **argv; + strcpy(fnamebuf, "/tmp"); + } + strcat(fnamebuf, "/mpackXXXXXX"); +- mktemp(fnamebuf); ++ close(mkstemp(fnamebuf)); + outfname = strsave(fnamebuf); + } + diff --git a/converters/mpack/files/patch-unixunpk_c b/converters/mpack/files/patch-unixunpk_c new file mode 100644 index 000000000000..7f8d43170cd4 --- /dev/null +++ b/converters/mpack/files/patch-unixunpk_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-unixunpk_c,v 1.1 2002/08/09 01:15:19 naddy Exp $ +--- unixunpk.c.orig Fri Aug 9 02:44:18 2002 ++++ unixunpk.c Fri Aug 9 02:44:38 2002 +@@ -100,7 +100,7 @@ char **argv; + + usage() { + fprintf(stderr, "munpack version %s\n", MPACK_VERSION); +- fprintf(stderr, "usage: munpack [-f] [-q] [-C directory] [files...]\n"); ++ fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-C directory] [files...]\n"); + exit(1); + } + |