1 |
commit: 7ea06e6d87cd1394fe06c77ed5abad7f4497158d |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 28 17:42:51 2019 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 30 17:07:16 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7ea06e6d |
7 |
|
8 |
rsync: proxychains compatibility (bug 693026) |
9 |
|
10 |
Use the original hostname if it resolves to a single IP, since DNS |
11 |
lookup must occur in the rsync process for compatibility with things |
12 |
like proxychains that allocate a surrogate IP which is only valid |
13 |
within the current process. |
14 |
|
15 |
Bug: https://bugs.gentoo.org/693026 |
16 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
17 |
|
18 |
lib/portage/sync/modules/rsync/rsync.py | 7 +++++++ |
19 |
1 file changed, 7 insertions(+) |
20 |
|
21 |
diff --git a/lib/portage/sync/modules/rsync/rsync.py b/lib/portage/sync/modules/rsync/rsync.py |
22 |
index e6f2688f8..a40e1c854 100644 |
23 |
--- a/lib/portage/sync/modules/rsync/rsync.py |
24 |
+++ b/lib/portage/sync/modules/rsync/rsync.py |
25 |
@@ -283,6 +283,13 @@ class RsyncSync(NewBase): |
26 |
# With some configurations we need to use the plain hostname |
27 |
# rather than try to resolve the ip addresses (bug #340817). |
28 |
uris.append(syncuri) |
29 |
+ elif len(uris) == 1: |
30 |
+ # Use the original hostname if it resolves to a single IP, |
31 |
+ # since DNS lookup must occur in the rsync process for |
32 |
+ # compatibility with things like proxychains that allocate |
33 |
+ # a surrogate IP which is only valid within the current |
34 |
+ # process. |
35 |
+ uris = [syncuri] |
36 |
|
37 |
# reverse, for use with pop() |
38 |
uris.reverse() |