From 2ef60eada5cd66db9095a4f40942e8b07a7b3377 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Tue, 22 Aug 2017 15:26:07 +0200 Subject: [PATCH] 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 --- koji/daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/koji/daemon.py b/koji/daemon.py index 1947dd3c..533ae1a8 100644 --- a/koji/daemon.py +++ b/koji/daemon.py @@ -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]