Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/libcli/security/secacl.c

    r414 r740  
    2424#include "librpc/gen_ndr/ndr_security.h"
    2525#include "libcli/security/secace.h"
     26#include "libcli/security/secacl.h"
    2627
    2728#define  SEC_ACL_HEADER_SIZE (2 * sizeof(uint16_t) + sizeof(uint32_t))
     
    7677        return make_sec_acl(ctx, src->revision, src->num_aces, src->aces);
    7778}
    78 
    79 /*******************************************************************
    80  Compares two SEC_ACL structures
    81 ********************************************************************/
    82 
    83 bool sec_acl_equal(struct security_acl *s1, struct security_acl *s2)
    84 {
    85         unsigned int i, j;
    86 
    87         /* Trivial cases */
    88 
    89         if (!s1 && !s2) return true;
    90         if (!s1 || !s2) return false;
    91 
    92         /* Check top level stuff */
    93 
    94         if (s1->revision != s2->revision) {
    95                 DEBUG(10, ("sec_acl_equal(): revision differs (%d != %d)\n",
    96                            s1->revision, s2->revision));
    97                 return false;
    98         }
    99 
    100         if (s1->num_aces != s2->num_aces) {
    101                 DEBUG(10, ("sec_acl_equal(): num_aces differs (%d != %d)\n",
    102                            s1->revision, s2->revision));
    103                 return false;
    104         }
    105 
    106         /* The ACEs could be in any order so check each ACE in s1 against
    107            each ACE in s2. */
    108 
    109         for (i = 0; i < s1->num_aces; i++) {
    110                 bool found = false;
    111 
    112                 for (j = 0; j < s2->num_aces; j++) {
    113                         if (sec_ace_equal(&s1->aces[i], &s2->aces[j])) {
    114                                 found = true;
    115                                 break;
    116                         }
    117                 }
    118 
    119                 if (!found) return false;
    120         }
    121 
    122         return true;
    123 }
Note: See TracChangeset for help on using the changeset viewer.