1 |
commit: 15848c4175bd2c42967e5f09128a600f376febd3 |
2 |
Author: Justin Lecher <jlec <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 25 10:38:04 2015 +0000 |
4 |
Commit: Justin Lecher <jlec <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 25 10:38:04 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15848c41 |
7 |
|
8 |
sci-biology/t-coffee: Import fix for CVE-2015-8621 |
9 |
|
10 |
Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=569650 |
11 |
|
12 |
Package-Manager: portage-2.2.26 |
13 |
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org> |
14 |
|
15 |
.../t-coffee/files/t-coffee-11.00-mayhem.patch | 25 ++++++++++++++++ |
16 |
...t-coffee-11.00-set_proper_dir_permissions.patch | 35 ++++++++++++++++++++++ |
17 |
...offee-11.00.ebuild => t-coffee-11.00-r1.ebuild} | 3 ++ |
18 |
3 files changed, 63 insertions(+) |
19 |
|
20 |
diff --git a/sci-biology/t-coffee/files/t-coffee-11.00-mayhem.patch b/sci-biology/t-coffee/files/t-coffee-11.00-mayhem.patch |
21 |
new file mode 100644 |
22 |
index 0000000..cbfeeab |
23 |
--- /dev/null |
24 |
+++ b/sci-biology/t-coffee/files/t-coffee-11.00-mayhem.patch |
25 |
@@ -0,0 +1,25 @@ |
26 |
+Author: Andreas Tille <tille@××××××.org> |
27 |
+Last-Update: Mon, 21 Dec 2015 21:30:36 +0100 |
28 |
+Bug-Debian: https://bugs.debian.org/716373 |
29 |
+Description: Fix Mayhem issue |
30 |
+ The idea behind this patch is that if there is a problem to set the HOME |
31 |
+ directories no additional processes can exist and so we should *really* |
32 |
+ exit. Somehow the printf_exit() function does some logic which ends up |
33 |
+ in an endless loop and thus forcing the exit will help here. |
34 |
+ . |
35 |
+ Unfortunately this does not solve the issue completely since inside the |
36 |
+ Exit call a "Segmentation fault" happens - so some broken pointer handling |
37 |
+ seems to happen somewhere before. |
38 |
+ |
39 |
+--- a/t_coffee_source/util_lib/util.c |
40 |
++++ b/t_coffee_source/util_lib/util.c |
41 |
+@@ -4642,7 +4642,8 @@ char *get_home_4_tcoffee () |
42 |
+ } |
43 |
+ else |
44 |
+ { |
45 |
+- printf_exit (EXIT_FAILURE, stderr, "ERROR: Could not set a HOME directory.\nSet any of the following environement variables to some suitable location: HOME, HOME_4_TCOFFEE, TMP or TEMP [FATAL:%s]\n", PROGRAM); |
46 |
++ fprintf(stderr, "ERROR: Could not set a HOME directory.\nSet any of the following environement variables to some suitable location: HOME, HOME_4_TCOFFEE, TMP or TEMP [FATAL:%s]\n", PROGRAM); |
47 |
++ exit(EXIT_FAILURE); |
48 |
+ } |
49 |
+ |
50 |
+ |
51 |
|
52 |
diff --git a/sci-biology/t-coffee/files/t-coffee-11.00-set_proper_dir_permissions.patch b/sci-biology/t-coffee/files/t-coffee-11.00-set_proper_dir_permissions.patch |
53 |
new file mode 100644 |
54 |
index 0000000..a3f47cd |
55 |
--- /dev/null |
56 |
+++ b/sci-biology/t-coffee/files/t-coffee-11.00-set_proper_dir_permissions.patch |
57 |
@@ -0,0 +1,35 @@ |
58 |
+Author: Andreas Tille <tille@××××××.org> |
59 |
+Last-Update: Mon, 21 Dec 2015 21:30:36 +0100 |
60 |
+Bug-Debian: https://bugs.debian.org/751579 |
61 |
+Description: When creating subdirectories in $HOME do not |
62 |
+ make these world writable but keep users umask |
63 |
+ |
64 |
+--- a/t_coffee_source/util_lib/util.c |
65 |
++++ b/t_coffee_source/util_lib/util.c |
66 |
+@@ -7714,6 +7714,10 @@ int my_mkdir ( char *dir_in) |
67 |
+ int a, buf; |
68 |
+ char *dir; |
69 |
+ |
70 |
++ static char *home = getenv ("HOME"); |
71 |
++ static mode_t oldmask = umask(0); |
72 |
++ int change_umask = 0; |
73 |
++ if (strncmp (dir_in, home, strlen(home))==0) change_umask = 1; |
74 |
+ |
75 |
+ dir=(char*)vcalloc ( strlen (dir_in)+strlen (get_home_4_tcoffee())+100, sizeof (char)); |
76 |
+ sprintf ( dir, "%s", dir_in); |
77 |
+@@ -7733,10 +7737,11 @@ int my_mkdir ( char *dir_in) |
78 |
+ |
79 |
+ if (access(dir, F_OK)==-1) |
80 |
+ { |
81 |
+- mode_t oldmask = umask(0); |
82 |
+- mkdir (dir, S_IRWXU | S_IRWXG | S_IRWXO); |
83 |
+- umask(oldmask); |
84 |
+- |
85 |
++ if ( change_umask == 1 ) mkdir (dir, 0777-oldmask); |
86 |
++ else { |
87 |
++ mkdir (dir, S_IRWXU | S_IRWXG | S_IRWXO); |
88 |
++ umask(oldmask); |
89 |
++ } |
90 |
+ if ( access (dir, F_OK)==-1) |
91 |
+ { |
92 |
+ myexit(fprintf_error ( stderr, "\nERROR: Could Not Create Directory %s [FATAL:%s]", dir, PROGRAM)); } |
93 |
|
94 |
diff --git a/sci-biology/t-coffee/t-coffee-11.00.ebuild b/sci-biology/t-coffee/t-coffee-11.00-r1.ebuild |
95 |
similarity index 92% |
96 |
rename from sci-biology/t-coffee/t-coffee-11.00.ebuild |
97 |
rename to sci-biology/t-coffee/t-coffee-11.00-r1.ebuild |
98 |
index 62e8b70..3f2861c 100644 |
99 |
--- a/sci-biology/t-coffee/t-coffee-11.00.ebuild |
100 |
+++ b/sci-biology/t-coffee/t-coffee-11.00-r1.ebuild |
101 |
@@ -31,6 +31,9 @@ src_prepare() { |
102 |
-e '/@/s:.*;:\t:g' \ |
103 |
-e '/Linking/s:$(CC):$(CC) $(CFLAGS) $(LDFLAGS):g' \ |
104 |
-i t_coffee_source/makefile || die |
105 |
+ epatch \ |
106 |
+ "${FILESDIR}"/${P}-mayhem.patch \ |
107 |
+ "${FILESDIR}"/${P}-set_proper_dir_permissions.patch |
108 |
} |
109 |
|
110 |
src_compile() { |