r1691 - trunk/diffutils

robert at linuxfromscratch.org robert at linuxfromscratch.org
Sun Oct 8 23:49:35 PDT 2006


Author: robert
Date: 2006-10-09 00:49:32 -0600 (Mon, 09 Oct 2006)
New Revision: 1691

Added:
   trunk/diffutils/diffutils-2.8.7-hardened_tmp-1.patch
Log:
Added diffutils-2.8.7-hardened_tmp-1.patch

Added: trunk/diffutils/diffutils-2.8.7-hardened_tmp-1.patch
===================================================================
--- trunk/diffutils/diffutils-2.8.7-hardened_tmp-1.patch	                        (rev 0)
+++ trunk/diffutils/diffutils-2.8.7-hardened_tmp-1.patch	2006-10-09 06:49:32 UTC (rev 1691)
@@ -0,0 +1,31 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
+Date: 2006-10-09
+Initial Package Version: 2.8.7
+Upstream Status: Submitted - Partially accepted
+Thread starts here:
+	http://sources.redhat.com/ml/bug-gnu-utils/2000-12/msg00163.html
+Origin: ALT Linux / Openwall Owl Linux - diffutils-2.8.7-alt-tmp.diff
+Description: This patch removes the more portable and less safe use of
+tmpname(3), in preference of mkstemp(3).
+
+--- diffutils-2.8.7/src/sdiff.c.orig	2004-04-12 07:44:35 +0000
++++ diffutils-2.8.7/src/sdiff.c	2005-05-17 12:58:44 +0000
+@@ -990,13 +990,13 @@ edit (struct line_filter *left, char con
+ 	    int fd;
+ 
+ 	    if (tmpname)
+-	      tmp = fopen (tmpname, "w");
+-	    else
+ 	      {
+-		if ((fd = temporary_file ()) < 0)
+-		  perror_fatal ("mkstemp");
+-		tmp = fdopen (fd, "w");
++		unlink (tmpname);
++		free (tmpname);
+ 	      }
++	    if ((fd = temporary_file ()) < 0)
++	      perror_fatal ("mkstemp");
++	    tmp = fdopen (fd, "w");
+ 
+ 	    if (! tmp)
+ 	      perror_fatal (tmpname);




More information about the patches mailing list