Wed Feb 4 04:52:46 2009 UTC ()
Note upstream tracker url (thanks to obache for filing it!)


(dholland)
diff -r1.25 -r1.26 pkgsrc/sysutils/gentoo/distinfo
diff -r1.5 -r1.6 pkgsrc/sysutils/gentoo/patches/patch-ae

cvs diff -r1.25 -r1.26 pkgsrc/sysutils/gentoo/distinfo (switch to unified diff)

--- pkgsrc/sysutils/gentoo/distinfo 2009/01/26 04:54:50 1.25
+++ pkgsrc/sysutils/gentoo/distinfo 2009/02/04 04:52:46 1.26
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: distinfo,v 1.25 2009/01/26 04:54:50 dholland Exp $ 1$NetBSD: distinfo,v 1.26 2009/02/04 04:52:46 dholland Exp $
2 2
3SHA1 (gentoo-0.11.57.tar.gz) = ac5859b489a6b88161d5b0f2ddd06490ce9915eb 3SHA1 (gentoo-0.11.57.tar.gz) = ac5859b489a6b88161d5b0f2ddd06490ce9915eb
4RMD160 (gentoo-0.11.57.tar.gz) = 675333aa740f297a0d41d5795689b8e4280d2bdf 4RMD160 (gentoo-0.11.57.tar.gz) = 675333aa740f297a0d41d5795689b8e4280d2bdf
5Size (gentoo-0.11.57.tar.gz) = 1479376 bytes 5Size (gentoo-0.11.57.tar.gz) = 1479376 bytes
6SHA1 (patch-aa) = 5d8f1fcd4110b09e02f44584e2ccd921a7175929 6SHA1 (patch-aa) = 5d8f1fcd4110b09e02f44584e2ccd921a7175929
7SHA1 (patch-ab) = e84931dbc57434881f8071e389ebe8df061ee0b6 7SHA1 (patch-ab) = e84931dbc57434881f8071e389ebe8df061ee0b6
8SHA1 (patch-ac) = 4e5d52849887b816eb4388fb2c75aefb3443f5c8 8SHA1 (patch-ac) = 4e5d52849887b816eb4388fb2c75aefb3443f5c8
9SHA1 (patch-ad) = 7e41b435aff7af5e57bfb82902a6bb88af37ad97 9SHA1 (patch-ad) = 7e41b435aff7af5e57bfb82902a6bb88af37ad97
10SHA1 (patch-ae) = 92ddda6d990f7670e0b79cc642981948fdcce348 10SHA1 (patch-ae) = 6009cce4f1c6aac47881f98de08417626d803ddf
11SHA1 (patch-af) = 2b80f24bd545177b0d089696e7b3ed7f0d72a3b0 11SHA1 (patch-af) = 2b80f24bd545177b0d089696e7b3ed7f0d72a3b0
12SHA1 (patch-ag) = 3045a4eb72f8c50d147fe09256ec791359053418 12SHA1 (patch-ag) = 3045a4eb72f8c50d147fe09256ec791359053418
13SHA1 (patch-ah) = c14c80a7c821f69b98cb23156ec5b30ac40ed2ec 13SHA1 (patch-ah) = c14c80a7c821f69b98cb23156ec5b30ac40ed2ec

cvs diff -r1.5 -r1.6 pkgsrc/sysutils/gentoo/patches/Attic/patch-ae (switch to unified diff)

--- pkgsrc/sysutils/gentoo/patches/Attic/patch-ae 2009/01/26 04:54:50 1.5
+++ pkgsrc/sysutils/gentoo/patches/Attic/patch-ae 2009/02/04 04:52:46 1.6
@@ -1,111 +1,111 @@ @@ -1,111 +1,111 @@
1$NetBSD: patch-ae,v 1.5 2009/01/26 04:54:50 dholland Exp $ 1$NetBSD: patch-ae,v 1.6 2009/02/04 04:52:46 dholland Exp $
2 2
3Fix insecure-temp-files. Replaces older nonworking patch with similar 3Fix insecure-temp-files. Replaces older nonworking patch with similar
4intent. XXX inadequately tested, lack of time. 4intent. XXX inadequately tested, lack of time.
5 5
6Upstream: not sent upstream; inadequately tested, lack of time. 6Upstream: sent upstream by obache@: http://sourceforge.net/tracker/?func=detail&atid=406763&aid=2537314&group_id=32880
7 7
8--- src/types.c.orig 2008-07-09 15:51:26.000000000 -0400 8--- src/types.c.orig 2008-07-09 15:51:26.000000000 -0400
9+++ src/types.c 2009-01-25 23:36:47.000000000 -0500 9+++ src/types.c 2009-01-25 23:36:47.000000000 -0500
10@@ -27,6 +27,7 @@ 10@@ -27,6 +27,7 @@
11 #include <signal.h> 11 #include <signal.h>
12 #include <sys/wait.h> 12 #include <sys/wait.h>
13 #include <unistd.h> 13 #include <unistd.h>
14+#include <paths.h> 14+#include <paths.h>
15  15
16 #include <stddef.h> 16 #include <stddef.h>
17  17
18@@ -345,14 +346,18 @@ static FType * match_file(GList *list, D 18@@ -345,14 +346,18 @@ static FType * match_file(GList *list, D
19 void typ_identify_end(MainInfo *min, const gchar *path) 19 void typ_identify_end(MainInfo *min, const gchar *path)
20 { 20 {
21 const GList *here; 21 const GList *here;
22- gchar buf[MAXNAMLEN + 2], *temp_name; 22- gchar buf[MAXNAMLEN + 2], *temp_name;
23+ gchar buf[MAXNAMLEN + 2]; 23+ gchar buf[MAXNAMLEN + 2];
24 gint fd[2], len, status; 24 gint fd[2], len, status;
25 pid_t file_pid; 25 pid_t file_pid;
26 FType *type; 26 FType *type;
27+ char tempnamebuf[64]; 27+ char tempnamebuf[64];
28+ int tempfd; 28+ int tempfd;
29  29
30 if(file_list == NULL) 30 if(file_list == NULL)
31 return; 31 return;
32- if((temp_name = tmpnam(NULL)) == NULL) 32- if((temp_name = tmpnam(NULL)) == NULL)
33+ strcpy(tempnamebuf, _PATH_TMP "gentoo.XXXXXX"); 33+ strcpy(tempnamebuf, _PATH_TMP "gentoo.XXXXXX");
34+ tempfd = mkstemp(tempnamebuf); 34+ tempfd = mkstemp(tempnamebuf);
35+ if (tempfd < 0) 35+ if (tempfd < 0)
36 return; 36 return;
37 if(pipe(fd) != 0) 37 if(pipe(fd) != 0)
38 return; 38 return;
39@@ -360,20 +365,16 @@ void typ_identify_end(MainInfo *min, con 39@@ -360,20 +365,16 @@ void typ_identify_end(MainInfo *min, con
40 file_pid = fork(); 40 file_pid = fork();
41 if(file_pid == 0) 41 if(file_pid == 0)
42 { 42 {
43- guint bits = 0U; 43- guint bits = 0U;
44- 44-
45- if(close(STDIN_FILENO) == 0) 45- if(close(STDIN_FILENO) == 0)
46- { 46- {
47- if(dup(fd[STDIN_FILENO]) == STDIN_FILENO) 47- if(dup(fd[STDIN_FILENO]) == STDIN_FILENO)
48- bits |= (close(fd[STDIN_FILENO]) == 0); 48- bits |= (close(fd[STDIN_FILENO]) == 0);
49- } 49- }
50- if(close(STDOUT_FILENO) == 0) 50- if(close(STDOUT_FILENO) == 0)
51- { 51- {
52- if(open(temp_name, O_CREAT | O_RDWR, S_IRWXU) == STDOUT_FILENO) 52- if(open(temp_name, O_CREAT | O_RDWR, S_IRWXU) == STDOUT_FILENO)
53- bits |= (close(fd[STDOUT_FILENO]) == 0) << 1; 53- bits |= (close(fd[STDOUT_FILENO]) == 0) << 1;
54- } 54- }
55- if(bits == 3U && chdir(path) == 0) 55- if(bits == 3U && chdir(path) == 0)
56- execlp("file", "file", "-f", "-", NULL); 56- execlp("file", "file", "-f", "-", NULL);
57+ if (dup2(fd[0], STDIN_FILENO) < 0) 57+ if (dup2(fd[0], STDIN_FILENO) < 0)
58+ _exit(EXIT_FAILURE); 58+ _exit(EXIT_FAILURE);
59+ if (dup2(tempfd, STDOUT_FILENO) < 0) 59+ if (dup2(tempfd, STDOUT_FILENO) < 0)
60+ _exit(EXIT_FAILURE); 60+ _exit(EXIT_FAILURE);
61+ close(fd[0]); 61+ close(fd[0]);
62+ close(fd[1]); 62+ close(fd[1]);
63+ close(tempfd); 63+ close(tempfd);
64+ if (chdir(path) < 0) 64+ if (chdir(path) < 0)
65+ _exit(EXIT_FAILURE); 65+ _exit(EXIT_FAILURE);
66+ execlp("file", "file", "-f", "-", NULL); 66+ execlp("file", "file", "-f", "-", NULL);
67 _exit(EXIT_FAILURE); 67 _exit(EXIT_FAILURE);
68 } 68 }
69 else if(file_pid < 0) 69 else if(file_pid < 0)
70@@ -382,21 +381,21 @@ void typ_identify_end(MainInfo *min, con 70@@ -382,21 +381,21 @@ void typ_identify_end(MainInfo *min, con
71 return; 71 return;
72 } 72 }
73 /* We don't need the input part of the pipe, so close it. */ 73 /* We don't need the input part of the pipe, so close it. */
74- close(fd[STDIN_FILENO]); 74- close(fd[STDIN_FILENO]);
75+ close(fd[0]); 75+ close(fd[0]);
76 /* Now, we have file listening on pipe, so write all filenames to it. */ 76 /* Now, we have file listening on pipe, so write all filenames to it. */
77 for(here = file_list; here != NULL; here = g_list_next(here)) 77 for(here = file_list; here != NULL; here = g_list_next(here))
78 { 78 {
79 len = g_snprintf(buf, sizeof buf, "%s\n", DP_SEL_NAME(here)); 79 len = g_snprintf(buf, sizeof buf, "%s\n", DP_SEL_NAME(here));
80- write(fd[STDOUT_FILENO], buf, len); 80- write(fd[STDOUT_FILENO], buf, len);
81+ write(fd[1], buf, len); 81+ write(fd[1], buf, len);
82 } 82 }
83- close(fd[STDOUT_FILENO]); 83- close(fd[STDOUT_FILENO]);
84+ close(fd[1]); 84+ close(fd[1]);
85 waitpid(file_pid, &status, 0); 85 waitpid(file_pid, &status, 0);
86  86
87 if(WIFEXITED(status)) 87 if(WIFEXITED(status))
88 { 88 {
89 FILE *in; 89 FILE *in;
90  90
91- if((in = fopen(temp_name, "rt")) != NULL) 91- if((in = fopen(temp_name, "rt")) != NULL)
92+ if((in = fdopen(tempfd, "rt")) != NULL) 92+ if((in = fdopen(tempfd, "rt")) != NULL)
93 { 93 {
94 const gchar *fout; 94 const gchar *fout;
95 gchar line[MAXNAMLEN + 256]; 95 gchar line[MAXNAMLEN + 256];
96@@ -412,10 +411,14 @@ void typ_identify_end(MainInfo *min, con 96@@ -412,10 +411,14 @@ void typ_identify_end(MainInfo *min, con
97 } 97 }
98 fclose(in); 98 fclose(in);
99 } 99 }
100+ else 100+ else
101+ close(tempfd); 101+ close(tempfd);
102 } 102 }
103+ else 103+ else
104+ close(tempfd); 104+ close(tempfd);
105 g_list_free(file_list); 105 g_list_free(file_list);
106 file_list = NULL; 106 file_list = NULL;
107- remove(temp_name); 107- remove(temp_name);
108+ remove(tempnamebuf); 108+ remove(tempnamebuf);
109 } 109 }
110  110
111 /* ----------------------------------------------------------------------------------------- */ 111 /* ----------------------------------------------------------------------------------------- */