]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli: Apply a little const
authorVolker Lendecke <vl@samba.org>
Thu, 28 Nov 2024 11:02:55 +0000 (12:02 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
Probably does not matter code-wise, but looks nicer to me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
libcli/security/create_descriptor.c
libcli/security/security_descriptor.h

index 49e927e11e16c40088c934448e262c9a6fd86c8a..b85b54111481d3fa923ca2a36474429a1db978da 100644 (file)
@@ -124,8 +124,8 @@ static bool desc_ace_has_generic(const struct security_ace *ace)
 /* creates an ace in which the generic information is expanded */
 
 static void desc_expand_generic(struct security_ace *new_ace,
-                               struct dom_sid *owner,
-                               struct dom_sid *group)
+                               const struct dom_sid *owner,
+                               const struct dom_sid *group)
 {
        new_ace->access_mask = map_generic_rights_ds(new_ace->access_mask);
        if (dom_sid_equal(&new_ace->trustee, &global_sid_Creator_Owner)) {
@@ -137,12 +137,13 @@ static void desc_expand_generic(struct security_ace *new_ace,
        new_ace->flags = 0x0;
 }
 
-static struct security_acl *calculate_inherited_from_parent(TALLOC_CTX *mem_ctx,
-                                                           struct security_acl *acl,
-                                                           bool is_container,
-                                                           struct dom_sid *owner,
-                                                           struct dom_sid *group,
-                                                           struct GUID *object_list)
+static struct security_acl *calculate_inherited_from_parent(
+       TALLOC_CTX *mem_ctx,
+       struct security_acl *acl,
+       bool is_container,
+       const struct dom_sid *owner,
+       const struct dom_sid *group,
+       struct GUID *object_list)
 {
        uint32_t i;
        struct security_acl *tmp_acl = NULL;
@@ -408,8 +409,8 @@ static struct security_acl *calculate_inherited_from_parent(TALLOC_CTX *mem_ctx,
 static struct security_acl *process_user_acl(TALLOC_CTX *mem_ctx,
                                             struct security_acl *acl,
                                             bool is_container,
-                                            struct dom_sid *owner,
-                                            struct dom_sid *group,
+                                            const struct dom_sid *owner,
+                                            const struct dom_sid *group,
                                             struct GUID *object_list,
                                             bool is_protected)
 {
@@ -599,20 +600,23 @@ static bool compute_acl(struct security_descriptor *parent_sd,
        return true;
 }
 
-struct security_descriptor *create_security_descriptor(TALLOC_CTX *mem_ctx,
-                                                      struct security_descriptor *parent_sd,
-                                                      struct security_descriptor *creator_sd,
-                                                      bool is_container,
-                                                      struct GUID *object_list,
-                                                      uint32_t inherit_flags,
-                                                      struct security_token *token,
-                                                      struct dom_sid *default_owner, /* valid only for DS, NULL for the other RSs */
-                                                      struct dom_sid *default_group, /* valid only for DS, NULL for the other RSs */
-                                                      uint32_t (*generic_map)(uint32_t access_mask))
+struct security_descriptor *create_security_descriptor(
+       TALLOC_CTX *mem_ctx,
+       struct security_descriptor *parent_sd,
+       struct security_descriptor *creator_sd,
+       bool is_container,
+       struct GUID *object_list,
+       uint32_t inherit_flags,
+       struct security_token *token,
+       const struct dom_sid
+               *default_owner, /* valid only for DS, NULL for the other RSs */
+       const struct dom_sid
+               *default_group, /* valid only for DS, NULL for the other RSs */
+       uint32_t (*generic_map)(uint32_t access_mask))
 {
        struct security_descriptor *new_sd;
-       struct dom_sid *new_owner = NULL;
-       struct dom_sid *new_group = NULL;
+       const struct dom_sid *new_owner = NULL;
+       const struct dom_sid *new_group = NULL;
 
        new_sd = security_descriptor_initialise(mem_ctx);
        if (!new_sd) {
index 6ff365fe54363d48b5a9ad594e0b3eaff2c06494..5b8aec606f42226589f177740fcc0bafbba2b449 100644 (file)
@@ -84,16 +84,19 @@ struct security_acl *security_acl_concatenate(TALLOC_CTX *mem_ctx,
 
 uint32_t map_generic_rights_ds(uint32_t access_mask);
 
-struct security_descriptor *create_security_descriptor(TALLOC_CTX *mem_ctx,
-                                                      struct security_descriptor *parent_sd,
-                                                      struct security_descriptor *creator_sd,
-                                                      bool is_container,
-                                                      struct GUID *object_list,
-                                                      uint32_t inherit_flags,
-                                                      struct security_token *token,
-                                                      struct dom_sid *default_owner, /* valid only for DS, NULL for the other RSs */
-                                                      struct dom_sid *default_group, /* valid only for DS, NULL for the other RSs */
-                                                      uint32_t (*generic_map)(uint32_t access_mask));
+struct security_descriptor *create_security_descriptor(
+       TALLOC_CTX *mem_ctx,
+       struct security_descriptor *parent_sd,
+       struct security_descriptor *creator_sd,
+       bool is_container,
+       struct GUID *object_list,
+       uint32_t inherit_flags,
+       struct security_token *token,
+       const struct dom_sid
+               *default_owner, /* valid only for DS, NULL for the other RSs */
+       const struct dom_sid
+               *default_group, /* valid only for DS, NULL for the other RSs */
+       uint32_t (*generic_map)(uint32_t access_mask));
 
 bool security_descriptor_with_ms_nfs(const struct security_descriptor *psd);