]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest:sddl: test we only accept normal GUIDs
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 25 Apr 2023 22:33:12 +0000 (10:33 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 28 Apr 2023 02:15:36 +0000 (02:15 +0000)
By normal GUID, I mean ones like f30e3bbf-9ff0-11d1-b603-0000f80367c1,
with four hyphens and no curly braces.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/sddl.py
selftest/knownfail.d/sddl

index b8750880d6de9da405c6c73375d9625b38391bce..c1996de75ce03d80c007292de6705f74c355f76e 100644 (file)
@@ -657,6 +657,15 @@ class SddlShouldFail(SddlDecodeEncodeBase):
         "D:(A;;GA;; f30e3bbf-9ff0-11d1-b603-0000f80367c1;WD)",
         "D:(A;;GA;;f30e3bbf-9ff0-11d1-b603-0000f80367c1 ;WD)",
 
+        # Samba used to use GUID_from_string(), which would take
+        # anything GUID-ish, including {}-wrapped GUIDs, hyphen-less
+        # hexstrings, and 16 raw bytes. But we only want one kind.
+        "D:(A;;GA;;{f30e3bbf-9ff0-11d1-b603-0000f80367c1};WD)",
+        # would have been treated as raw bytes.
+        "D:(A;;GA;;0123456789abcdef;WD)",
+        # would have been 16 hex pairs.
+        "D:(A;;GA;;0123456789abcdef0123456789abcdef;WD)",
+
         # space splits a flag in half.
         "D:AI(A;CI;RP LCLOR C;;;AU)",
         # tabs in flags
index cf38e28bb4a5e3dcd180d542626d0463de4b32dd..44c018ac8d733e363662300430e922fe31d9f009 100644 (file)
@@ -1,3 +1,6 @@
-^samba.tests.sddl.+.SddlWindowsFlagsAreDifferent.test_sddl_D:.A;;0x001f01ff;;;WD..A;;0x001f01ff;;;S-1.+S
+^samba.tests.sddl.+.SddlShouldFail.test_sddl_should_fail_D:.A;;GA;;0123456789abcdef0123456789abcdef;WD..none
+^samba.tests.sddl.+.SddlShouldFail.test_sddl_should_fail_D:.A;;GA;;0123456789abcdef;WD..none
+^samba.tests.sddl.+.SddlShouldFail.test_sddl_should_fail_D:.A;;GA;;{f30e3bbf-9ff0-11d1-b603-0000f80367c1};WD..none
+^samba.tests.sddl.+.SddlWindowsFlagsAreDifferent.test_sddl_D:.A;;0x001f01ff;;;WD..A;;0x001f01ff;;;S-1-5-21-11111111-22222222-33333333-1001..A;;0x001f01ff;;;S-1.11522-more-characters.none
 ^samba.tests.sddl.+.SddlWindowsFlagsAreDifferent.test_sddl_D:.A;;FA;;;WD..none
-^samba.tests.sddl.+.SddlWindowsFlagsAreDifferent.test_sddl_O:S-1-5-21-2212615479-2695158682-210137546.+:
+^samba.tests.sddl.+.SddlWindowsFlagsAreDifferent.test_sddl_O:S-1-5-21-2212615479-2695158682-2101375468-512G:S-1-5-21-2212615479-2695158682-2101375468-513D:P.A;.482-more-characters.none