Sophie

Sophie

distrib > Mandriva > cooker > x86_64 > by-pkgid > 1fec5bad01a4f85042e019065a3fb665 > files > 6

metamail-2.7-16mdv2009.0.src.rpm

--- mm2.7/src/metamail/mailto.c.cshfix	Sat Oct 25 09:50:36 1997
+++ mm2.7/src/metamail/mailto.c	Sat Oct 25 09:51:03 1997
@@ -200,9 +200,12 @@
 }
 
 TildeHelp() {
-    char *pager = getenv("PAGER");
     char TmpName[100], CmdBuf[150];
+    char *pager;
     FILE *fp;
+
+    if ((pager = getenv("METAMAIL_PAGER")) == NULL)
+    	pager = getenv("PAGER");
 
     strcpy(TmpName, tmpname());
     fp = fopen(TmpName, "w");
--- mm2.7/src/bin/showexternal.cshfix	Sat Oct 25 09:45:05 1997
+++ mm2.7/src/bin/showexternal	Sat Oct 25 09:46:25 1997
@@ -19,6 +19,9 @@
 if (! $?METAMAIL_TMPDIR) then
     set METAMAIL_TMPDIR=/tmp
 endif
+if (! $?METAMAIL_PAGER) then
+    set METAMAIL_PAGER=more
+endif
 if (! $?FTP) then
     set FTP=ftp
 endif
@@ -27,11 +30,19 @@
     echo "Usage: showexternal body-file access-type name [site [directory [mode [server]]]]"
     exit -1
 endif
-set bodyfile=$1
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4$5$6$7")
+case "*[ 	]*":
+	echo "Illegal white space in arguments -- possibly a mail bomb?!"
+	echo "Command was:"
+	echo \'$0\' \'$1\' \'$2\' \'$3\' \'$4\' \'$5\' \'$6\' \'$7\'
+	exit 2
+endsw
+set bodyfile="$1"
 set atype=`echo $2 | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
 set name=$3
 if ($#argv > 3) then
-    set site=$4
+    set site="$4"
 else 
     set site=""
 endif
@@ -41,12 +52,12 @@
     set dir=""
 endif
 if ($#argv > 5) then
-    set mode=$6
+    set mode="$6"
 else
     set mode=""
 endif
 if ($#argv > 6) then
-    set server=$7
+    set server="$7"
 else
     set server=""
 endif
@@ -96,7 +107,7 @@
 
 !
 	sed -e 1,/^\$/d < $bodyfile >> ${METAMAIL_TMPDIR}/ext.junk.$$
-	more ${METAMAIL_TMPDIR}/ext.junk.$$
+	${METAMAIL_PAGER} ${METAMAIL_TMPDIR}/ext.junk.$$
 	rm ${METAMAIL_TMPDIR}/ext.junk.$$
 	breaksw
     default:
--- mm2.7/src/bin/showpartial.cshfix	Sat Oct 25 09:46:37 1997
+++ mm2.7/src/bin/showpartial	Sat Oct 25 09:47:24 1997
@@ -11,14 +11,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 totalnum=-1
 else
-    @ totalnum = $4
+    @ totalnum = "$4"
 endif
 
 if (! -d  $TREEROOT)  then
--- mm2.7/src/bin/sun-message.csh.cshfix	Sat Oct 25 09:49:16 1997
+++ mm2.7/src/bin/sun-message.csh	Sat Oct 25 09:50:15 1997
@@ -8,6 +8,10 @@
 mkdir /tmp/decode.$$
 cd /tmp/decode.$$
 
+if (! $?METAMAIL_PAGER) then
+    set METAMAIL_PAGER=more
+endif
+
 if ($2 == "uuencode") then
     uudecode $1
 
@@ -37,7 +41,7 @@
 	    cd /tmp; /bin/rm -rf /tmp/decode.$$
 	    exit 0
 	else if ($ans == 1) then
-	    more $fn
+	    ${METAMAIL_PAGER} $fn
 	else if ($ans == 2) then
 	    set nfn = ""
 	    echo -n "Save as: $HOME/"
@@ -53,7 +57,7 @@
 	set defans = "3"
     end
 else
-    more $1
+    ${METAMAIL_PAGER} $1
 endif