]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/security: clarify tests for SDDL round trips
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 13 Dec 2023 22:56:19 +0000 (11:56 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Dec 2023 03:31:37 +0000 (03:31 +0000)
The `failed = failed || ok` did the same thing, obscurely.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/security/tests/test_sddl_conditional_ace.c

index 4aaf4f21d19d1c47e88dfe181b8d26520e5c81eb..fa3988602d0c31c18451e289b93cfe6b576a611e 100644 (file)
@@ -583,7 +583,8 @@ static void test_round_trips(void **state)
 {
        /*
         * These expressions should parse into proper conditional
-        * ACEs, which then decode into the same string.
+        * ACEs, which then encode into an equivalent SDDL string,
+        * which then parses again into the same conditional ACE.
         */
        static const char *sddl[] = {
                ("(Member_of{SID(AA)})"),
@@ -667,7 +668,7 @@ static void test_round_trips(void **state)
                        continue;
                }
                if (data_blob_cmp(&e1, &e2) != 0) {
-                       failed = failed || ok;
+                       failed = true;
                }
 
                resddl1 = sddl_from_conditional_ace(mem_ctx, s1);
@@ -684,9 +685,9 @@ static void test_round_trips(void **state)
                }
                if (strcmp(resddl1, resddl2) != 0) {
                        print_message("SDDL 2: %s\n", resddl2);
-                       failed = failed || ok;
+                       failed = true;
                }
-               print_message("SDDL: %s\n", resddl1);
+               print_message("SDDL: '%s' -> '%s'\n", sddl[i], resddl1);
                s3 = ace_conditions_compile_sddl(mem_ctx,
                                                 ACE_CONDITION_FLAG_ALLOW_DEVICE,
                                                 resddl1,
@@ -706,8 +707,8 @@ static void test_round_trips(void **state)
                        continue;
                }
                if (data_blob_cmp(&e1, &e2) != 0) {
-                       debug_fail("'%s' compiled differently\n", resddl1);
-                       failed = failed || ok;
+                       debug_fail("'%s' and '%s' compiled differently\n", sddl[i], resddl1);
+                       failed = true;
                }
        }
        assert_false(failed);