diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2008-07-17 12:23:48 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2008-07-17 12:23:48 +0000 |
commit | 53866cc5f2a7a9c65462ebe00c70f8e9120bb076 (patch) | |
tree | 61e044ee4491c0e0679c65791cfc2cac9613c50f | |
parent | 3e8f299463066309321f5356831e6fd45e371660 (diff) | |
download | mgarepo-53866cc5f2a7a9c65462ebe00c70f8e9120bb076.tar mgarepo-53866cc5f2a7a9c65462ebe00c70f8e9120bb076.tar.gz mgarepo-53866cc5f2a7a9c65462ebe00c70f8e9120bb076.tar.bz2 mgarepo-53866cc5f2a7a9c65462ebe00c70f8e9120bb076.tar.xz mgarepo-53866cc5f2a7a9c65462ebe00c70f8e9120bb076.zip |
Allow submitting with URLs containing usernames
The allowed submit URLs were being compared without stripping usernames.
-rwxr-xr-x | create-srpm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/create-srpm b/create-srpm index 868ac27..bc4ba06 100755 --- a/create-srpm +++ b/create-srpm @@ -9,9 +9,18 @@ import os import pwd import optparse import subprocess +import urlparse +import urllib class CmdError(Error): pass +def strip_username(url): + parsed = list(urlparse.urlparse(url)) + userpwd, hostport = urllib.splituser(parsed[1]) + parsed[1] = hostport + newurl = urlparse.urlunparse(parsed) + return newurl + class CmdIface: def author_email(self, author): return config.get("users", author) @@ -33,6 +42,7 @@ class CmdIface: else: raise CmdError, "target not found" for url in urls: + url = strip_username(url) for allowed in target.allowed: if url.startswith(allowed): break |