Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141185 - emerge uses incorrect regex to parse syncuri
Summary: emerge uses incorrect regex to parse syncuri
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 136244
  Show dependency tree
 
Reported: 2006-07-20 09:02 UTC by Thomas Cort (RETIRED)
Modified: 2006-08-06 04:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix for emerge to accept usernames (emerge_rsync_user.patch,838 bytes, patch)
2006-08-05 00:35 UTC, David-John Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Cort (RETIRED) gentoo-dev 2006-07-20 09:02:37 UTC
On line 2627 of bin/emerge the following regular expression is used to get the hostname and port from syncuri:

     hostname, port=re.split("rsync://([^:/]*)(:[0-9]+)?", syncuri)[1:3];

If you look at `man rsync`, rsync URIs can contain a username. rsync://tcort@rsync.somehost.com/gentoo-portage is a valid URI that rsync understands. Someone might have a username in SYNC if he or she has a private password protected rsync server. The regular expression above puts both the username and hostname into the hostname variable.

The incorrect regular expression causes an exception in the block of code near line 2646 when the SYNC contains the username. The `emerge --sync` continues to work without a problem because the exception handler sets dosyncuri=syncuri.
Comment 1 David-John Miller 2006-08-05 00:35:55 UTC
Created attachment 93482 [details, diff]
Fix for emerge to accept usernames

This fixes the regular expression and puts the username back in after getting the ip of the host
Comment 2 Zac Medico gentoo-dev 2006-08-06 01:06:39 UTC
Thanks, this is in svn r4179.
Comment 3 Zac Medico gentoo-dev 2006-08-06 04:16:16 UTC
This has been released in 2.1.1_pre4-r4.