1 |
commit: 63ab8f5018576fc957feef2f1cc35fc7aabd12df |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 1 22:35:58 2017 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 1 22:36:29 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63ab8f50 |
7 |
|
8 |
sys-fs/ntfs3g: Revision bump to 2016.2.22-r2 to add patch for CVE-2017-0358 |
9 |
|
10 |
Gentoo-Bug: 607912 |
11 |
|
12 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
13 |
|
14 |
.../files/ntfs3g-2016.2.22-CVE-2017-0358.patch | 40 ++++++++++ |
15 |
sys-fs/ntfs3g/ntfs3g-2016.2.22-r2.ebuild | 91 ++++++++++++++++++++++ |
16 |
2 files changed, 131 insertions(+) |
17 |
|
18 |
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2016.2.22-CVE-2017-0358.patch b/sys-fs/ntfs3g/files/ntfs3g-2016.2.22-CVE-2017-0358.patch |
19 |
new file mode 100644 |
20 |
index 00000000..1ce7e9c |
21 |
--- /dev/null |
22 |
+++ b/sys-fs/ntfs3g/files/ntfs3g-2016.2.22-CVE-2017-0358.patch |
23 |
@@ -0,0 +1,40 @@ |
24 |
+diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c |
25 |
+index 0bb38f97..c6d1dad3 100644 |
26 |
+--- a/src/lowntfs-3g.c |
27 |
++++ b/src/lowntfs-3g.c |
28 |
+@@ -3827,13 +3827,14 @@ static fuse_fstype load_fuse_module(void) |
29 |
+ struct stat st; |
30 |
+ pid_t pid; |
31 |
+ const char *cmd = "/sbin/modprobe"; |
32 |
++ char *env = (char*)NULL; |
33 |
+ struct timespec req = { 0, 100000000 }; /* 100 msec */ |
34 |
+ fuse_fstype fstype; |
35 |
+ |
36 |
+ if (!stat(cmd, &st) && !geteuid()) { |
37 |
+ pid = fork(); |
38 |
+ if (!pid) { |
39 |
+- execl(cmd, cmd, "fuse", NULL); |
40 |
++ execle(cmd, cmd, "fuse", NULL, &env); |
41 |
+ _exit(1); |
42 |
+ } else if (pid != -1) |
43 |
+ waitpid(pid, NULL, 0); |
44 |
+diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c |
45 |
+index 268b0569..945fc0be 100644 |
46 |
+--- a/src/ntfs-3g.c |
47 |
++++ b/src/ntfs-3g.c |
48 |
+@@ -3612,13 +3612,14 @@ static fuse_fstype load_fuse_module(void) |
49 |
+ struct stat st; |
50 |
+ pid_t pid; |
51 |
+ const char *cmd = "/sbin/modprobe"; |
52 |
++ char *env = (char*)NULL; |
53 |
+ struct timespec req = { 0, 100000000 }; /* 100 msec */ |
54 |
+ fuse_fstype fstype; |
55 |
+ |
56 |
+ if (!stat(cmd, &st) && !geteuid()) { |
57 |
+ pid = fork(); |
58 |
+ if (!pid) { |
59 |
+- execl(cmd, cmd, "fuse", NULL); |
60 |
++ execle(cmd, cmd, "fuse", NULL, &env); |
61 |
+ _exit(1); |
62 |
+ } else if (pid != -1) |
63 |
+ waitpid(pid, NULL, 0); |
64 |
|
65 |
diff --git a/sys-fs/ntfs3g/ntfs3g-2016.2.22-r2.ebuild b/sys-fs/ntfs3g/ntfs3g-2016.2.22-r2.ebuild |
66 |
new file mode 100644 |
67 |
index 00000000..65d95f8 |
68 |
--- /dev/null |
69 |
+++ b/sys-fs/ntfs3g/ntfs3g-2016.2.22-r2.ebuild |
70 |
@@ -0,0 +1,91 @@ |
71 |
+# Copyright 1999-2017 Gentoo Foundation |
72 |
+# Distributed under the terms of the GNU General Public License v2 |
73 |
+ |
74 |
+EAPI=5 |
75 |
+inherit eutils linux-info udev toolchain-funcs libtool |
76 |
+ |
77 |
+MY_PN=${PN/3g/-3g} |
78 |
+MY_P=${MY_PN}_ntfsprogs-${PV} |
79 |
+ |
80 |
+DESCRIPTION="Open source read-write NTFS driver that runs under FUSE" |
81 |
+HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/" |
82 |
+SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz" |
83 |
+ |
84 |
+LICENSE="GPL-2" |
85 |
+# The subslot matches the SONAME major #. |
86 |
+SLOT="0/87" |
87 |
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux" |
88 |
+IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr" |
89 |
+ |
90 |
+RDEPEND="!<sys-apps/util-linux-2.20.1-r2 |
91 |
+ !sys-fs/ntfsprogs |
92 |
+ ntfsdecrypt? ( |
93 |
+ >=dev-libs/libgcrypt-1.2.2:0 |
94 |
+ >=net-libs/gnutls-1.4.4 |
95 |
+ ) |
96 |
+ external-fuse? ( >=sys-fs/fuse-2.8.0 )" |
97 |
+DEPEND="${RDEPEND} |
98 |
+ sys-apps/attr |
99 |
+ virtual/pkgconfig" |
100 |
+ |
101 |
+S="${WORKDIR}/${MY_P}" |
102 |
+ |
103 |
+DOCS="AUTHORS ChangeLog CREDITS README" |
104 |
+ |
105 |
+PATCHES=( |
106 |
+ "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch |
107 |
+ "${FILESDIR}"/${PN}-2016.2.22-sysmacros.patch #580136 |
108 |
+ "${FILESDIR}"/${PN}-2016.2.22-CVE-2017-0358.patch #607912 |
109 |
+) |
110 |
+ |
111 |
+pkg_setup() { |
112 |
+ if use external-fuse && use kernel_linux; then |
113 |
+ if kernel_is lt 2 6 9; then |
114 |
+ die "Your kernel is too old." |
115 |
+ fi |
116 |
+ CONFIG_CHECK="~FUSE_FS" |
117 |
+ FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g" |
118 |
+ linux-info_pkg_setup |
119 |
+ fi |
120 |
+} |
121 |
+ |
122 |
+src_prepare() { |
123 |
+ epatch "${PATCHES[@]}" |
124 |
+ # Keep the symlinks in the same place we put the main binaries. |
125 |
+ # Having them in / when all the progs are in /usr is pointless. |
126 |
+ sed -i \ |
127 |
+ -e 's:/sbin:$(sbindir):g' \ |
128 |
+ {ntfsprogs,src}/Makefile.in || die #578336 |
129 |
+ # Note: patches apply to Makefile.in, so don't run autotools here. |
130 |
+ elibtoolize |
131 |
+} |
132 |
+ |
133 |
+src_configure() { |
134 |
+ tc-ld-disable-gold |
135 |
+ econf \ |
136 |
+ --prefix="${EPREFIX}"/usr \ |
137 |
+ --exec-prefix="${EPREFIX}"/usr \ |
138 |
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \ |
139 |
+ $(use_enable debug) \ |
140 |
+ --enable-ldscript \ |
141 |
+ --disable-ldconfig \ |
142 |
+ $(use_enable acl posix-acls) \ |
143 |
+ $(use_enable xattr xattr-mappings) \ |
144 |
+ $(use_enable ntfsdecrypt crypto) \ |
145 |
+ $(use_enable ntfsprogs) \ |
146 |
+ $(use_enable ntfsprogs quarantined) \ |
147 |
+ --without-uuid \ |
148 |
+ --enable-extras \ |
149 |
+ $(use_enable static-libs static) \ |
150 |
+ --with-fuse=$(usex external-fuse external internal) |
151 |
+} |
152 |
+ |
153 |
+src_install() { |
154 |
+ default |
155 |
+ |
156 |
+ use suid && fperms u+s /usr/bin/${MY_PN} |
157 |
+ udev_dorules "${FILESDIR}"/99-ntfs3g.rules |
158 |
+ prune_libtool_files |
159 |
+ |
160 |
+ dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197 |
161 |
+} |