Add some const. Needed for my SD work.
authorJeremy Allison <jra@samba.org>
Fri, 8 Oct 2010 23:50:40 +0000 (16:50 -0700)
committerJeremy Allison <jra@samba.org>
Sat, 9 Oct 2010 01:05:02 +0000 (18:05 -0700)
Jeremy

libcli/security/secace.c
libcli/security/secace.h

index 2ee5bfaee50808ea779d689f51268230b900ffb6..5787e151106a529d2051b20324214c77cd1a247f 100644 (file)
@@ -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))
index 8b6625d07d3c9837d625f8ff433b46b6ea3820d0..132217757ca427759e3e9df6f5307e044636cf38 100644 (file)
 #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_*/