public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH] _hide_url_passwd: replace all occurrences (bug 713726)
@ 2020-03-22 21:52 99% Zac Medico
  0 siblings, 0 replies; 1+ results
From: Zac Medico @ 2020-03-22 21:52 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

Adjust the regular expression to avoid overly-greedy .+ groups,
so that is will properly replace all occurrences, as necessary
for the purposes of bug 713726 since PORTAGE_BINHOST may contain
multiple values.

Bug: https://bugs.gentoo.org/713726
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 lib/portage/package/ebuild/fetch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
index f7984130f..28e7caf53 100644
--- a/lib/portage/package/ebuild/fetch.py
+++ b/lib/portage/package/ebuild/fetch.py
@@ -67,7 +67,7 @@ _userpriv_spawn_kwargs = (
 )
 
 def _hide_url_passwd(url):
-	return re.sub(r'//(.+):.+@(.+)', r'//\1:*password*@\2', url)
+	return re.sub(r'//([^:\s]+):[^@\s]+@', r'//\1:*password*@', url)
 
 
 def _want_userfetch(settings):
-- 
2.24.1



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-03-22 21:52 99% [gentoo-portage-dev] [PATCH] _hide_url_passwd: replace all occurrences (bug 713726) Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox