From b69bec03cc210ccb2c5373115352a57ca6363f04 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Oct 2010 16:50:40 -0700 Subject: [PATCH] Add some const. Needed for my SD work. Jeremy --- libcli/security/secace.c | 14 +++++++------- libcli/security/secace.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libcli/security/secace.c b/libcli/security/secace.c index 2ee5bfaee50..5787e151106 100644 --- a/libcli/security/secace.c +++ b/libcli/security/secace.c @@ -44,7 +44,7 @@ bool sec_ace_object(uint8_t type) /** * copy a struct security_ace structure. */ -void sec_ace_copy(struct security_ace *ace_dest, struct security_ace *ace_src) +void sec_ace_copy(struct security_ace *ace_dest, const struct security_ace *ace_src) { ace_dest->type = ace_src->type; ace_dest->flags = ace_src->flags; @@ -73,7 +73,7 @@ void init_sec_ace(struct security_ace *t, const struct dom_sid *sid, enum securi adds new SID with its permissions to ACE list ********************************************************************/ -NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, unsigned *num, struct dom_sid *sid, uint32_t mask) +NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, unsigned *num, const struct dom_sid *sid, uint32_t mask) { unsigned int i = 0; @@ -99,7 +99,7 @@ NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct s modify SID's permissions at ACL ********************************************************************/ -NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, struct dom_sid *sid, uint32_t mask) +NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, const struct dom_sid *sid, uint32_t mask) { unsigned int i = 0; @@ -118,7 +118,7 @@ NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, struct dom_sid *s delete SID from ACL ********************************************************************/ -NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, uint32_t *num, struct dom_sid *sid) +NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, uint32_t *num, const struct dom_sid *sid) { unsigned int i = 0; unsigned int n_del = 0; @@ -150,7 +150,7 @@ NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct s Compares two struct security_ace structures ********************************************************************/ -bool sec_ace_equal(struct security_ace *s1, struct security_ace *s2) +bool sec_ace_equal(const struct security_ace *s1, const struct security_ace *s2) { /* Trivial case */ @@ -178,7 +178,7 @@ bool sec_ace_equal(struct security_ace *s1, struct security_ace *s2) return true; } -int nt_ace_inherit_comp( struct security_ace *a1, struct security_ace *a2) +int nt_ace_inherit_comp(const struct security_ace *a1, const struct security_ace *a2) { int a1_inh = a1->flags & SEC_ACE_FLAG_INHERITED_ACE; int a2_inh = a2->flags & SEC_ACE_FLAG_INHERITED_ACE; @@ -195,7 +195,7 @@ int nt_ace_inherit_comp( struct security_ace *a1, struct security_ace *a2) Comparison function to apply the order explained below in a group. *******************************************************************/ -int nt_ace_canon_comp( struct security_ace *a1, struct security_ace *a2) +int nt_ace_canon_comp( const struct security_ace *a1, const struct security_ace *a2) { if ((a1->type == SEC_ACE_TYPE_ACCESS_DENIED) && (a2->type != SEC_ACE_TYPE_ACCESS_DENIED)) diff --git a/libcli/security/secace.h b/libcli/security/secace.h index 8b6625d07d3..132217757ca 100644 --- a/libcli/security/secace.h +++ b/libcli/security/secace.h @@ -24,15 +24,15 @@ #include "librpc/gen_ndr/security.h" bool sec_ace_object(uint8_t type); -void sec_ace_copy(struct security_ace *ace_dest, struct security_ace *ace_src); +void sec_ace_copy(struct security_ace *ace_dest, const struct security_ace *ace_src); void init_sec_ace(struct security_ace *t, const struct dom_sid *sid, enum security_ace_type type, uint32_t mask, uint8_t flag); -NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, unsigned *num, struct dom_sid *sid, uint32_t mask); -NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, struct dom_sid *sid, uint32_t mask); -NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, uint32_t *num, struct dom_sid *sid); -bool sec_ace_equal(struct security_ace *s1, struct security_ace *s2); -int nt_ace_inherit_comp( struct security_ace *a1, struct security_ace *a2); -int nt_ace_canon_comp( struct security_ace *a1, struct security_ace *a2); +NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, unsigned *num, const struct dom_sid *sid, uint32_t mask); +NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, const struct dom_sid *sid, uint32_t mask); +NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, uint32_t *num, const struct dom_sid *sid); +bool sec_ace_equal(const struct security_ace *s1, const struct security_ace *s2); +int nt_ace_inherit_comp( const struct security_ace *a1, const struct security_ace *a2); +int nt_ace_canon_comp( const struct security_ace *a1, const struct security_ace *a2); void dacl_sort_into_canonical_order(struct security_ace *srclist, unsigned int num_aces); #endif /*_ACE_H_*/