Run normpath over SCM url when checking against allowed

This will make sure that when we check the allowed SCM url, any ./ and ../ are resolved.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
Patrick Uiterwijk 2017-08-22 15:26:07 +02:00 committed by Mike McLean
parent 8bb44e794c
commit 2ef60eada5

View file

@ -263,6 +263,8 @@ class SCM(object):
elif len(userhost) > 2:
raise koji.GenericError('Invalid username@hostname specified: %s' % netloc)
path = os.path.normpath(path)
# ensure that path and query do not end in /
if path.endswith('/'):
path = path[:-1]