From 2d6bed495e14349e19ba680bd72c3f110f1c397b Mon Sep 17 00:00:00 2001 From: David Mulder Date: Tue, 9 Mar 2021 11:13:40 -0700 Subject: [PATCH] samba-gpupdate: Check sysvol download paths in case-insensitive way MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit https://bugzilla.samba.org/show_bug.cgi?id=14665 Signed-off-by: David Mulder Reviewed-by: Björn Baumbach --- python/samba/gpclass.py | 5 +++-- selftest/knownfail.d/gpo | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 selftest/knownfail.d/gpo diff --git a/python/samba/gpclass.py b/python/samba/gpclass.py index 51b006f7f7f..7d3841ba8da 100644 --- a/python/samba/gpclass.py +++ b/python/samba/gpclass.py @@ -393,8 +393,9 @@ def cache_gpo_dir(conn, cache, sub_dir): def check_safe_path(path): dirs = re.split('/|\\\\', path) - if 'sysvol' in path: - dirs = dirs[dirs.index('sysvol') + 1:] + if 'sysvol' in path.lower(): + ldirs = re.split('/|\\\\', path.lower()) + dirs = dirs[ldirs.index('sysvol') + 1:] if '..' not in dirs: return os.path.join(*dirs) raise OSError(path) diff --git a/selftest/knownfail.d/gpo b/selftest/knownfail.d/gpo deleted file mode 100644 index a1c0ac474df..00000000000 --- a/selftest/knownfail.d/gpo +++ /dev/null @@ -1 +0,0 @@ -^samba.tests.gpo.samba.tests.gpo.GPOTests.test_check_safe_path_typesafe_name -- 2.47.3