Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: net-misc/rsync/files/, net-misc/rsync/
Date: Mon, 29 Jan 2018 19:12:16
Message-Id: 1517253099.21c37337e1b7e515dc382632f14099a5e49bb3ee.lluixhi@gentoo
1 commit: 21c37337e1b7e515dc382632f14099a5e49bb3ee
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Mon Jan 29 19:11:39 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Mon Jan 29 19:11:39 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=21c37337
7
8 net-misc/rsync: sync with upstream
9
10 add metadata.xml
11
12 .../rsync/files/rsync-3.1.2-CVE-2017-16548.patch | 17 ++++++++++
13 .../files/rsync-3.1.2-CVE-2017-17433-fixup.patch | 33 ++++++++++++++++++
14 .../rsync/files/rsync-3.1.2-CVE-2017-17433.patch | 39 ++++++++++++++++++++++
15 .../files/rsync-3.1.2-CVE-2017-17434-part1.patch | 22 ++++++++++++
16 .../files/rsync-3.1.2-CVE-2017-17434-part2.patch | 33 ++++++++++++++++++
17 net-misc/rsync/metadata.xml | 14 ++++++++
18 net-misc/rsync/rsync-3.1.2-r2.ebuild | 31 ++++++++++-------
19 7 files changed, 177 insertions(+), 12 deletions(-)
20
21 diff --git a/net-misc/rsync/files/rsync-3.1.2-CVE-2017-16548.patch b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-16548.patch
22 new file mode 100644
23 index 0000000..d06607c
24 --- /dev/null
25 +++ b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-16548.patch
26 @@ -0,0 +1,17 @@
27 +X-Git-Url: https://git.samba.org/rsync.git/?p=rsync.git;a=blobdiff_plain;f=xattrs.c;h=4867e6f5b8ad2934d43b06f3b99b7b3690a6dc7a;hp=68305d7559b34f5cc2f196b74429b82fa6ff49dd;hb=47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1;hpb=bc112b0e7feece62ce98708092306639a8a53cce
28 +
29 +diff --git a/xattrs.c b/xattrs.c
30 +index 68305d7..4867e6f 100644
31 +--- a/xattrs.c
32 ++++ b/xattrs.c
33 +@@ -824,6 +824,10 @@ void receive_xattr(int f, struct file_struct *file)
34 + out_of_memory("receive_xattr");
35 + name = ptr + dget_len + extra_len;
36 + read_buf(f, name, name_len);
37 ++ if (name_len < 1 || name[name_len-1] != '\0') {
38 ++ rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n");
39 ++ exit_cleanup(RERR_FILEIO);
40 ++ }
41 + if (dget_len == datum_len)
42 + read_buf(f, ptr, dget_len);
43 + else {
44
45 diff --git a/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17433-fixup.patch b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17433-fixup.patch
46 new file mode 100644
47 index 0000000..0cc9b82
48 --- /dev/null
49 +++ b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17433-fixup.patch
50 @@ -0,0 +1,33 @@
51 +From: Wayne Davison <wayned@×××××.org>
52 +Date: Sun, 3 Dec 2017 23:49:56 +0000 (-0800)
53 +Subject: Fix issue with earlier path-check (fixes "make check")
54 +X-Git-Url: https://git.samba.org/?p=rsync.git;a=commitdiff_plain;h=f5e8a17e093065fb20fea00a29540fe2c7896441;hp=5509597decdbd7b91994210f700329d8a35e70a1
55 +
56 +Fix issue with earlier path-check (fixes "make check")
57 +---
58 +
59 +diff --git a/receiver.c b/receiver.c
60 +index 9c46242..75cb00d 100644
61 +--- a/receiver.c
62 ++++ b/receiver.c
63 +@@ -574,15 +574,15 @@ int recv_files(int f_in, int f_out, char *local_name)
64 + file = dir_flist->files[cur_flist->parent_ndx];
65 + fname = local_name ? local_name : f_name(file, fbuf);
66 +
67 +- if (daemon_filter_list.head
68 +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
69 ++ if (DEBUG_GTE(RECV, 1))
70 ++ rprintf(FINFO, "recv_files(%s)\n", fname);
71 ++
72 ++ if (daemon_filter_list.head && (*fname != '.' || fname[1] != '\0')
73 ++ && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
74 + rprintf(FERROR, "attempt to hack rsync failed.\n");
75 + exit_cleanup(RERR_PROTOCOL);
76 + }
77 +
78 +- if (DEBUG_GTE(RECV, 1))
79 +- rprintf(FINFO, "recv_files(%s)\n", fname);
80 +-
81 + #ifdef SUPPORT_XATTRS
82 + if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
83 + && !(want_xattr_optim && BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
84
85 diff --git a/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17433.patch b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17433.patch
86 new file mode 100644
87 index 0000000..0ab8de1
88 --- /dev/null
89 +++ b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17433.patch
90 @@ -0,0 +1,39 @@
91 +From 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 Mon Sep 17 00:00:00 2001
92 +From: Jeriko One <jeriko.one@×××.us>
93 +Date: Thu, 2 Nov 2017 23:44:19 -0700
94 +Subject: [PATCH] Check fname in recv_files sooner.
95 +
96 +---
97 + receiver.c | 12 ++++++------
98 + 1 file changed, 6 insertions(+), 6 deletions(-)
99 +
100 +Index: rsync-3.1.2/receiver.c
101 +===================================================================
102 +--- rsync-3.1.2.orig/receiver.c
103 ++++ rsync-3.1.2/receiver.c
104 +@@ -580,6 +580,12 @@ int recv_files(int f_in, int f_out, char
105 + file = dir_flist->files[cur_flist->parent_ndx];
106 + fname = local_name ? local_name : f_name(file, fbuf);
107 +
108 ++ if (daemon_filter_list.head
109 ++ && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
110 ++ rprintf(FERROR, "attempt to hack rsync failed.\n");
111 ++ exit_cleanup(RERR_PROTOCOL);
112 ++ }
113 ++
114 + if (DEBUG_GTE(RECV, 1))
115 + rprintf(FINFO, "recv_files(%s)\n", fname);
116 +
117 +@@ -651,12 +657,6 @@ int recv_files(int f_in, int f_out, char
118 +
119 + cleanup_got_literal = 0;
120 +
121 +- if (daemon_filter_list.head
122 +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
123 +- rprintf(FERROR, "attempt to hack rsync failed.\n");
124 +- exit_cleanup(RERR_PROTOCOL);
125 +- }
126 +-
127 + if (read_batch) {
128 + int wanted = redoing
129 + ? we_want_redo(ndx)
130
131 diff --git a/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17434-part1.patch b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17434-part1.patch
132 new file mode 100644
133 index 0000000..aeb8c2e
134 --- /dev/null
135 +++ b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17434-part1.patch
136 @@ -0,0 +1,22 @@
137 +From 5509597decdbd7b91994210f700329d8a35e70a1 Mon Sep 17 00:00:00 2001
138 +From: Jeriko One <jeriko.one@×××.us>
139 +Date: Thu, 16 Nov 2017 17:26:03 -0800
140 +Subject: [PATCH] Check daemon filter against fnamecmp in recv_files().
141 +
142 +---
143 + receiver.c | 2 +-
144 + 1 file changed, 1 insertion(+), 1 deletion(-)
145 +
146 +Index: rsync-3.1.2/receiver.c
147 +===================================================================
148 +--- rsync-3.1.2.orig/receiver.c
149 ++++ rsync-3.1.2/receiver.c
150 +@@ -728,7 +728,7 @@ int recv_files(int f_in, int f_out, char
151 + break;
152 + }
153 + if (!fnamecmp || (daemon_filter_list.head
154 +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) {
155 ++ && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) {
156 + fnamecmp = fname;
157 + fnamecmp_type = FNAMECMP_FNAME;
158 + }
159
160 diff --git a/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17434-part2.patch b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17434-part2.patch
161 new file mode 100644
162 index 0000000..5b94efa
163 --- /dev/null
164 +++ b/net-misc/rsync/files/rsync-3.1.2-CVE-2017-17434-part2.patch
165 @@ -0,0 +1,33 @@
166 +From 70aeb5fddd1b2f8e143276f8d5a085db16c593b9 Mon Sep 17 00:00:00 2001
167 +From: Jeriko One <jeriko.one@×××.us>
168 +Date: Thu, 16 Nov 2017 17:05:42 -0800
169 +Subject: [PATCH] Sanitize xname in read_ndx_and_attrs.
170 +
171 +---
172 + rsync.c | 6 ++++++
173 + 1 file changed, 6 insertions(+)
174 +
175 +Index: rsync-3.1.2/rsync.c
176 +===================================================================
177 +--- rsync-3.1.2.orig/rsync.c
178 ++++ rsync-3.1.2/rsync.c
179 +@@ -50,6 +50,7 @@ extern int flist_eof;
180 + extern int file_old_total;
181 + extern int keep_dirlinks;
182 + extern int make_backups;
183 ++extern int sanitize_paths;
184 + extern struct file_list *cur_flist, *first_flist, *dir_flist;
185 + extern struct chmod_mode_struct *daemon_chmod_modes;
186 + #ifdef ICONV_OPTION
187 +@@ -397,6 +398,11 @@ int read_ndx_and_attrs(int f_in, int f_o
188 + if (iflags & ITEM_XNAME_FOLLOWS) {
189 + if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0)
190 + exit_cleanup(RERR_PROTOCOL);
191 ++
192 ++ if (sanitize_paths) {
193 ++ sanitize_path(buf, buf, "", 0, SP_DEFAULT);
194 ++ len = strlen(buf);
195 ++ }
196 + } else {
197 + *buf = '\0';
198 + len = -1;
199
200 diff --git a/net-misc/rsync/metadata.xml b/net-misc/rsync/metadata.xml
201 new file mode 100644
202 index 0000000..148a18e
203 --- /dev/null
204 +++ b/net-misc/rsync/metadata.xml
205 @@ -0,0 +1,14 @@
206 +<?xml version="1.0" encoding="UTF-8"?>
207 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
208 +<pkgmetadata>
209 + <maintainer type="project">
210 + <email>base-system@g.o</email>
211 + <name>Gentoo Base System</name>
212 + </maintainer>
213 + <upstream>
214 + <remote-id type="cpe">cpe:/a:samba:rsync</remote-id>
215 + </upstream>
216 + <use>
217 + <flag name="stunnel">Provide helper scripts for using rsync via &gt;=net-misc/stunnel-4</flag>
218 + </use>
219 +</pkgmetadata>
220
221 diff --git a/net-misc/rsync/rsync-3.1.2-r2.ebuild b/net-misc/rsync/rsync-3.1.2-r2.ebuild
222 index 08473b5..2302d9a 100644
223 --- a/net-misc/rsync/rsync-3.1.2-r2.ebuild
224 +++ b/net-misc/rsync/rsync-3.1.2-r2.ebuild
225 @@ -1,21 +1,21 @@
226 -# Copyright 1999-2017 Gentoo Foundation
227 +# Copyright 1999-2018 Gentoo Foundation
228 # Distributed under the terms of the GNU General Public License v2
229
230 -EAPI=6
231 +EAPI="6"
232
233 inherit eutils flag-o-matic prefix systemd
234
235 DESCRIPTION="File transfer program to keep remote files into sync"
236 -HOMEPAGE="http://rsync.samba.org/"
237 -SRC_URI="http://rsync.samba.org/ftp/rsync/src/${P}.tar.gz"
238 -[[ "${PV}" = *_pre* ]] && SRC_URI="http://rsync.samba.org/ftp/rsync/src-previews/${P/_/}.tar.gz"
239 +HOMEPAGE="https://rsync.samba.org/"
240 +SRC_URI="https://rsync.samba.org/ftp/rsync/src/${P}.tar.gz"
241 +[[ "${PV}" = *_pre* ]] && SRC_URI="https://rsync.samba.org/ftp/rsync/src-previews/${P/_/}.tar.gz"
242
243 LICENSE="GPL-3"
244 SLOT="0"
245 if [[ ${PV} != *_pre ]] ; then
246 -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
247 +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
248 fi
249 -IUSE="acl iconv ipv6 static stunnel xattr"
250 +IUSE="acl examples iconv ipv6 static stunnel xattr"
251
252 LIB_DEPEND="acl? ( virtual/acl[static-libs(+)] )
253 xattr? ( kernel_linux? ( sys-apps/attr[static-libs(+)] ) )
254 @@ -25,12 +25,17 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
255 DEPEND="${RDEPEND}
256 static? ( ${LIB_DEPEND} )"
257
258 -S=${WORKDIR}/${P/_/}
259 -
260 PATCHES=(
261 + "${FILESDIR}"/${PN}-3.1.2-CVE-2017-16548.patch
262 + "${FILESDIR}"/${PN}-3.1.2-CVE-2017-17433.patch
263 + "${FILESDIR}"/${PN}-3.1.2-CVE-2017-17434-part1.patch
264 + "${FILESDIR}"/${PN}-3.1.2-CVE-2017-17434-part2.patch
265 + "${FILESDIR}"/${PN}-3.1.2-CVE-2017-17433-fixup.patch
266 "${FILESDIR}"/${PN}-fix-musl-ipv6.patch
267 )
268
269 +S=${WORKDIR}/${P/_/}
270 +
271 src_configure() {
272 use static && append-ldflags -static
273 econf \
274 @@ -64,9 +69,11 @@ src_install() {
275 fi
276
277 # Install the useful contrib scripts
278 - exeinto /usr/share/rsync
279 - doexe support/*
280 - rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
281 + if use examples ; then
282 + exeinto /usr/share/rsync
283 + doexe support/*
284 + rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
285 + fi
286
287 eprefixify "${ED}"/etc/{,xinetd.d}/rsyncd*