samba-gpupdate: Check sysvol download paths in case-insensitive way
authorDavid Mulder <dmulder@suse.com>
Tue, 9 Mar 2021 18:13:40 +0000 (11:13 -0700)
committerBjörn Baumbach <bb@sernet.de>
Thu, 11 Mar 2021 20:29:41 +0000 (20:29 +0000)
https://bugzilla.samba.org/show_bug.cgi?id=14665

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
python/samba/gpclass.py
selftest/knownfail.d/gpo [deleted file]

index 51b006f7f7f0506b4ba575c1392044eb85fbc189..7d3841ba8da035fcd01879818fe0e9539f7bae34 100644 (file)
@@ -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 (file)
index a1c0ac4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba.tests.gpo.samba.tests.gpo.GPOTests.test_check_safe_path_typesafe_name