]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - diffutils/patches/diffutils-2.8.1-hardened_tmp-1.patch
Move all packages to root.
[people/stevee/ipfire-3.x.git] / diffutils / patches / diffutils-2.8.1-hardened_tmp-1.patch
1 Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
2 Date: 2006-10-09
3 Initial Package Version: 2.8.7
4 Upstream Status: Submitted - Partially accepted
5 Thread starts here:
6 http://sources.redhat.com/ml/bug-gnu-utils/2000-12/msg00163.html
7 Origin: ALT Linux / Openwall Owl Linux - diffutils-2.8.7-alt-tmp.diff
8 Description: This patch removes the more portable and less safe use of
9 tmpname(3), in preference of mkstemp(3).
10
11 --- diffutils-2.8.7/src/sdiff.c.orig 2004-04-12 07:44:35 +0000
12 +++ diffutils-2.8.7/src/sdiff.c 2005-05-17 12:58:44 +0000
13 @@ -990,13 +990,13 @@ edit (struct line_filter *left, char con
14 int fd;
15
16 if (tmpname)
17 - tmp = fopen (tmpname, "w");
18 - else
19 {
20 - if ((fd = temporary_file ()) < 0)
21 - perror_fatal ("mkstemp");
22 - tmp = fdopen (fd, "w");
23 + unlink (tmpname);
24 + free (tmpname);
25 }
26 + if ((fd = temporary_file ()) < 0)
27 + perror_fatal ("mkstemp");
28 + tmp = fdopen (fd, "w");
29
30 if (! tmp)
31 perror_fatal (tmpname);