Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] rsync: proxychains compatibility (bug 693026)
Date: Wed, 28 Aug 2019 17:53:17
Message-Id: 20190828175253.11489-1-zmedico@gentoo.org
1 Use the original hostname if it resolves to a single IP, since DNS
2 lookup must occur in the rsync process for compatibility with things
3 like proxychains that allocate a surrogate IP which is only valid
4 within the current process.
5
6 Bug: https://bugs.gentoo.org/693026
7 Signed-off-by: Zac Medico <zmedico@g.o>
8 ---
9 lib/portage/sync/modules/rsync/rsync.py | 7 +++++++
10 1 file changed, 7 insertions(+)
11
12 diff --git a/lib/portage/sync/modules/rsync/rsync.py b/lib/portage/sync/modules/rsync/rsync.py
13 index e6f2688f8..a40e1c854 100644
14 --- a/lib/portage/sync/modules/rsync/rsync.py
15 +++ b/lib/portage/sync/modules/rsync/rsync.py
16 @@ -283,6 +283,13 @@ class RsyncSync(NewBase):
17 # With some configurations we need to use the plain hostname
18 # rather than try to resolve the ip addresses (bug #340817).
19 uris.append(syncuri)
20 + elif len(uris) == 1:
21 + # Use the original hostname if it resolves to a single IP,
22 + # since DNS lookup must occur in the rsync process for
23 + # compatibility with things like proxychains that allocate
24 + # a surrogate IP which is only valid within the current
25 + # process.
26 + uris = [syncuri]
27
28 # reverse, for use with pop()
29 uris.reverse()
30 --
31 2.21.0