From 47975ea8964411d7e372fbe2dee34d33f7ed9799 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Mon, 31 Jul 2023 10:14:48 +1200 Subject: [PATCH] libcli/security: Fix code spelling Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- libcli/security/claims-conversions.c | 2 +- libcli/security/conditional_ace.c | 8 ++++---- libcli/security/sddl_conditional_ace.c | 8 ++++---- libcli/security/tests/data/export-sddl-fuzz-seeds-as-json | 4 ++-- libcli/security/tests/test_run_conditional_ace.c | 6 +++--- libcli/security/tests/test_sddl_conditional_ace.c | 2 +- libcli/security/tests/windows/windows-sddl-tests.py | 4 ++-- libcli/security/util_sid.c | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libcli/security/claims-conversions.c b/libcli/security/claims-conversions.c index 2239b737bc2..968ba1efdb3 100644 --- a/libcli/security/claims-conversions.c +++ b/libcli/security/claims-conversions.c @@ -46,7 +46,7 @@ * * We don't support the format used by the Win32 API function * AddResourceAttributeAce(), which is called CLAIM_SECURITY_ATTRIBUTE_V1. - * Nobody has ever used that function in public, and it the format is not used + * Nobody has ever used that function in public, and the format is not used * on the wire. */ diff --git a/libcli/security/conditional_ace.c b/libcli/security/conditional_ace.c index a0c9a0ccbd1..e4e83856451 100644 --- a/libcli/security/conditional_ace.c +++ b/libcli/security/conditional_ace.c @@ -33,7 +33,7 @@ * Conditional ACE logic truth tables. * * Conditional ACES use a ternary logic, with "unknown" as well as true and - * false. The ultmate meaning of unknown depends on the context; in a deny + * false. The ultimate meaning of unknown depends on the context; in a deny * ace, unknown means yes, in an allow ace, unknown means no. That is, we * treat unknown results with maximum suspicion. * @@ -744,7 +744,7 @@ static bool resource_claim_lookup( * If there is no matching resource ACE, a NULL result is returned, * which should compare UNKNOWN to anything. The NULL will have the * CONDITIONAL_ACE_FLAG_NULL_MEANS_ERROR flag set if it seems failure - * is not simply due to the sought claim not existing. This useful for + * is not simply due to the sought claim not existing. This is useful for * the Exists and Not_Exists operators. */ size_t i; @@ -1468,7 +1468,7 @@ static bool compare_composites(const struct ace_condition_token *op, * that. This means we can't short-cut by comparing the * lengths. * - * THe extra sad thing is we might have to do it both ways + * The extra sad thing is we might have to do it both ways * round. For example, comparing {a, a, b, a} to {a, b, c}, we * find all of the first group in the second, but that doesn't * mean all of the second are in the first. @@ -2005,7 +2005,7 @@ int run_conditional_ace(TALLOC_CTX *mem_ctx, * other error in running it. The *result parameter is set to * ACE_CONDITION_FALSE, ACE_CONDITION_TRUE, or ACE_CONDITION_UNKNOWN. * - * ACE_CONDITION_UNKNOWN should be treated pessimistically, as if were + * ACE_CONDITION_UNKNOWN should be treated pessimistically, as if it were * TRUE for deny ACEs, and FALSE for allow ACEs. * * @param[in] ace - the ACE being processed. diff --git a/libcli/security/sddl_conditional_ace.c b/libcli/security/sddl_conditional_ace.c index 9fc2d8a2c57..2f243bca6a6 100644 --- a/libcli/security/sddl_conditional_ace.c +++ b/libcli/security/sddl_conditional_ace.c @@ -1203,7 +1203,7 @@ char *sddl_from_conditional_ace(TALLOC_CTX *mem_ctx, * [MS-DTYP]. MS-DTYP uses 'LHS' to describe the * operand of unary operators even though they are * always displayed on the right of the operator. It - * which makes everything much simpler to use rhs + * makes everything much simpler to use rhs * instead. */ n_trees--; @@ -1953,7 +1953,7 @@ static bool parse_sid(struct ace_condition_sddl_compiler_context *comp) if (expecting_bare_sids) { /* * This flag is set for a resource ACE which doesn't have the - * SID() wrapper around the the SID string, and not for a + * SID() wrapper around the SID string, and not for a * conditional ACE, which must have the "SID(...)". * * The resource ACE doesn't need this because there is no @@ -2779,7 +2779,7 @@ static bool check_resource_attr_type(struct ace_condition_token *tok, char c) * etc). * * We're sticking to the [IUSDXB] codes rather than using converting - * earlier to tok->type (whereby this who thing becomes "if (tok->type + * earlier to tok->type (whereby this whole thing becomes "if (tok->type * == type)") to enable bounds checks on the various integer types. */ switch(c) { @@ -3173,7 +3173,7 @@ static bool write_resource_attr_from_token(struct sddl_write_context *ctx, return sddl_write_unicode(ctx, tok); case CONDITIONAL_ACE_TOKEN_SID: - /* unlike conditional ACE, SID does not had "SID()" wrapper. */ + /* unlike conditional ACE, SID does not have a "SID()" wrapper. */ sid = sddl_encode_sid(ctx->mem_ctx, &tok->data.sid.sid, NULL); if (sid == NULL) { return false; diff --git a/libcli/security/tests/data/export-sddl-fuzz-seeds-as-json b/libcli/security/tests/data/export-sddl-fuzz-seeds-as-json index f1e5ae15924..cbff661265e 100755 --- a/libcli/security/tests/data/export-sddl-fuzz-seeds-as-json +++ b/libcli/security/tests/data/export-sddl-fuzz-seeds-as-json @@ -4,9 +4,9 @@ Some of our fuzzers generate SDDL strings with trailing garbage. This script converts them into the JSON format used by -windws-sddl-tests.py, though it doesn't parse the SDDL, mapping all +windows-sddl-tests.py, though it doesn't parse the SDDL, mapping all strings to an empty list. The idea is you can feed this through -windws-sddl-tests.py or something else to get the correct bytes. +windows-sddl-tests.py or something else to get the correct bytes. Valid and invalid strings are treated alike, so long as they are utf-8. The JSON is un-indented, but structurally equivalent to this: diff --git a/libcli/security/tests/test_run_conditional_ace.c b/libcli/security/tests/test_run_conditional_ace.c index c538b7cb55e..433f830afed 100644 --- a/libcli/security/tests/test_run_conditional_ace.c +++ b/libcli/security/tests/test_run_conditional_ace.c @@ -263,7 +263,7 @@ static void test_composite_different_order_with_SID_dupes(void **state) static void test_composite_mixed_types(void **state) { /* - * If the conditional ACE composite hasa mixed types, it can + * If the conditional ACE composite has mixed types, it can * never equal a claim, which only has one type. */ INIT() @@ -513,7 +513,7 @@ static void test_Device_claim_contains_Resource_claim(void **state) } -static void test_device_claim_comtains_resource_claim(void **state) +static void test_device_claim_contains_resource_claim(void **state) { INIT(); USER_SIDS("WD", "AA"); @@ -635,7 +635,7 @@ int main(_UNUSED_ int argc, _UNUSED_ const char **argv) cmocka_unit_test(test_resource_ace_multi), cmocka_unit_test(test_resource_ace_multi_any_of), cmocka_unit_test(test_user_claim_eq_device_claim), - cmocka_unit_test(test_device_claim_comtains_resource_claim), + cmocka_unit_test(test_device_claim_contains_resource_claim), cmocka_unit_test(test_device_claim_eq_resource_claim), cmocka_unit_test(test_Device_claim_contains_Resource_claim), cmocka_unit_test(test_not_Not_Contains_1), diff --git a/libcli/security/tests/test_sddl_conditional_ace.c b/libcli/security/tests/test_sddl_conditional_ace.c index 5ce9dbab87a..61e219614b9 100644 --- a/libcli/security/tests/test_sddl_conditional_ace.c +++ b/libcli/security/tests/test_sddl_conditional_ace.c @@ -415,7 +415,7 @@ static void test_full_sddl_ra_encode(void **state) 0x00, 0x00, /* ACE starts here, 352 */ 0x09, 0x00, /* type 9, access allowed callback */ - 0x20, 0x00, /* swize 32 */ + 0x20, 0x00, /* size 32 */ 0x3f, 0x00, 0x00, 0x00, /*mask */ 0x01, 0x01, /* S-1-... (1 subauth) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /*...-16-...*/ diff --git a/libcli/security/tests/windows/windows-sddl-tests.py b/libcli/security/tests/windows/windows-sddl-tests.py index 63c7998bffe..38acb4479f6 100644 --- a/libcli/security/tests/windows/windows-sddl-tests.py +++ b/libcli/security/tests/windows/windows-sddl-tests.py @@ -147,7 +147,7 @@ def main(): # maybe 0xffff is an incorrect guess -- it gives use v2 (NT), not v4 (AD) c = w.ConvertSecurityDescriptorToStringSecurityDescriptor(sd, 1, 0xffff) except Exception as e: - print(f"could sot serialize '{sd}': {e}") + print(f"could not serialize '{sd}': {e}") print(f" derived from '{a}'") exceptions[f"{e} serialize"].append(a) unserializeable_cases.append(a) @@ -166,7 +166,7 @@ def main(): for k, v in exceptions.items(): print(f"{k}: {len(v)}") - print(f"{len(unparseable_cases)} failed to parsed") + print(f"{len(unparseable_cases)} failed to parse") print(f"{len(parseable_cases)} successfully parsed") print(f"{len(unserializeable_cases)} of these failed to re-serialize") print(f"{len(round_trip_failures)} of these failed to round trip") diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c index b6523f6927a..7c20836314f 100644 --- a/libcli/security/util_sid.c +++ b/libcli/security/util_sid.c @@ -69,7 +69,7 @@ const struct dom_sid global_sid_Authenticated_Users = /* All authenticated rids { 1, 1, {0,0,0,0,0,5}, {11,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; #if 0 /* for documentation S-1-5-12 */ -const struct dom_sid global_sid_Restriced = /* Restricted Code */ +const struct dom_sid global_sid_Restricted = /* Restricted Code */ { 1, 1, {0,0,0,0,0,5}, {12,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; #endif -- 2.47.3