Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

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

    r740 r988  
    1 /* 
     1/*
    22 *  Unix SMB/Netbios implementation.
    33 *  SEC_ACL handling routines
     
    66 *  Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
    77 *  Copyright (C) Paul Ashton                  1997-1998.
    8  * 
     8 *
    99 *  This program is free software; you can redistribute it and/or modify
    1010 *  it under the terms of the GNU General Public License as published by
    1111 *  the Free Software Foundation; either version 3 of the License, or
    1212 *  (at your option) any later version.
    13  * 
     13 *
    1414 *  This program is distributed in the hope that it will be useful,
    1515 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1717 *  GNU General Public License for more details.
    18  * 
     18 *
    1919 *  You should have received a copy of the GNU General Public License
    2020 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
     
    2929
    3030/*******************************************************************
    31  Create a SEC_ACL structure. 
     31 Create a SEC_ACL structure.
    3232********************************************************************/
    3333
    34 struct security_acl *make_sec_acl(TALLOC_CTX *ctx, 
    35                                                                   enum security_acl_revision revision,
    36                                                                   int num_aces, struct security_ace *ace_list)
     34struct security_acl *make_sec_acl(TALLOC_CTX *ctx,
     35                                  enum security_acl_revision revision,
     36                                  int num_aces, struct security_ace *ace_list)
    3737{
    3838        struct security_acl *dst;
    3939        int i;
    4040
    41         if((dst = talloc_zero(ctx, struct security_acl)) == NULL)
     41        dst = talloc(ctx, struct security_acl);
     42        if (dst == NULL) {
    4243                return NULL;
     44        }
    4345
    4446        dst->revision = revision;
    4547        dst->num_aces = num_aces;
    4648        dst->size = SEC_ACL_HEADER_SIZE;
     49        dst->aces = NULL;
    4750
    4851        /* Now we need to return a non-NULL address for the ace list even
     
    5255           positive number. */
    5356
    54         if ((num_aces) &&
    55             ((dst->aces = talloc_array(dst, struct security_ace, num_aces))
    56              == NULL)) {
     57        if (num_aces == 0) {
     58                return dst;
     59        }
     60
     61        dst->aces = talloc_array(dst, struct security_ace, num_aces);
     62        if (dst->aces == NULL) {
     63                TALLOC_FREE(dst);
    5764                return NULL;
    5865        }
    59        
     66
    6067        for (i = 0; i < num_aces; i++) {
    6168                dst->aces[i] = ace_list[i]; /* Structure copy. */
     
    6572        return dst;
    6673}
    67 
    68 /*******************************************************************
    69  Duplicate a SEC_ACL structure. 
    70 ********************************************************************/
    71 
    72 struct security_acl *dup_sec_acl(TALLOC_CTX *ctx, struct security_acl *src)
    73 {
    74         if(src == NULL)
    75                 return NULL;
    76 
    77         return make_sec_acl(ctx, src->revision, src->num_aces, src->aces);
    78 }
Note: See TracChangeset for help on using the changeset viewer.