From: Douglas Bagnall Date: Thu, 9 Nov 2023 22:28:35 +0000 (+1300) Subject: libcli/security:sddl_decode_ace: fix ';' count message X-Git-Tag: talloc-2.4.2~697 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01f8b61035afbcaf14997ce1e590451be4c754ca;p=thirdparty%2Fsamba.git libcli/security:sddl_decode_ace: fix ';' count message The wrong number of semicolons is usually one less than count (which counts sections separated by semicolons), except when count is zero. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c index 70bf6d07f75..032048544a0 100644 --- a/libcli/security/sddl.c +++ b/libcli/security/sddl.c @@ -588,7 +588,8 @@ static bool sddl_decode_ace(TALLOC_CTX *mem_ctx, if (count != 6) { /* we hit the '\0' or ')' before all of ';;;;;)' */ *msg = talloc_asprintf(mem_ctx, - "malformed ACE with only %zu ';'", count); + "malformed ACE with only %zu ';'", + MIN(count - 1, count)); return false; } diff --git a/selftest/knownfail.d/domain_auth_policy-errmsg b/selftest/knownfail.d/domain_auth_policy-errmsg deleted file mode 100644 index 47905941c08..00000000000 --- a/selftest/knownfail.d/domain_auth_policy-errmsg +++ /dev/null @@ -1 +0,0 @@ -samba.tests.samba_tool.domain_auth_policy.samba.tests.samba_tool.domain_auth_policy.AuthPolicyCmdTestCase.test_create__invalid_sddl_normal_ace