* Apply security patch from

http://www.securityfocus.com/archive/1/354362/2004-02-15/2004-02-21/2
* Bump PKGREVISION to 2.
* Make patches only modify one file each
* Fix some spelling errors
* Use ${SED} instead of sed, and ${CHMOD} instead of chmod
* Set CFLAGS.SunOS instead of doing the bsd.prefs.mk dance
This commit is contained in:
snj 2004-02-25 03:58:42 +00:00
parent d946e7a73b
commit 59c727af64
15 changed files with 452 additions and 421 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.24 2004/01/20 12:19:43 agc Exp $
# $NetBSD: Makefile,v 1.25 2004/02/25 03:58:42 snj Exp $
DISTNAME= mm2.7
PKGNAME= metamail-2.7
PKGREVISION= 1
PKGREVISION= 2
CATEGORIES= mail
MASTER_SITES= ftp://thumper.bellcore.com/pub/nsb/
EXTRACT_SUFX= .tar.Z
@ -20,18 +20,19 @@ USE_PKGINSTALL= YES
USE_X11= YES
CFLAGS+= -DPKG_SYSCONFDIR='\\\"${PKG_SYSCONFDIR}\\\"'
MAKE_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
CFLAGS.SunOS+= -DSYSV
MAKE_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR} CHMOD=${CHMOD} SED=${SED}
EGDIR= ${PREFIX}/share/examples/metamail
CONF_FILES= ${EGDIR}/mailcap ${PKG_SYSCONFDIR}/mailcap
INSTALLATION_DIRS= bin man/man1 man/man4
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "SunOS"
CFLAGS+= -DSYSV
.endif
SUBST_CLASSES+= awk
SUBST_STAGE.awk= post-patch
SUBST_MESSAGE.awk= Adjusting the path to awk
SUBST_FILES.awk= bin/sun2mime
SUBST_SED.awk= -e "s|/bin/nawk|${AWK}|"
post-patch:
${RM} -f ${WRKDIR}/mm2.7/src/bin/*.orig

View file

@ -1,12 +1,18 @@
$NetBSD: distinfo,v 1.6 2003/11/04 19:03:53 dmcmahill Exp $
$NetBSD: distinfo,v 1.7 2004/02/25 03:58:42 snj Exp $
SHA1 (mm2.7.tar.Z) = 8f213baec9b17c05bcb066f616977a561757d7a6
Size (mm2.7.tar.Z) = 262881 bytes
SHA1 (patch-aa) = 5b03f920e11554af5f776ff352c85c06e2f8f8de
SHA1 (patch-ab) = 7cd0a70de63ba86172b5628bb082fb46100262b9
SHA1 (patch-ac) = c2e0c044df30c3cc33c7f3ff2c620cd29816e1d6
SHA1 (patch-ad) = a46353a5f6677f2388c50471eaee7cdff9f697d9
SHA1 (patch-ae) = 1b8f88c25eb3b8e4a89e0c94b49f35ba0d809aa8
SHA1 (patch-af) = 2bba73c3a2b11b0234b197e0e2236b17c60d5acb
SHA1 (patch-ag) = d7dcd95194fad57b2863d165af427dd0d2b49bd5
SHA1 (patch-ah) = 82d98f16b0c2d3a8448461b971d44dc352cd2921
SHA1 (patch-ad) = f5b8a3e04da86fb875ffe34b3f4cba5c7b4e4d94
SHA1 (patch-ae) = 15bd1530e763c8c6371a0fa8dff45cdd39916295
SHA1 (patch-af) = 9ba42f1eef27d452debb9c1e0abc800f19deccac
SHA1 (patch-ag) = 674ceb59955de76e9a673ee4969d359a30fba5f8
SHA1 (patch-ah) = 0be03011df91c66f12836ce64eb37983f129e4c5
SHA1 (patch-ai) = 4e85922573dc0ae2017c112198f1f23c2b08f729
SHA1 (patch-aj) = 7384564119a360189c68bdc5ce0ba3648a44769c
SHA1 (patch-ak) = fcf331b9d28243cb403fd0dc34a365eb147f3da4
SHA1 (patch-al) = c63427174a5d80c62b207212e0d855457939d0bc
SHA1 (patch-am) = d5d2cc002173da827fb452a91ccd906452420bfc
SHA1 (patch-an) = 56c228106dc663623cb31ecf4eeba1fc5c27d045
SHA1 (patch-ao) = 90566d47642fe8ee71295ea47f3cf7420d0b2880

View file

@ -1,21 +0,0 @@
$NetBSD: patch-ac,v 1.2 1998/08/07 11:09:40 agc Exp $
*** bin/sun2mime.ORIG Sat Nov 13 15:53:51 1993
--- bin/sun2mime Mon Dec 12 10:07:44 1994
***************
*** 11,17 ****
fi
TMPFILE=${METAMAIL_TMPDIR}/suntomime.$$
! /bin/nawk '
BEGIN { printf("Content-type: multipart/mixed; boundary=--------\n\n")
RS=""; FS="\n"; mode="HEADER" }
mode == "HEADER" {
--- 11,17 ----
fi
TMPFILE=${METAMAIL_TMPDIR}/suntomime.$$
! /usr/bin/awk '
BEGIN { printf("Content-type: multipart/mixed; boundary=--------\n\n")
RS=""; FS="\n"; mode="HEADER" }
mode == "HEADER" {

View file

@ -1,37 +1,27 @@
$NetBSD: patch-ad,v 1.3 2003/11/04 19:03:53 dmcmahill Exp $
$NetBSD: patch-ad,v 1.4 2004/02/25 03:58:42 snj Exp $
*** fonts/Makefile.orig Mon May 31 22:49:27 1993
--- fonts/Makefile Thu May 18 21:55:42 1995
***************
*** 28,39 ****
-${DIRBUILDER}
shownonascii: Xshownonascii
! sed -e s@/u/nsb/lib/fonts@`pwd`@ < Xshownonascii > shownonascii
chmod +x shownonascii
mailto-hebrew: Xmailto-hebrew
! sed -e s@/u/nsb/lib/fonts@`pwd`@ < Xmailto-hebrew > mailto-hebrew
chmod +x mailto-hebrew
clean:
rm -f heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} heb8x13B.${FONTSUFFIX} shownonascii mailto-hebrew fonts.dir
--- 28,45 ----
-${DIRBUILDER}
shownonascii: Xshownonascii
! sed -e s@/u/nsb/lib/fonts@${PREFIX}/lib/metamail/fonts@ < Xshownonascii > shownonascii
chmod +x shownonascii
mailto-hebrew: Xmailto-hebrew
! sed -e s@/u/nsb/lib/fonts@${PREFIX}/lib/metamail/fonts@ < Xmailto-hebrew > mailto-hebrew
chmod +x mailto-hebrew
+
+ install:
+ mkdir -p ${PREFIX}/lib/metamail/fonts
+ ${INSTALL} -c heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} \
+ heb8x13B.${FONTSUFFIX} fonts.alias ${PREFIX}/lib/metamail/fonts
+ mkfontdir ${PREFIX}/lib/metamail/fonts
clean:
rm -f heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} heb8x13B.${FONTSUFFIX} shownonascii mailto-hebrew fonts.dir
--- fonts/Makefile.orig 1993-05-31 13:49:27.000000000 -0700
+++ fonts/Makefile 2004-02-24 19:19:01.000000000 -0800
@@ -28,12 +28,18 @@ heb8x13B.${FONTSUFFIX}: heb8x13B.bdf
-${DIRBUILDER}
shownonascii: Xshownonascii
- sed -e s@/u/nsb/lib/fonts@`pwd`@ < Xshownonascii > shownonascii
- chmod +x shownonascii
+ ${SED} -e s@/u/nsb/lib/fonts@${PREFIX}/lib/metamail/fonts@ < Xshownonascii > shownonascii
+ ${CHMOD} +x shownonascii
mailto-hebrew: Xmailto-hebrew
- sed -e s@/u/nsb/lib/fonts@`pwd`@ < Xmailto-hebrew > mailto-hebrew
- chmod +x mailto-hebrew
+ ${SED} -e s@/u/nsb/lib/fonts@${PREFIX}/lib/metamail/fonts@ < Xmailto-hebrew > mailto-hebrew
+ ${CHMOD} +x mailto-hebrew
+
+install:
+ mkdir -p ${PREFIX}/lib/metamail/fonts
+ ${INSTALL} -c heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} \
+ heb8x13B.${FONTSUFFIX} fonts.alias ${PREFIX}/lib/metamail/fonts
+ mkfontdir ${PREFIX}/lib/metamail/fonts
clean:
rm -f heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} heb8x13B.${FONTSUFFIX} shownonascii mailto-hebrew fonts.dir

View file

@ -1,23 +1,25 @@
$NetBSD: patch-ae,v 1.2 1998/08/07 11:09:41 agc Exp $
$NetBSD: patch-ae,v 1.3 2004/02/25 03:58:43 snj Exp $
*** metamail/splitmail.c.orig Sun Jun 18 13:13:56 1995
--- metamail/splitmail.c Sun Jun 18 13:14:48 1995
***************
*** 41,48 ****
#define VERBOSEDELIVERYCMD VerboseDeliveryCmd
#else
extern char *getenv();
! #define NORMALDELIVERYCMD "/usr/lib/sendmail -t -oi"
! #define VERBOSEDELIVERYCMD "/usr/lib/sendmail -t -v -oi"
#endif
usageexit() {
--- 41,48 ----
#define VERBOSEDELIVERYCMD VerboseDeliveryCmd
#else
extern char *getenv();
! #define NORMALDELIVERYCMD "/usr/sbin/sendmail -t -oi"
! #define VERBOSEDELIVERYCMD "/usr/sbin/sendmail -t -v -oi"
#endif
usageexit() {
--- metamail/splitmail.c.orig 1994-01-31 14:23:14.000000000 -0800
+++ metamail/splitmail.c 2004-02-24 10:49:02.000000000 -0800
@@ -41,8 +41,8 @@ extern char *malloc(), *index(), *getmyn
#define VERBOSEDELIVERYCMD VerboseDeliveryCmd
#else
extern char *getenv();
-#define NORMALDELIVERYCMD "/usr/lib/sendmail -t -oi"
-#define VERBOSEDELIVERYCMD "/usr/lib/sendmail -t -v -oi"
+#define NORMALDELIVERYCMD "/usr/sbin/sendmail -t -oi"
+#define VERBOSEDELIVERYCMD "/usr/sbin/sendmail -t -v -oi"
#endif
usageexit() {
@@ -361,7 +361,8 @@ char **OrigID;
}
if (!ULstrcmp(s, "subject")) {
*colon = ':';
- strcpy(SubjectBuf, ++colon);
+ strncpy(SubjectBuf, ++colon, sizeof(SubjectBuf));
+ SubjectBuf[sizeof(SubjectBuf) - 1] = '\0';
return(0);
}
if (!ULstrcmp(s, "content-type")) {

View file

@ -1,131 +1,54 @@
$NetBSD: patch-af,v 1.2 1998/08/07 11:09:41 agc Exp $
$NetBSD: patch-af,v 1.3 2004/02/25 03:58:43 snj Exp $
*** mailto.c.orig Wed Feb 9 23:30:26 1994
--- metamail/mailto.c Mon Nov 20 01:21:37 1995
***************
*** 570,575 ****
--- 570,576 ----
if (isupper(*sdum)) *sdum = tolower(*sdum);
}
if (strcmp(CharacterSet, "us-ascii")
+ && strcmp(CharacterSet, "koi8-r")
&& strncmp(CharacterSet, "iso-8859-", 9)) {
fprintf(stderr, "mailto: Unsupported character set: %s\n", CharacterSet);
exit(-1);
***************
*** 1130,1135 ****
--- 1131,1137 ----
if (part->isrich) {
if (strcmp(CharacterSet, "us-ascii")
&& (strncmp(CharacterSet, "iso-8859-", 9)
+ && strcmp(CharacterSet, "koi8-r")
|| part->encoding_type_needed != ENC_NONE)) {
fprintf(fp, "Content-type: text/richtext; charset=\"%s\"\n", CharacterSet);
} else {
***************
*** 1140,1145 ****
--- 1142,1148 ----
WriteCtypeNicely(fp, part->content_type);
if (strcmp(CharacterSet, "us-ascii")
&& (strncmp(CharacterSet, "iso-8859-", 9)
+ && strcmp(CharacterSet, "koi8-r")
|| part->encoding_type_needed != ENC_NONE)) {
fprintf(fp, "; charset=\"%s\"\n", CharacterSet);
} else fputs("\n", fp);
***************
*** 1745,1750 ****
--- 1748,1754 ----
}
printf("\n\nEnter your choice as a number from 0 to %d: ", i);
fflush(stdout);
+ *LineBuf = '\0';
fgets(LineBuf, sizeof(LineBuf), stdin);
ans = atoi(LineBuf);
if (ans == 0 || ans == 1) {
***************
*** 1791,1797 ****
int ct;
printf("\nEnter the MIME Content-type value for the data from file %s\n (type '?' for a list of locally-valid content-types): ", sdum);
fflush(stdout);
! gets(LineBuf);
if (index(LineBuf, '/')) {
char lc[100], *s, AnsBuf[100];
strcpy(lc, LineBuf);
--- 1795,1801 ----
int ct;
printf("\nEnter the MIME Content-type value for the data from file %s\n (type '?' for a list of locally-valid content-types): ", sdum);
fflush(stdout);
! fgets(LineBuf, sizeof(LineBuf), stdin);
if (index(LineBuf, '/')) {
char lc[100], *s, AnsBuf[100];
strcpy(lc, LineBuf);
***************
*** 1809,1815 ****
}
if (mc) break;
printf("The MIME content-type '%s' is not listed in your local mailcap files,\nand may not be a valid MIME type. Do you want to use it anyway [no] ? ", LineBuf);
! s = gets(AnsBuf);
while (s && *s && isspace((unsigned char) *s)) ++s;
if (s && (*s == 'y' || *s == 'Y')) break;
continue;
--- 1813,1819 ----
}
if (mc) break;
printf("The MIME content-type '%s' is not listed in your local mailcap files,\nand may not be a valid MIME type. Do you want to use it anyway [no] ? ", LineBuf);
! s = fgets(AnsBuf, sizeof(AnsBuf), stdin);
while (s && *s && isspace((unsigned char) *s)) ++s;
if (s && (*s == 'y' || *s == 'Y')) break;
continue;
*** metamail.c.bak Thu Feb 17 04:57:19 1994
--- metamail/metamail.c Mon Nov 20 01:21:37 1995
***************
*** 83,89 ****
#define MAX_FILE_NAME_SIZE 256
#define WRITE_BINARY "w"
#else /* AMIGA */
! extern char **environ, *gets();
#define CATCOMMAND "cat"
#define CATTEMPLATE "cat %s"
#define METAMAIL "metamail"
--- 83,89 ----
#define MAX_FILE_NAME_SIZE 256
#define WRITE_BINARY "w"
#else /* AMIGA */
! extern char **environ;
#define CATCOMMAND "cat"
#define CATTEMPLATE "cat %s"
#define METAMAIL "metamail"
***************
*** 579,585 ****
int overwriteans = -1;
do {
printf("File %s exists. Do you want to overwrite it (y/n) ?\n", Fname);
! s = gets(AnsBuf);
if (!s) {
overwriteans = 0;
} else {
--- 579,585 ----
int overwriteans = -1;
do {
printf("File %s exists. Do you want to overwrite it (y/n) ?\n", Fname);
! s = fgets(AnsBuf, sizeof(AnsBuf), stdin);
if (!s) {
overwriteans = 0;
} else {
***************
*** 1823,1829 ****
} else {
printf("This message contains '%s'-format data.\nDo you want to view it using the '%s' command (y/n) [y] ? ", ctype, ShortCommand(progname));
}
! s = gets(AnsBuf);
if (!s) return(0); /* EOF */
while (s && *s && isspace((unsigned char) *s)) ++s;
if (*s == 'y' || *s == 'Y' || !*s || *s == '\n') return(1);
--- 1823,1829 ----
} else {
printf("This message contains '%s'-format data.\nDo you want to view it using the '%s' command (y/n) [y] ? ", ctype, ShortCommand(progname));
}
! s = fgets(AnsBuf, sizeof(AnsBuf), stdin);
if (!s) return(0); /* EOF */
while (s && *s && isspace((unsigned char) *s)) ++s;
if (*s == 'y' || *s == 'Y' || !*s || *s == '\n') return(1);
--- metamail/mailto.c.orig 1994-02-09 12:30:26.000000000 -0800
+++ metamail/mailto.c 2004-02-24 10:13:44.000000000 -0800
@@ -570,6 +570,7 @@ char **argv;
if (isupper(*sdum)) *sdum = tolower(*sdum);
}
if (strcmp(CharacterSet, "us-ascii")
+ && strcmp(CharacterSet, "koi8-r")
&& strncmp(CharacterSet, "iso-8859-", 9)) {
fprintf(stderr, "mailto: Unsupported character set: %s\n", CharacterSet);
exit(-1);
@@ -1130,6 +1131,7 @@ struct mailpart *part;
if (part->isrich) {
if (strcmp(CharacterSet, "us-ascii")
&& (strncmp(CharacterSet, "iso-8859-", 9)
+ && strcmp(CharacterSet, "koi8-r")
|| part->encoding_type_needed != ENC_NONE)) {
fprintf(fp, "Content-type: text/richtext; charset=\"%s\"\n", CharacterSet);
} else {
@@ -1140,6 +1142,7 @@ struct mailpart *part;
WriteCtypeNicely(fp, part->content_type);
if (strcmp(CharacterSet, "us-ascii")
&& (strncmp(CharacterSet, "iso-8859-", 9)
+ && strcmp(CharacterSet, "koi8-r")
|| part->encoding_type_needed != ENC_NONE)) {
fprintf(fp, "; charset=\"%s\"\n", CharacterSet);
} else fputs("\n", fp);
@@ -1745,6 +1748,7 @@ CreateNewPart() {
}
printf("\n\nEnter your choice as a number from 0 to %d: ", i);
fflush(stdout);
+ *LineBuf = '\0';
fgets(LineBuf, sizeof(LineBuf), stdin);
ans = atoi(LineBuf);
if (ans == 0 || ans == 1) {
@@ -1791,7 +1795,7 @@ CreateNewPart() {
int ct;
printf("\nEnter the MIME Content-type value for the data from file %s\n (type '?' for a list of locally-valid content-types): ", sdum);
fflush(stdout);
- gets(LineBuf);
+ fgets(LineBuf, sizeof(LineBuf), stdin);
if (index(LineBuf, '/')) {
char lc[100], *s, AnsBuf[100];
strcpy(lc, LineBuf);
@@ -1809,7 +1813,7 @@ CreateNewPart() {
}
if (mc) break;
printf("The MIME content-type '%s' is not listed in your local mailcap files,\nand may not be a valid MIME type. Do you want to use it anyway [no] ? ", LineBuf);
- s = gets(AnsBuf);
+ s = fgets(AnsBuf, sizeof(AnsBuf), stdin);
while (s && *s && isspace((unsigned char) *s)) ++s;
if (s && (*s == 'y' || *s == 'Y')) break;
continue;

View file

@ -1,4 +1,4 @@
$NetBSD: patch-ag,v 1.2 1998/08/07 11:09:42 agc Exp $
$NetBSD: patch-ag,v 1.3 2004/02/25 03:58:43 snj Exp $
diff -u -r mm2.7.org/src/bin/showaudio mm2.7/src/bin/showaudio
--- bin/showaudio Wed Feb 2 16:21:26 1994
@ -67,196 +67,3 @@ diff -u -r mm2.7.org/src/bin/showaudio mm2.7/src/bin/showaudio
+cp "$1" $fname
if ($status == 0) echo Wrote raw audio file: $fname
exit 0
Only in mm2.7/src/bin: showaudio~
diff -u -r mm2.7.org/src/bin/showexternal mm2.7/src/bin/showexternal
--- bin/showexternal Tue Feb 8 09:39:05 1994
+++ bin/showexternal Wed May 21 21:41:39 1997
@@ -15,9 +15,45 @@
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4$5$6$7")
+case "*[\t ]*":
+ echo "Illegal white space in arguments\!"
+ echo "Command was:"
+ echo "'$0' '$1' '$2' '$3' '$4' '$5' '$6' '$7'"
+ exit 2
+endsw
+
onintr cleanup
+# Set a sensible value for the temporary directory, if its not
+# already set. If TMPDIR is set previously, then we will
+# assume it is adequately protected.
if (! $?METAMAIL_TMPDIR) then
- set METAMAIL_TMPDIR=/tmp
+ if ($?TMPDIR) then
+ set METAMAIL_TMPDIR="$TMPDIR"
+ else
+ set METAMAIL_TMPDIR=~/metamail_tmp
+ endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+ if (! -e "$METAMAIL_TMPDIR") then
+ mkdir "$METAMAIL_TMPDIR"
+ else
+ echo "$METAMAIL_TMPDIR exists, but is not a directory"
+ exit 2
+ endif
+
+ if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+ echo "Error creating $METAMAIL_TMPDIR"
+ exit 2
+ endif
+
endif
if (! $?FTP) then
set FTP=ftp
Only in mm2.7/src/bin: showexternal~
diff -u -r mm2.7.org/src/bin/showpartial mm2.7/src/bin/showpartial
--- bin/showpartial Wed Feb 2 16:21:29 1994
+++ bin/showpartial Wed May 21 21:39:49 1997
@@ -2,8 +2,44 @@
# (The "-fb" might need to be changed to "-f" on some systems)
#
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4")
+case "*[\t ]*":
+ echo "Illegal white space in arguments\!"
+ echo "Command was:"
+ echo "'$0' '$1' '$2' '$3' '$4'"
+ exit 2
+endsw
+
+# Set a sensible value for the temporary directory, if its not
+# already set. If TMPDIR is set previously, then we will
+# assume it is adequately protected.
if (! $?METAMAIL_TMPDIR) then
- set METAMAIL_TMPDIR=/tmp
+ if ($?TMPDIR) then
+ set METAMAIL_TMPDIR="$TMPDIR"
+ else
+ set METAMAIL_TMPDIR=~/metamail_tmp
+ endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+ if (! -e "$METAMAIL_TMPDIR") then
+ mkdir "$METAMAIL_TMPDIR"
+ else
+ echo "$METAMAIL_TMPDIR exists, but is not a directory"
+ exit 2
+ endif
+
+ if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+ echo "Error creating $METAMAIL_TMPDIR"
+ exit 2
+ endif
+
endif
set TREEROOT=${METAMAIL_TMPDIR}/m-prts-`whoami`
@@ -11,14 +47,14 @@
echo "Usage: showpartial file id partnum totalnum"
exit -1
endif
-set file=$1
+set file="$1"
# This next line is because message-id can contain weird chars
-set id=`echo $2 | tr -d \!\$\&\*\(\)\|\'\"\;\/\<\>\\`
-@ partnum = $3
-if ($#argv == 3 || $4 == "") then
+set id=`echo "$2" | tr -d \!\$\&\*\(\)\|\'\"\;\/\<\>\\`
+@ partnum = "$3"
+if ($#argv == 3 || "$4" == "") then
set totalnum=-1
else
- @ totalnum = $4
+ @ totalnum = "$4"
endif
if (! -d $TREEROOT) then
@@ -35,9 +71,9 @@
exit -1
endif
endif
-cp $file ${TREEROOT}/$id/$partnum
+cp "$file" ${TREEROOT}/$id/$partnum
if ($status) then
- echo cp $file ${TREEROOT}/$id/$partnum failed
+ echo cp "$file" ${TREEROOT}/$id/$partnum failed
exit -1
endif
if ($totalnum == -1) then
Only in mm2.7/src/bin: showpartial~
diff -u -r mm2.7.org/src/bin/showpicture mm2.7/src/bin/showpicture
--- bin/showpicture Mon Feb 7 10:59:54 1994
+++ bin/showpicture Wed May 21 21:34:59 1997
@@ -15,15 +15,42 @@
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#
+# Set a sensible value for the temporary directory, if its not
+# already set. If TMPDIR is set previously, then we will
+# assume it is adequately protected.
if (! $?METAMAIL_TMPDIR) then
- set METAMAIL_TMPDIR=/tmp
+ if ($?TMPDIR) then
+ set METAMAIL_TMPDIR="$TMPDIR"
+ else
+ set METAMAIL_TMPDIR=~/metamail_tmp
+ endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+ if (! -e "$METAMAIL_TMPDIR") then
+ mkdir "$METAMAIL_TMPDIR"
+ else
+ echo "$METAMAIL_TMPDIR exists, but is not a directory"
+ exit 2
+ endif
+
+ if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+ echo "Error creating $METAMAIL_TMPDIR"
+ exit 2
+ endif
+
endif
if (! $?X_VIEWER) then
-set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
+ set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
# set X_VIEWER="xv -geometry +1+1"
endif
-if ($1 == "-viewer" && $#argv > 1) then
+if ("$1" == "-viewer" && $#argv > 1) then
set X_VIEWER = "$2"
shift
shift
@@ -57,7 +84,7 @@
endif
end
endif
- cp $1 $fname
+ cp "$1" $fname
if ($status == 0) echo Wrote file $fname
exit 0
endif

View file

@ -1,7 +1,7 @@
$NetBSD: patch-ah,v 1.1 2003/09/15 11:26:45 agc Exp $
$NetBSD: patch-ah,v 1.2 2004/02/25 03:58:43 snj Exp $
--- man/mailto.1 2003/09/15 11:22:49 1.1
+++ man/mailto.1 2003/09/15 11:23:02
--- man/mailto.1.orig 1994-02-09 12:29:12.000000000 -0800
+++ man/mailto.1 2004-02-24 10:18:53.000000000 -0800
@@ -1,6 +1,6 @@
.TH MAILTO 1 "Release 1" "Bellcore Prototype"
.SH NAME
@ -10,3 +10,30 @@ $NetBSD: patch-ah,v 1.1 2003/09/15 11:26:45 agc Exp $
.SH SYNOPSIS
.ta 8n
\fBmailto\fP [-a] [-c] [-s] [recipient name(s)]
@@ -74,7 +74,7 @@ multimedia mail generator. There are, a
Basically, mailto can include the following things in mail:
-1. Simple formatted text, using the MIME type "text/richtext". This allows you to add emphasis to your message using underlining, bold text, italic (diaplsyed as reverse video), centering, and the like.
+1. Simple formatted text, using the MIME type "text/richtext". This allows you to add emphasis to your message using underlining, bold text, italic (displayed as reverse video), centering, and the like.
2. Non-text data. Metamail can include pictures, sounds, and other non-textual data in the middle of any mail message. The mailcap configuration mechanism can even make this process reasonably user-friendly, but a knowledgable user can include non-textual data even in the absence of a proper mailcap entry.
@@ -275,7 +275,7 @@ The mailto program reads both the aliase
.I
Altered editing behavior:
-The ~e and ~v commands, which are used to edit the message being composed, will behave differently in mailto if the mail includes non-text portions. In such cases, each part will be edited separately, in sequence, which makes it impossble for the user to accidentally mess up the inter-part boundaries. Moreover, if the mailcap entry for a given data type includes an "edit" field, the user will be given the choice of editing with the program named there or editing with his usual (text) editor. In most cases, this will be a choice between using a structured editor or editing the raw data stream.
+The ~e and ~v commands, which are used to edit the message being composed, will behave differently in mailto if the mail includes non-text portions. In such cases, each part will be edited separately, in sequence, which makes it imposisble for the user to accidentally mess up the inter-part boundaries. Moreover, if the mailcap entry for a given data type includes an "edit" field, the user will be given the choice of editing with the program named there or editing with his usual (text) editor. In most cases, this will be a choice between using a structured editor or editing the raw data stream.
.I
Altered behavior for large messages:
@@ -283,7 +283,7 @@ Mailto delivers your message using the s
.I
New -r command-line option
-The -r comand-line option is not found in standard Berkeley mail.
+The -r command-line option is not found in standard Berkeley mail.
.SH SUMMARY OF OPTIONS
-a <charset> -- specifies an alternate character set in use. This had better be the one your terminal is actually using. Currently it must be in the iso-8859 character set family.

View file

@ -0,0 +1,62 @@
$NetBSD: patch-ai,v 1.1 2004/02/25 03:58:43 snj Exp $
--- metamail/metamail.c.orig 1994-02-16 17:57:19.000000000 -0800
+++ metamail/metamail.c 2004-02-24 10:47:27.000000000 -0800
@@ -83,7 +83,7 @@ extern char *MkRmScript();
#define MAX_FILE_NAME_SIZE 256
#define WRITE_BINARY "w"
#else /* AMIGA */
-extern char **environ, *gets();
+extern char **environ;
#define CATCOMMAND "cat"
#define CATTEMPLATE "cat %s"
#define METAMAIL "metamail"
@@ -579,7 +579,7 @@ int nestingdepth;
int overwriteans = -1;
do {
printf("File %s exists. Do you want to overwrite it (y/n) ?\n", Fname);
- s = gets(AnsBuf);
+ s = fgets(AnsBuf, sizeof(AnsBuf), stdin);
if (!s) {
overwriteans = 0;
} else {
@@ -1202,9 +1202,9 @@ char *SquirrelFile;
fprintf(outfp, "Content-type: %s", ContentType);
for (j=0; j<CParamsUsed; ++j) {
fprintf(outfp, " ; ");
- fprintf(outfp, CParams[j]);
+ fprintf(outfp, "%s", CParams[j]);
fprintf(outfp, " = ");
- fprintf(outfp, CParamValues[j]);
+ fprintf(outfp, "%s", CParamValues[j]);
}
fprintf(outfp, "\n\n");
TranslateInputToOutput(InputFP, outfp, EncodingCode, ContentType);
@@ -1823,7 +1823,7 @@ char *ctype, *progname, *label;
} else {
printf("This message contains '%s'-format data.\nDo you want to view it using the '%s' command (y/n) [y] ? ", ctype, ShortCommand(progname));
}
- s = gets(AnsBuf);
+ s = fgets(AnsBuf, sizeof(AnsBuf), stdin);
if (!s) return(0); /* EOF */
while (s && *s && isspace((unsigned char) *s)) ++s;
if (*s == 'y' || *s == 'Y' || !*s || *s == '\n') return(1);
@@ -2022,7 +2022,8 @@ int ShowLeadingWhitespace;
if (lc2strcmp(charset, PrevCharset)) {
char *s2, *charsetinuse;
- strcpy(PrevCharset, charset);
+ strncpy(PrevCharset, charset, sizeof(PrevCharset));
+ PrevCharset[sizeof(PrevCharset) - 1] = '\0';
for (s2=PrevCharset; *s2; ++s2) {
if (isupper((unsigned char) *s2)) *s2 = tolower((unsigned char) *s2);
}
@@ -2032,7 +2033,7 @@ int ShowLeadingWhitespace;
}
}
if (ecode == ENCODING_NONE) {
- printf(txt+1);
+ printf("%s", txt+1);
} else {
/* What follows is REALLY bogus, but all my encoding stuff is pipe-oriented right now... */
MkTmpFileName(TmpFile);

View file

@ -0,0 +1,52 @@
$NetBSD: patch-aj,v 1.1 2004/02/25 03:58:43 snj Exp $
diff -u -r mm2.7.org/src/bin/showexternal mm2.7/src/bin/showexternal
--- bin/showexternal Tue Feb 8 09:39:05 1994
+++ bin/showexternal Wed May 21 21:41:39 1997
@@ -15,9 +15,45 @@
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4$5$6$7")
+case "*[\t ]*":
+ echo "Illegal white space in arguments\!"
+ echo "Command was:"
+ echo "'$0' '$1' '$2' '$3' '$4' '$5' '$6' '$7'"
+ exit 2
+endsw
+
onintr cleanup
+# Set a sensible value for the temporary directory, if its not
+# already set. If TMPDIR is set previously, then we will
+# assume it is adequately protected.
if (! $?METAMAIL_TMPDIR) then
- set METAMAIL_TMPDIR=/tmp
+ if ($?TMPDIR) then
+ set METAMAIL_TMPDIR="$TMPDIR"
+ else
+ set METAMAIL_TMPDIR=~/metamail_tmp
+ endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+ if (! -e "$METAMAIL_TMPDIR") then
+ mkdir "$METAMAIL_TMPDIR"
+ else
+ echo "$METAMAIL_TMPDIR exists, but is not a directory"
+ exit 2
+ endif
+
+ if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+ echo "Error creating $METAMAIL_TMPDIR"
+ exit 2
+ endif
+
endif
if (! $?FTP) then
set FTP=ftp

View file

@ -0,0 +1,83 @@
$NetBSD: patch-ak,v 1.1 2004/02/25 03:58:43 snj Exp $
diff -u -r mm2.7.org/src/bin/showpartial mm2.7/src/bin/showpartial
--- bin/showpartial Wed Feb 2 16:21:29 1994
+++ bin/showpartial Wed May 21 21:39:49 1997
@@ -2,8 +2,44 @@
# (The "-fb" might need to be changed to "-f" on some systems)
#
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4")
+case "*[\t ]*":
+ echo "Illegal white space in arguments\!"
+ echo "Command was:"
+ echo "'$0' '$1' '$2' '$3' '$4'"
+ exit 2
+endsw
+
+# Set a sensible value for the temporary directory, if its not
+# already set. If TMPDIR is set previously, then we will
+# assume it is adequately protected.
if (! $?METAMAIL_TMPDIR) then
- set METAMAIL_TMPDIR=/tmp
+ if ($?TMPDIR) then
+ set METAMAIL_TMPDIR="$TMPDIR"
+ else
+ set METAMAIL_TMPDIR=~/metamail_tmp
+ endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+ if (! -e "$METAMAIL_TMPDIR") then
+ mkdir "$METAMAIL_TMPDIR"
+ else
+ echo "$METAMAIL_TMPDIR exists, but is not a directory"
+ exit 2
+ endif
+
+ if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+ echo "Error creating $METAMAIL_TMPDIR"
+ exit 2
+ endif
+
endif
set TREEROOT=${METAMAIL_TMPDIR}/m-prts-`whoami`
@@ -11,14 +47,14 @@
echo "Usage: showpartial file id partnum totalnum"
exit -1
endif
-set file=$1
+set file="$1"
# This next line is because message-id can contain weird chars
-set id=`echo $2 | tr -d \!\$\&\*\(\)\|\'\"\;\/\<\>\\`
-@ partnum = $3
-if ($#argv == 3 || $4 == "") then
+set id=`echo "$2" | tr -d \!\$\&\*\(\)\|\'\"\;\/\<\>\\`
+@ partnum = "$3"
+if ($#argv == 3 || "$4" == "") then
set totalnum=-1
else
- @ totalnum = $4
+ @ totalnum = "$4"
endif
if (! -d $TREEROOT) then
@@ -35,9 +71,9 @@
exit -1
endif
endif
-cp $file ${TREEROOT}/$id/$partnum
+cp "$file" ${TREEROOT}/$id/$partnum
if ($status) then
- echo cp $file ${TREEROOT}/$id/$partnum failed
+ echo cp "$file" ${TREEROOT}/$id/$partnum failed
exit -1
endif
if ($totalnum == -1) then

View file

@ -0,0 +1,60 @@
$NetBSD: patch-al,v 1.1 2004/02/25 03:58:43 snj Exp $
diff -u -r mm2.7.org/src/bin/showpicture mm2.7/src/bin/showpicture
--- bin/showpicture Mon Feb 7 10:59:54 1994
+++ bin/showpicture Wed May 21 21:34:59 1997
@@ -15,15 +15,42 @@
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#
+# Set a sensible value for the temporary directory, if its not
+# already set. If TMPDIR is set previously, then we will
+# assume it is adequately protected.
if (! $?METAMAIL_TMPDIR) then
- set METAMAIL_TMPDIR=/tmp
+ if ($?TMPDIR) then
+ set METAMAIL_TMPDIR="$TMPDIR"
+ else
+ set METAMAIL_TMPDIR=~/metamail_tmp
+ endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+ if (! -e "$METAMAIL_TMPDIR") then
+ mkdir "$METAMAIL_TMPDIR"
+ else
+ echo "$METAMAIL_TMPDIR exists, but is not a directory"
+ exit 2
+ endif
+
+ if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+ echo "Error creating $METAMAIL_TMPDIR"
+ exit 2
+ endif
+
endif
if (! $?X_VIEWER) then
-set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
+ set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
# set X_VIEWER="xv -geometry +1+1"
endif
-if ($1 == "-viewer" && $#argv > 1) then
+if ("$1" == "-viewer" && $#argv > 1) then
set X_VIEWER = "$2"
shift
shift
@@ -57,7 +84,7 @@
endif
end
endif
- cp $1 $fname
+ cp "$1" $fname
if ($status == 0) echo Wrote file $fname
exit 0
endif

View file

@ -0,0 +1,13 @@
$NetBSD: patch-am,v 1.1 2004/02/25 03:58:43 snj Exp $
--- man/mailcap.4.orig 2004-02-24 10:35:36.000000000 -0800
+++ man/mailcap.4 2004-02-24 10:36:52.000000000 -0800
@@ -42,7 +42,7 @@ The "textualnewlines" field can be used
The "compose" field may be used to specify a program that can be used to compose a new body or body part in the given format. Its intended use is to support mail composing agents that support the composition of multiple types of mail using external composing agents. As with the view-command, the compose command will be executed after replacing certain escape sequences starting with "%". In particular, %s should be replaced by the name of a file to which the composed data is to be written by the specified composing program, thus allowing th3e calling program (e.g. metamail) to tell the called program where to store the composed data. If %s does not appear, then the composed data will be assumed to be written by the composing programs to standard output. The result of the composing program may be data that is NOT yet suitable for mail transport -- that is, a Content-Transfer-Encoding may still need to be applied to the data.
-The "composetyped" field is similar to the "compose" field, but is to be used when the composing program needs to specify the Content-type header field to be applied to the composed data. The "compose" field is simpler, and is preferred for use with existing (non-mail-oriented) programs for composing data in a given format. The "composetyped" field is necessary when the Content-type information must include auxilliary parameters, and the composition program must then know enough about mail formats to produce output that includes the mail type information, and to apply any necessary Content-Transfer-Encoding. Conceptually, "compose" specifies a program that simply outputs the specified type of data in its raw form, while "composetyped" specifies a program that outputs the data as a MIME object, with all necessary Content-* headers already in place.
+The "composetyped" field is similar to the "compose" field, but is to be used when the composing program needs to specify the Content-type header field to be applied to the composed data. The "compose" field is simpler, and is preferred for use with existing (non-mail-oriented) programs for composing data in a given format. The "composetyped" field is necessary when the Content-type information must include auxiliary parameters, and the composition program must then know enough about mail formats to produce output that includes the mail type information, and to apply any necessary Content-Transfer-Encoding. Conceptually, "compose" specifies a program that simply outputs the specified type of data in its raw form, while "composetyped" specifies a program that outputs the data as a MIME object, with all necessary Content-* headers already in place.
.TP 8
.B needsterminal

View file

@ -0,0 +1,13 @@
$NetBSD: patch-an,v 1.1 2004/02/25 03:58:43 snj Exp $
--- man/metasend.1.orig 2004-02-24 10:38:49.000000000 -0800
+++ man/metasend.1 2004-02-24 10:38:56.000000000 -0800
@@ -12,7 +12,7 @@ program will allow a user to send one or
With no arguments, the program will ask the user for the To, Subject, and CC fields. It will then ask for the name of a MIME content-type. Next, it will ask the user for the name of an existing file containing that type of data. After this, it will ask what encoding type, if any, should be applied to this data. Finally, it will ask if the user wants to include information from an additional file, in which case the last three questions will be repeated for the next file.
-Alternately, all of this information can be provided on the comand line, using the following options:
+Alternately, all of this information can be provided on the command line, using the following options:
-b -- specifies Batch (non-interactive) Mode. Will exit with an error message if all additional needed information is not provided on the command line.
-c cc -- specifies the CC address

View file

@ -0,0 +1,13 @@
$NetBSD: patch-ao,v 1.1 2004/02/25 03:58:43 snj Exp $
--- man/splitmail.1.orig 2004-02-24 10:42:15.000000000 -0800
+++ man/splitmail.1 2004-02-24 10:42:25.000000000 -0800
@@ -16,7 +16,7 @@ If the -d option is specified, the mail
The -i option can be used to make splitmail generate the pieces with similar (but not identical) message-id fields, in a format which allows them to be easily correlated with one another and which end with the suffix provided on the command line after -i.
-The default chunk size for spliting messages is 250000 at most sites, though this is also a compile-time option. This can be overriden with the -s switch, or with the environment variable SPLITSIZE.
+The default chunk size for spliting messages is 250000 at most sites, though this is also a compile-time option. This can be overridden with the -s switch, or with the environment variable SPLITSIZE.
Messages smaller than the chunk size will not be turned into partial messages, but will be written to a single file or delivered as a single message.
.SH ENVIRONMENT