allow use of wildcards in the allowed_scms config parameter

This commit is contained in:
Mike Bonnet 2008-06-03 13:35:57 -04:00
parent 004c3a92dc
commit 676311e721
2 changed files with 3 additions and 2 deletions

View file

@ -1825,7 +1825,7 @@ class BuildSRPMFromSCMTask(BaseTaskHandler):
for allowed_scm in options.allowed_scms.split():
scm_tuple = allowed_scm.split(':')
if len(scm_tuple) == 2:
if scm.host == scm_tuple[0] and scm.repository == scm_tuple[1]:
if fnmatch(scm.host, scm_tuple[0]) and fnmatch(scm.repository, scm_tuple[1]):
# SCM host:repository is in the allowed list
break
else:

View file

@ -36,7 +36,8 @@ server=http://hub.example.com/kojihub
pkgurl=http://hub.example.com/packages
; A space-separated list of hostname:repository pairs that kojid is authorized to checkout from (no quotes)
allowed_scms=scm.example.com:/cvs/example git.example.org:/example
; Wildcards (as supported by fnmatch) are allowed
allowed_scms=scm.example.com:/cvs/example git.example.org:/example svn.example.org:/users/*
; The mail host to use for sending email notifications
smtphost=example.com