From 53866cc5f2a7a9c65462ebe00c70f8e9120bb076 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:23:48 +0000 Subject: Allow submitting with URLs containing usernames The allowed submit URLs were being compared without stripping usernames. --- create-srpm | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit v1.2.1