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/secace.c

    r414 r740  
    2323#include "includes.h"
    2424#include "librpc/gen_ndr/ndr_security.h"
    25 #include "libcli/security/dom_sid.h"
     25#include "libcli/security/security.h"
     26#include "lib/util/tsort.h"
    2627
    2728#define  SEC_ACE_HEADER_SIZE (2 * sizeof(uint8_t) + sizeof(uint16_t) + sizeof(uint32_t))
     
    4445 * copy a struct security_ace structure.
    4546 */
    46 void sec_ace_copy(struct security_ace *ace_dest, struct security_ace *ace_src)
     47void sec_ace_copy(struct security_ace *ace_dest, const struct security_ace *ace_src)
    4748{
    4849        ace_dest->type  = ace_src->type;
     
    6364        t->type = type;
    6465        t->flags = flag;
    65         t->size = ndr_size_dom_sid(sid, NULL, 0) + 8;
     66        t->size = ndr_size_dom_sid(sid, 0) + 8;
    6667        t->access_mask = mask;
    6768
     
    7374********************************************************************/
    7475
    75 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)
     76NTSTATUS 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)
    7677{
    7778        unsigned int i = 0;
     
    8990        (*pp_new)[i].type  = SEC_ACE_TYPE_ACCESS_ALLOWED;
    9091        (*pp_new)[i].flags = 0;
    91         (*pp_new)[i].size  = SEC_ACE_HEADER_SIZE + ndr_size_dom_sid(sid, NULL, 0);
     92        (*pp_new)[i].size  = SEC_ACE_HEADER_SIZE + ndr_size_dom_sid(sid, 0);
    9293        (*pp_new)[i].access_mask = mask;
    9394        (*pp_new)[i].trustee = *sid;
     
    99100********************************************************************/
    100101
    101 NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, struct dom_sid *sid, uint32_t mask)
     102NTSTATUS sec_ace_mod_sid(struct security_ace *ace, size_t num, const struct dom_sid *sid, uint32_t mask)
    102103{
    103104        unsigned int i = 0;
     
    118119********************************************************************/
    119120
    120 NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, uint32_t *num, struct dom_sid *sid)
     121NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct security_ace *old, uint32_t *num, const struct dom_sid *sid)
    121122{
    122123        unsigned int i     = 0;
     
    150151********************************************************************/
    151152
    152 bool sec_ace_equal(struct security_ace *s1, struct security_ace *s2)
     153bool sec_ace_equal(const struct security_ace *s1, const struct security_ace *s2)
    153154{
    154155        /* Trivial case */
     
    178179}
    179180
    180 int nt_ace_inherit_comp( struct security_ace *a1, struct security_ace *a2)
     181int nt_ace_inherit_comp(const struct security_ace *a1, const struct security_ace *a2)
    181182{
    182183        int a1_inh = a1->flags & SEC_ACE_FLAG_INHERITED_ACE;
     
    195196*******************************************************************/
    196197
    197 int nt_ace_canon_comp( struct security_ace *a1, struct security_ace *a2)
     198int nt_ace_canon_comp( const struct security_ace *a1,  const struct security_ace *a2)
    198199{
    199200        if ((a1->type == SEC_ACE_TYPE_ACCESS_DENIED) &&
     
    258259
    259260        /* Sort so that non-inherited ACE's come first. */
    260         qsort( srclist, num_aces, sizeof(srclist[0]), QSORT_CAST nt_ace_inherit_comp);
     261        TYPESAFE_QSORT(srclist, num_aces, nt_ace_inherit_comp);
    261262
    262263        /* Find the boundary between non-inherited ACEs. */
     
    271272
    272273        /* Sort the non-inherited ACEs. */
    273         if (i)
    274                 qsort( srclist, i, sizeof(srclist[0]), QSORT_CAST nt_ace_canon_comp);
     274        TYPESAFE_QSORT(srclist, i, nt_ace_canon_comp);
    275275
    276276        /* Now sort the inherited ACEs. */
    277         if (num_aces - i)
    278                 qsort( &srclist[i], num_aces - i, sizeof(srclist[0]), QSORT_CAST nt_ace_canon_comp);
    279 }
    280 
    281 
     277        TYPESAFE_QSORT(&srclist[i], num_aces - i, nt_ace_canon_comp);
     278}
     279
     280
Note: See TracChangeset for help on using the changeset viewer.