Gentoo Archives: gentoo-commits

From: "Kacper Kowalik (xarthisius)" <xarthisius@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-biology/mothur/files: mothur-1.13.0-overflows.patch mothur-1.13.0-makefile.patch
Date: Tue, 05 Oct 2010 08:27:15
Message-Id: 20101005082706.B98892003C@flycatcher.gentoo.org
1 xarthisius 10/10/05 08:27:06
2
3 Added: mothur-1.13.0-overflows.patch
4 mothur-1.13.0-makefile.patch
5 Log:
6 Fix buffer overflows and building with --as-needed wrt bug 339753. Thanks to Diego for the report. Correct dependencies. Drop old.
7
8 (Portage version: 2.2_rc88/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.1 sci-biology/mothur/files/mothur-1.13.0-overflows.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/mothur/files/mothur-1.13.0-overflows.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/mothur/files/mothur-1.13.0-overflows.patch?rev=1.1&content-type=text/plain
15
16 Index: mothur-1.13.0-overflows.patch
17 ===================================================================
18 Fix buffer overflows
19
20 http://www.mothur.org/forum/viewtopic.php?f=4&t=591
21
22 --- Mothur.source/filterseqscommand.cpp
23 +++ Mothur.source/filterseqscommand.cpp
24 @@ -305,8 +305,8 @@
25
26 //wait on chidren
27 for(int i = 1; i < processors; i++) {
28 - char buf[4];
29 - MPI_Recv(buf, 4, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
30 + char buf[5];
31 + MPI_Recv(buf, 5, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
32 }
33
34 }else { //you are a child process
35 @@ -326,11 +326,11 @@
36
37 if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); return 0; }
38
39 - char buf[4];
40 + char buf[5];
41 strcpy(buf, "done");
42
43 //tell parent you are done.
44 - MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
45 + MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
46 }
47
48 MPI_File_close(&outMPI);
49 --- Mothur.source/distancecommand.cpp
50 +++ Mothur.source/distancecommand.cpp
51 @@ -271,8 +271,8 @@
52 for(int i = 1; i < processors; i++) {
53 if (m->control_pressed) { MPI_File_close(&outMPI); delete distCalculator; return 0; }
54
55 - char buf[4];
56 - MPI_Recv(buf, 4, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
57 + char buf[5];
58 + MPI_Recv(buf, 5, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
59 }
60 }else { //you are a child process
61 //do your part
62 @@ -280,10 +280,10 @@
63
64 if (m->control_pressed) { MPI_File_close(&outMPI); delete distCalculator; return 0; }
65
66 - char buf[4];
67 + char buf[5];
68 strcpy(buf, "done");
69 //tell parent you are done.
70 - MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
71 + MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
72 }
73
74 MPI_File_close(&outMPI);
75 --- Mothur.source/chimeracheckcommand.cpp
76 +++ Mothur.source/chimeracheckcommand.cpp
77 @@ -269,8 +269,8 @@
78
79 //wait on chidren
80 for(int j = 1; j < processors; j++) {
81 - char buf[4];
82 - MPI_Recv(buf, 4, MPI_CHAR, j, tag, MPI_COMM_WORLD, &status);
83 + char buf[5];
84 + MPI_Recv(buf, 5, MPI_CHAR, j, tag, MPI_COMM_WORLD, &status);
85 }
86 }else{ //you are a child process
87 MPI_Recv(&numSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
88 @@ -288,9 +288,9 @@
89 if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; }
90
91 //tell parent you are done.
92 - char buf[4];
93 + char buf[5];
94 strcpy(buf, "done");
95 - MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
96 + MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
97 }
98
99 //close files
100
101
102
103 1.1 sci-biology/mothur/files/mothur-1.13.0-makefile.patch
104
105 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/mothur/files/mothur-1.13.0-makefile.patch?rev=1.1&view=markup
106 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/mothur/files/mothur-1.13.0-makefile.patch?rev=1.1&content-type=text/plain
107
108 Index: mothur-1.13.0-makefile.patch
109 ===================================================================
110 Fix build with --as-needed, respect CXX, CXXFLAGS
111
112 http://www.mothur.org/forum/viewtopic.php?f=4&t=590
113 http://bugs.gentoo.org/show_bug.cgi?id=339753
114
115 --- makefile
116 +++ makefile
117 @@ -11,7 +11,7 @@
118
119 # Optimize to level 3:
120
121 -CXXFLAGS += -O3
122 +#CXXFLAGS += -O3
123
124 MOTHUR_FILES = "\"Enter_your_default_path_here\""
125
126 @@ -49,7 +49,7 @@
127
128 ifeq ($(strip $(USEREADLINE)),yes)
129 CXXFLAGS += -DUSE_READLINE
130 - LDFLAGS += \
131 + LIBS = \
132 -lreadline\
133 -lncurses
134 endif
135 @@ -57,7 +57,7 @@
136 USEMPI ?= no
137
138 ifeq ($(strip $(USEMPI)),yes)
139 - CXX = mpic++
140 +# CXX = mpic++
141 CXXFLAGS += -DUSE_MPI
142 endif
143
144 @@ -74,7 +74,7 @@
145 OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
146
147 mothur : $(OBJECTS)
148 - $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS)
149 + $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS)
150
151 install : mothur
152 cp mothur ../Release/mothur