From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D2332138334 for ; Wed, 28 Aug 2019 17:53:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D699DE0825; Wed, 28 Aug 2019 17:53:16 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BF48CE0825 for ; Wed, 28 Aug 2019 17:53:16 +0000 (UTC) Received: from localhost.localdomain (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 6AEC134A571; Wed, 28 Aug 2019 17:53:15 +0000 (UTC) From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org Cc: Zac Medico Subject: [gentoo-portage-dev] [PATCH] rsync: proxychains compatibility (bug 693026) Date: Wed, 28 Aug 2019 10:52:53 -0700 Message-Id: <20190828175253.11489-1-zmedico@gentoo.org> X-Mailer: git-send-email 2.21.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: e2edd523-8b04-4965-bf1c-e0fc7b1af29b X-Archives-Hash: c9098c69de3187b48aeee7d3d8ef306b 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 --- 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() -- 2.21.0