* [gentoo-portage-dev] [PATCH] _hide_url_passwd: replace all occurrences (bug 713726)
@ 2020-03-22 21:52 Zac Medico
0 siblings, 0 replies; only message in thread
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 [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-22 21:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-22 21:52 [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