Gentoo Archives: gentoo-commits

From: "Sebastian Pipping (sping)" <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-process/atop/files: atop-1.26-cve-2011-3618.patch
Date: Mon, 09 Jan 2012 21:46:10
Message-Id: 20120109214556.337652004C@flycatcher.gentoo.org
1 sping 12/01/09 21:45:56
2
3 Added: atop-1.26-cve-2011-3618.patch
4 Log:
5 sys-process/atop: 1.26-r1
6
7 (Portage version: 2.1.10.44/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-process/atop/files/atop-1.26-cve-2011-3618.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/atop/files/atop-1.26-cve-2011-3618.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/atop/files/atop-1.26-cve-2011-3618.patch?rev=1.1&content-type=text/plain
14
15 Index: atop-1.26-cve-2011-3618.patch
16 ===================================================================
17 --- rawlog.c 2012-01-09 20:31:52.821352486 +0100
18 +++ rawlog.c 2012-01-09 22:32:48.218647541 +0100
19 @@ -565,20 +565,25 @@
20 ** compressed raw file to be decompressed via gunzip
21 */
22 fprintf(stderr, "Decompressing logfile ....\n");
23 + snprintf(tmpname2, sizeof tmpname2, "/tmp/atopwrkXXXXXX");
24 + rawfd = mkstemp(tmpname2);
25 + if (rawfd == -1)
26 + {
27 + fprintf(stderr, "%s - ", rawname);
28 + perror("creating decompression temp file");
29 + cleanstop(7);
30 + }
31
32 - snprintf(tmpname2, sizeof tmpname2, "/tmp/atopwrk%d", getpid());
33 snprintf(command, sizeof command, "gunzip -c %s > %s",
34 tmpname1, tmpname2);
35 - system (command);
36 + const int system_res = system (command);
37 + unlink(tmpname2);
38
39 - if ( (rawfd = open(tmpname2, O_RDONLY)) == -1)
40 + if (system_res)
41 {
42 - fprintf(stderr, "%s - ", rawname);
43 - perror("open decompressed raw file");
44 + fprintf(stderr, "%s - gunzip failed", rawname);
45 cleanstop(7);
46 }
47 -
48 - unlink(tmpname2);
49 }
50
51 /*