- getc() returns an int, not a char

- Rename patches with update-patches while here
This commit is contained in:
pvalchev 2002-02-20 21:18:02 +00:00
parent 4e6cb91f8a
commit 653d63b9e7
19 changed files with 680 additions and 705 deletions

View File

@ -1,6 +1,7 @@
--- Makefile.orig Wed Jan 26 09:32:33 1994
+++ Makefile Sat Jul 25 22:42:41 1998
@@ -38,7 +38,7 @@
$OpenBSD: patch-Makefile,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- Makefile.orig Wed Jan 26 10:32:33 1994
+++ Makefile Wed Feb 20 14:06:43 2002
@@ -38,7 +38,7 @@ FOOBAR-sun4=-Bstatic
STATICFLAG=FOOBAR${HOST_ARCH}
@ -9,7 +10,7 @@
# The following is better if you want to make sure you run with SYSV defined
# CFLAGS = -g -I. ${$(STATICFLAG)} -DSYSV
# Also, for SGI Irix, compile in K&R mode
@@ -49,9 +49,9 @@
@@ -49,9 +49,9 @@ CFLAGS = -g -I. ${$(STATICFLAG)}
# LDLIBS variable.
#
# For Sun and BSD systems, the following should work...
@ -21,7 +22,7 @@
# On SGI machines, we need -lsun for getpw...(), and -lc_s saves some space.
# LDLIBS = -lsun -lc_s
# ISC SysVr3.2.2 has a shared C library and requires libinet.a to resolve
@@ -72,10 +72,10 @@
@@ -72,10 +72,10 @@ CONFIGDIR = .
# install -s -c $(LOCALBINDIR) $$file
#
#INSTALL = cp
@ -34,7 +35,7 @@
#
# This is where binaries should be copied
LOCALBINDIR = ${INSTROOT}/bin
@@ -91,14 +91,14 @@
@@ -91,14 +91,14 @@ MAN4EXT = 4
FONTSUFFIX=pcf
# This is where the mailcap file should be put
@ -52,7 +53,7 @@
(cd metamail ; $(MAKE) CONFIGDIR=../${CONFIGDIR} CFLAGS="${CFLAGS}" CC="${CC}" LDLIBS="${LDLIBS}")
-${RM} bin/metamail
(cd bin; ${LN} ../metamail/metamail metamail)
@@ -117,7 +117,7 @@
@@ -117,7 +117,7 @@ basics::
(cd bin; ${LN} ../richmail/richtext richtext)
-${RM} bin/richtoatk
(cd bin; ${LN} ../richmail/richtoatk richtoatk)
@ -61,7 +62,7 @@
-${RM} bin/shownonascii
(cd bin; ${LN} ../fonts/shownonascii shownonascii)
-${RM} bin/mailto-hebrew
@@ -145,10 +145,12 @@
@@ -145,10 +145,12 @@ install-all: basics
echo "installing man page $$target";\
${CP} $$file $$target; \
done)

View File

@ -1,33 +0,0 @@
*** config.h.orig Mon Oct 17 21:06:22 1994
--- config.h Mon Oct 17 21:08:13 1994
***************
*** 73,79 ****
#ifdef SYSV
#define RESET_PROGRAM "tput clear"
#else
! #ifdef __BSD_4_4__
#define RESET_PROGRAM "/usr/bin/reset"
#else
#define RESET_PROGRAM "/usr/ucb/reset"
--- 73,79 ----
#ifdef SYSV
#define RESET_PROGRAM "tput clear"
#else
! #if defined(__BSD_4_4__) || defined(__FreeBSD__)
#define RESET_PROGRAM "/usr/bin/reset"
#else
#define RESET_PROGRAM "/usr/ucb/reset"
***************
*** 155,161 ****
--- 155,165 ----
#ifdef NeXT
#define sigtype void
#else
+ #ifdef __FreeBSD__
+ #define sigtype void
+ #else
#define sigtype int
+ #endif
#endif
#endif

View File

@ -1,19 +0,0 @@
*** 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,35 +0,0 @@
*** 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
+ if [ -d /usr/X11R6 ]; then mkfontdir ${PREFIX}/lib/metamail/fonts ; fi
clean:
rm -f heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} heb8x13B.${FONTSUFFIX} shownonascii mailto-hebrew fonts.dir

View File

@ -1,21 +0,0 @@
*** 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() {

View File

@ -1,53 +0,0 @@
*** 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);

View File

@ -1,260 +0,0 @@
diff -u -r mm2.7.org/src/bin/showaudio mm2.7/src/bin/showaudio
--- bin/showaudio Wed Feb 2 16:21:26 1994
+++ bin/showaudio Wed May 21 21:34:08 1997
@@ -15,9 +15,35 @@
# 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
# First, figure out which machine to play it on!
@@ -33,7 +59,7 @@
set ORG="Bellcore"
set STDINPUT=0
if ("$1" == "-p") then
- set AUDIOPHONE=$2
+ set AUDIOPHONE="$2"
shift
shift
endif
@@ -173,7 +199,7 @@
set AUDIOPHONE=$<
endif
if ($thishost == $AUDIOPHONEHOST || $thishost == $AUDIOPHONEHOSTLONG) then
- echo Calling Phone number $AUDIOPHONE
+ echo Calling Phone number "$AUDIOPHONE"
echo "You MUST SAY HELLO when you answer the phone, or you will not hear the message."
mail -s "showaudio: `whoami` called $AUDIOPHONE" $AUDIOLOGMAIL < /dev/null
if ($STDINPUT) then
@@ -206,7 +232,7 @@
echo -n "File name:"
set fname=$<
endif
-cp $1 $fname
+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,271 +0,0 @@
*** metamail/mailto.c.orig Wed Feb 9 15:30:26 1994
--- metamail/mailto.c Mon Apr 27 22:40:31 1998
***************
*** 195,201 ****
sprintf(s, "%s/mm.XXXXXX", tmproot);
}
#endif
! mktemp(s);
return(s);
}
--- 195,201 ----
sprintf(s, "%s/mm.XXXXXX", tmproot);
}
#endif
! /* mktemp(s);*/
return(s);
}
***************
*** 205,211 ****
FILE *fp;
strcpy(TmpName, tmpname());
! fp = fopen(TmpName, "w");
if (!fp) fp = stdout;
fprintf(fp, "The following tilde escapes are BSD-mail-compatible:\n");
fprintf(fp, "~? Show help on tilde escapes\n");
--- 205,211 ----
FILE *fp;
strcpy(TmpName, tmpname());
! fp = fdopen(mkstemp(TmpName), "w");
if (!fp) fp = stdout;
fprintf(fp, "The following tilde escapes are BSD-mail-compatible:\n");
fprintf(fp, "~? Show help on tilde escapes\n");
***************
*** 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);
***************
*** 591,597 ****
}
FirstPart = NewPart();
CurrentPart = FirstPart;
! fpout = fopen(CurrentPart->filename, "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
--- 592,598 ----
}
FirstPart = NewPart();
CurrentPart = FirstPart;
! fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
***************
*** 678,684 ****
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
! fpout = fopen(CurrentPart->filename, "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
--- 679,685 ----
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
! fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
***************
*** 717,723 ****
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
! fpout = fopen(CurrentPart->filename, "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
--- 718,724 ----
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
! fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
***************
*** 729,735 ****
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
! fpout = fopen(CurrentPart->filename, "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
--- 730,736 ----
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
! fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
***************
*** 808,818 ****
char Cmd[TMPFILE_NAME_SIZE + 15];
char *s=tmpname();
fclose(fpout);
! fptmp = fopen(s, "w");
WriteOutMessage(fptmp, ToList, Subject, CCList, FirstPart);
TempCloseStyles(fptmp);
fclose(fptmp);
! fpout = fopen(CurrentPart->filename, "a");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
--- 809,819 ----
char Cmd[TMPFILE_NAME_SIZE + 15];
char *s=tmpname();
fclose(fpout);
! fptmp = fdopen(mkstemp(s), "w");
WriteOutMessage(fptmp, ToList, Subject, CCList, FirstPart);
TempCloseStyles(fptmp);
fclose(fptmp);
! fpout = fdopen(mkstemp(CurrentPart->filename), "a");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
***************
*** 969,975 ****
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
! fpout = fopen(CurrentPart->filename, "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
--- 970,976 ----
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
! fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
***************
*** 991,997 ****
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
! fpout = fopen(CurrentPart->filename, "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
--- 992,998 ----
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
! fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-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) {
***************
*** 1773,1779 ****
printf("Cannot read %s, data insertion cancelled\n", sdum);
return(NULL);
}
! fpo = fopen(mp->filename, "w");
if (!fpo) {
printf("Cannot open temporary file, data insertion cancelled\n");
return(NULL);
--- 1777,1783 ----
printf("Cannot read %s, data insertion cancelled\n", sdum);
return(NULL);
}
! fpo = fdopen(mkstemp(mp->filename), "w");
if (!fpo) {
printf("Cannot open temporary file, data insertion cancelled\n");
return(NULL);
***************
*** 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;
***************
*** 1936,1942 ****
mp->encoding_type_needed = ENC_NONE;
}
newfilename = tmpname();
! fpout = fopen(newfilename, "w");
if (!fpout) {
fprintf(stderr, "Cannot open file %s for writing, no data included.\n", newfilename);
free(CmdBuf);
--- 1940,1946 ----
mp->encoding_type_needed = ENC_NONE;
}
newfilename = tmpname();
! fpout = fdopen(mkstemp(newfilename), "w");
if (!fpout) {
fprintf(stderr, "Cannot open file %s for writing, no data included.\n", newfilename);
free(CmdBuf);

View File

@ -0,0 +1,68 @@
$OpenBSD: patch-bin_showaudio,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- bin/showaudio.orig Wed Feb 2 16:21:26 1994
+++ bin/showaudio Wed Feb 20 14:06:43 2002
@@ -15,9 +15,35 @@
# 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
# First, figure out which machine to play it on!
@@ -33,7 +59,7 @@ set AUDIOLOGMAIL=andrew@thumper.bellcore
set ORG="Bellcore"
set STDINPUT=0
if ("$1" == "-p") then
- set AUDIOPHONE=$2
+ set AUDIOPHONE="$2"
shift
shift
endif
@@ -173,7 +199,7 @@ if (-d $AUDIOBINDIR) then
set AUDIOPHONE=$<
endif
if ($thishost == $AUDIOPHONEHOST || $thishost == $AUDIOPHONEHOSTLONG) then
- echo Calling Phone number $AUDIOPHONE
+ echo Calling Phone number "$AUDIOPHONE"
echo "You MUST SAY HELLO when you answer the phone, or you will not hear the message."
mail -s "showaudio: `whoami` called $AUDIOPHONE" $AUDIOLOGMAIL < /dev/null
if ($STDINPUT) then
@@ -206,7 +232,7 @@ else
echo -n "File name:"
set fname=$<
endif
-cp $1 $fname
+cp "$1" $fname
if ($status == 0) echo Wrote raw audio file: $fname
exit 0

View File

@ -0,0 +1,50 @@
$OpenBSD: patch-bin_showexternal,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- bin/showexternal.orig Tue Feb 8 09:39:05 1994
+++ bin/showexternal Wed Feb 20 14:06:43 2002
@@ -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,81 @@
$OpenBSD: patch-bin_showpartial,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- bin/showpartial.orig Wed Feb 2 16:21:29 1994
+++ bin/showpartial Wed Feb 20 14:06:43 2002
@@ -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 @@ if ($#argv < 3 || $#argv > 4) then
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 @@ if (! -d ${TREEROOT}/$id) then
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,58 @@
$OpenBSD: patch-bin_showpicture,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- bin/showpicture.orig Mon Feb 7 10:59:54 1994
+++ bin/showpicture Wed Feb 20 14:06:43 2002
@@ -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 @@ if (! $?DISPLAY) then
endif
end
endif
- cp $1 $fname
+ cp "$1" $fname
if ($status == 0) echo Wrote file $fname
exit 0
endif

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-bin_sun2mime,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- bin/sun2mime.orig Sat Nov 13 07:54:05 1993
+++ bin/sun2mime Wed Feb 20 14:06:43 2002
@@ -11,7 +11,7 @@ if [ x$METAMAIL_TMPDIR = x ]; then
fi
TMPFILE=${METAMAIL_TMPDIR}/suntomime.$$
-/bin/nawk '
+/usr/bin/awk '
BEGIN { printf("Content-type: multipart/mixed; boundary=--------\n\n")
RS=""; FS="\n"; mode="HEADER" }
mode == "HEADER" {

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-config_h,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- config.h.orig Wed Nov 24 08:36:07 1993
+++ config.h Wed Feb 20 14:06:43 2002
@@ -73,7 +73,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE
#ifdef SYSV
#define RESET_PROGRAM "tput clear"
#else
-#ifdef __BSD_4_4__
+#if defined(__BSD_4_4__) || defined(__FreeBSD__)
#define RESET_PROGRAM "/usr/bin/reset"
#else
#define RESET_PROGRAM "/usr/ucb/reset"
@@ -155,7 +155,11 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE
#ifdef NeXT
#define sigtype void
#else
+#ifdef __FreeBSD__
+#define sigtype void
+#else
#define sigtype int
+#endif
#endif
#endif

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-fonts_Makefile,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- fonts/Makefile.orig Mon May 31 14:49:27 1993
+++ fonts/Makefile Wed Feb 20 14:06:43 2002
@@ -28,12 +28,18 @@ heb8x13B.${FONTSUFFIX}: heb8x13B.bdf
-${DIRBUILDER}
shownonascii: Xshownonascii
- sed -e s@/u/nsb/lib/fonts@`pwd`@ < Xshownonascii > 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
+ 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
+ if [ -d /usr/X11R6 ]; then mkfontdir ${PREFIX}/lib/metamail/fonts ; fi
clean:
rm -f heb6x13.${FONTSUFFIX} heb8x13.${FONTSUFFIX} heb8x13B.${FONTSUFFIX} shownonascii mailto-hebrew fonts.dir

View File

@ -0,0 +1,167 @@
$OpenBSD: patch-metamail_mailto_c,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- metamail/mailto.c.orig Wed Feb 9 13:30:26 1994
+++ metamail/mailto.c Wed Feb 20 14:09:51 2002
@@ -195,7 +195,7 @@ tmpname() {
sprintf(s, "%s/mm.XXXXXX", tmproot);
}
#endif
- mktemp(s);
+/* mktemp(s);*/
return(s);
}
@@ -205,7 +205,7 @@ TildeHelp() {
FILE *fp;
strcpy(TmpName, tmpname());
- fp = fopen(TmpName, "w");
+ fp = fdopen(mkstemp(TmpName), "w");
if (!fp) fp = stdout;
fprintf(fp, "The following tilde escapes are BSD-mail-compatible:\n");
fprintf(fp, "~? Show help on tilde escapes\n");
@@ -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);
@@ -591,7 +592,7 @@ char **argv;
}
FirstPart = NewPart();
CurrentPart = FirstPart;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -678,7 +679,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -717,7 +718,7 @@ char **argv;
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
@@ -729,7 +730,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -808,11 +809,11 @@ char **argv;
char Cmd[TMPFILE_NAME_SIZE + 15];
char *s=tmpname();
fclose(fpout);
- fptmp = fopen(s, "w");
+ fptmp = fdopen(mkstemp(s), "w");
WriteOutMessage(fptmp, ToList, Subject, CCList, FirstPart);
TempCloseStyles(fptmp);
fclose(fptmp);
- fpout = fopen(CurrentPart->filename, "a");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "a");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -969,7 +970,7 @@ char **argv;
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
@@ -991,7 +992,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-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) {
@@ -1773,7 +1777,7 @@ CreateNewPart() {
printf("Cannot read %s, data insertion cancelled\n", sdum);
return(NULL);
}
- fpo = fopen(mp->filename, "w");
+ fpo = fdopen(mkstemp(mp->filename), "w");
if (!fpo) {
printf("Cannot open temporary file, data insertion cancelled\n");
return(NULL);
@@ -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;
@@ -1866,7 +1870,8 @@ CreateNewPart() {
mp->content_type = mc->contenttype;
mp->encoding_type_needed = WhichEncodingForFile(mp->filename, mp->content_type);
} else {
- char c, LineBuf[1000], *colon, *ctypebuf = NULL, *cencbuf = NULL, *s, *newfilename;
+ char LineBuf[1000], *colon, *ctypebuf = NULL, *cencbuf = NULL, *s, *newfilename;
+ int c;
FILE *fp, *fpout;
int inheaders=1, bct=0;
@@ -1936,7 +1941,7 @@ CreateNewPart() {
mp->encoding_type_needed = ENC_NONE;
}
newfilename = tmpname();
- fpout = fopen(newfilename, "w");
+ fpout = fdopen(mkstemp(newfilename), "w");
if (!fpout) {
fprintf(stderr, "Cannot open file %s for writing, no data included.\n", newfilename);
free(CmdBuf);

View File

@ -0,0 +1,167 @@
$OpenBSD: patch-metamail_mailto_c.orig,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- metamail/mailto.c.orig Wed Feb 9 13:30:26 1994
+++ metamail/mailto.c Wed Feb 20 14:08:41 2002
@@ -195,7 +195,7 @@ tmpname() {
sprintf(s, "%s/mm.XXXXXX", tmproot);
}
#endif
- mktemp(s);
+/* mktemp(s);*/
return(s);
}
@@ -205,7 +205,7 @@ TildeHelp() {
FILE *fp;
strcpy(TmpName, tmpname());
- fp = fopen(TmpName, "w");
+ fp = fdopen(mkstemp(TmpName), "w");
if (!fp) fp = stdout;
fprintf(fp, "The following tilde escapes are BSD-mail-compatible:\n");
fprintf(fp, "~? Show help on tilde escapes\n");
@@ -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);
@@ -591,7 +592,7 @@ char **argv;
}
FirstPart = NewPart();
CurrentPart = FirstPart;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -678,7 +679,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -717,7 +718,7 @@ char **argv;
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
@@ -729,7 +730,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -808,11 +809,11 @@ char **argv;
char Cmd[TMPFILE_NAME_SIZE + 15];
char *s=tmpname();
fclose(fpout);
- fptmp = fopen(s, "w");
+ fptmp = fdopen(mkstemp(s), "w");
WriteOutMessage(fptmp, ToList, Subject, CCList, FirstPart);
TempCloseStyles(fptmp);
fclose(fptmp);
- fpout = fopen(CurrentPart->filename, "a");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "a");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -969,7 +970,7 @@ char **argv;
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
@@ -991,7 +992,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
- fpout = fopen(CurrentPart->filename, "w");
+ fpout = fdopen(mkstemp(CurrentPart->filename), "w");
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-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) {
@@ -1773,7 +1777,7 @@ CreateNewPart() {
printf("Cannot read %s, data insertion cancelled\n", sdum);
return(NULL);
}
- fpo = fopen(mp->filename, "w");
+ fpo = fdopen(mkstemp(mp->filename), "w");
if (!fpo) {
printf("Cannot open temporary file, data insertion cancelled\n");
return(NULL);
@@ -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;
@@ -1866,7 +1870,8 @@ CreateNewPart() {
mp->content_type = mc->contenttype;
mp->encoding_type_needed = WhichEncodingForFile(mp->filename, mp->content_type);
} else {
- char c, LineBuf[1000], *colon, *ctypebuf = NULL, *cencbuf = NULL, *s, *newfilename;
+ char LineBuf[1000], *colon, *ctypebuf = NULL, *cencbuf = NULL, *s, *newfilename;
+ int c;
FILE *fp, *fpout;
int inheaders=1, bct=0;
@@ -1936,7 +1941,7 @@ CreateNewPart() {
mp->encoding_type_needed = ENC_NONE;
}
newfilename = tmpname();
- fpout = fopen(newfilename, "w");
+ fpout = fdopen(mkstemp(newfilename), "w");
if (!fpout) {
fprintf(stderr, "Cannot open file %s for writing, no data included.\n", newfilename);
free(CmdBuf);

View File

@ -1,6 +1,7 @@
--- metamail/metamail.c.orig Mon Nov 10 13:00:24 1997
+++ metamail/metamail.c Mon Nov 10 13:01:06 1997
@@ -29,7 +29,7 @@
$OpenBSD: patch-metamail_metamail_c,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- metamail/metamail.c.orig Wed Feb 20 14:06:43 2002
+++ metamail/metamail.c Wed Feb 20 14:06:43 2002
@@ -29,7 +29,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE
#ifdef BORLAND
#define F_OK 0
extern unsigned _stklen = 16384;
@ -9,7 +10,7 @@
#define WRITE_BINARY "w"
#else /* BORLAND */
#ifdef MICROSOFT
@@ -302,24 +302,6 @@
@@ -302,24 +302,6 @@ char **argv;
int retcode;
modpath(AUXPATH);
@ -34,7 +35,7 @@
tmproot = getenv("METAMAIL_TMPDIR");
if (!tmproot) tmproot="/tmp";
mailheaders = getenv("MM_HEADERS");
@@ -2489,14 +2471,14 @@
@@ -2489,14 +2471,14 @@ char *name;
{
#ifdef AMIGA
strcpy(name, "T:mmXXXXXX");

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-metamail_splitmail_c,v 1.1 2002/02/20 21:18:02 pvalchev Exp $
--- metamail/splitmail.c.orig Mon Jan 31 15:23:14 1994
+++ metamail/splitmail.c Wed Feb 20 14:06:43 2002
@@ -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() {