commit:     7ea06e6d87cd1394fe06c77ed5abad7f4497158d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 28 17:42:51 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 30 17:07:16 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7ea06e6d

rsync: proxychains compatibility (bug 693026)

Use the original hostname if it resolves to a single IP, since DNS
lookup must occur in the rsync process for compatibility with things
like proxychains that allocate a surrogate IP which is only valid
within the current process.

Bug: https://bugs.gentoo.org/693026
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/sync/modules/rsync/rsync.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/portage/sync/modules/rsync/rsync.py 
b/lib/portage/sync/modules/rsync/rsync.py
index e6f2688f8..a40e1c854 100644
--- a/lib/portage/sync/modules/rsync/rsync.py
+++ b/lib/portage/sync/modules/rsync/rsync.py
@@ -283,6 +283,13 @@ class RsyncSync(NewBase):
                                # With some configurations we need to use the 
plain hostname
                                # rather than try to resolve the ip addresses 
(bug #340817).
                                uris.append(syncuri)
+                       elif len(uris) == 1:
+                               # Use the original hostname if it resolves to a 
single IP,
+                               # since DNS lookup must occur in the rsync 
process for
+                               # compatibility with things like proxychains 
that allocate
+                               # a surrogate IP which is only valid within the 
current
+                               # process.
+                               uris = [syncuri]
 
                        # reverse, for use with pop()
                        uris.reverse()

Reply via email to