The branch, master has been updated
       via  b5ce90e nfs4acls: Remove type_name param from smbacl4_get_vfs_params
       via  173dca4 nfs4acls: Fix a small memleak
       via  9287b67 nfs4acls: Introduce a helper variable
       via  5caaf00 nfs4acls: Remove a few unnecessary casts
       via  fafd0a0 nfs4acls: Use talloc_realloc()
       via  7e630c3 nfs4acls: Use talloc_zero_array()
       via  68c64c7 nfs4acls: Use talloc_zero()
       via  8125503 nfs4acls: Use talloc_zero()
       via  1ba9bbd nfs4acls: Remove get_validated_aceint
       via  aeef821 nfs4acls: Remove get_validated_aclint
       via  45e1ef0 nfs4acls: Remove the SMB_ACE4_INT_T typedef
       via  1d30e86 nfs4acls: Remove the SMB_ACL4_INT_T typedef
       via  3314717 nfs4acls: Use SMB4ACE_T instead of _SMB_ACE4_INT_T
       via  5a7997f nfs4acls: Use SMB4ACL_T instead of _SMB_ACL4_INT_T
       via  cf97ec5 nfs4acls: Remove an obsolete comment
       via  157711c nfs4acls: Use an anon struct for SMB4ACE_T
       via  f15ad38 nfs4acls: Use an anon struct for SMB4ACL_T
       via  9db523b nfs4acls: Use ZERO_STRUCTP
      from  1fcad53 dns_server: Fix a small memleak

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b5ce90e609164923dd3bb22d16e94ef998f08426
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 14:20:07 2015 +0200

    nfs4acls: Remove type_name param from smbacl4_get_vfs_params
    
    It is kindof unexpected that we get params for something else but
    "nfs4:"
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>
    
    Autobuild-User(master): Volker Lendecke <v...@samba.org>
    Autobuild-Date(master): Thu Aug 13 17:45:31 CEST 2015 on sn-devel-104

commit 173dca482b87c10bc68c8c2f55a9983f15e04c73
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 14:16:04 2015 +0200

    nfs4acls: Fix a small memleak
    
    We don't need the nt_ace_list beyond this function, make_sec_acl makes
    a copy and make_sec_desc makes another one
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 9287b6788d69f7fc481a4c857ba1e7646544072f
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 14:13:43 2015 +0200

    nfs4acls: Introduce a helper variable
    
    ... triggered by removing a "==false" condition
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 5caaf00e7b523759485a86d0940b91f538d1193c
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:37:42 2015 +0200

    nfs4acls: Remove a few unnecessary casts
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit fafd0a0c693dc523452640f00b96114b9ffddbf7
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:36:45 2015 +0200

    nfs4acls: Use talloc_realloc()
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 7e630c32da6e3dd89325432c86e1e7870cbed9e1
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:34:35 2015 +0200

    nfs4acls: Use talloc_zero_array()
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 68c64c7b3012b964fdbc37cf9922f896aceb6f39
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:33:40 2015 +0200

    nfs4acls: Use talloc_zero()
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 8125503339bee667cda71edb476ce0ca1b7f9c54
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Aug 12 07:31:01 2015 +0200

    nfs4acls: Use talloc_zero()
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 1ba9bbd4f3165f5b793a30bd6bddc548f210f9e0
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:12:46 2015 +0200

    nfs4acls: Remove get_validated_aceint
    
    With the anonymous struct SMB4ACE_T we can rely on the compiler
    to warn us
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit aeef82192dbdd1991aa6429b6aa0c93ff19f5263
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:12:46 2015 +0200

    nfs4acls: Remove get_validated_aclint
    
    With the anonymous struct SMB4ACL_T we can rely on the compiler
    to warn us
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 45e1ef07b9c2730b6b092f77c85ae9d0ddad33a2
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:04:05 2015 +0200

    nfs4acls: Remove the SMB_ACE4_INT_T typedef
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 1d30e86a7e0c609147ed51725f879015d2ee2e0c
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:02:17 2015 +0200

    nfs4acls: Remove the SMB_ACL4_INT_T typedef
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 33147171d346d18b210ae14d1d6246e67035004b
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 13:00:59 2015 +0200

    nfs4acls: Use SMB4ACE_T instead of _SMB_ACE4_INT_T
    
    We can make the _INT_ structure now be the representation of the
    published anonymous struct
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 5a7997f43fb04eaf7d0402f6c42836ee468dbeb5
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 12:59:05 2015 +0200

    nfs4acls: Use SMB4ACL_T instead of _SMB_ACL4_INT_T
    
    We can make the _INT_ structure now be the representation of the
    published anonymous struct
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit cf97ec56d26d03ddb1f182530e67c66dbc6c38fe
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 12:44:08 2015 +0200

    nfs4acls: Remove an obsolete comment
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 157711cb4709d67603f4fc1abe8bea8dc84f8981
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 12:35:20 2015 +0200

    nfs4acls: Use an anon struct for SMB4ACE_T
    
    -typedef struct _SMB4ACE_T {char dontuse;} SMB4ACE_T;
    +struct SMB4ACE_T;
    
    Same as for ACL_T
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit f15ad38d141c6654dd2a280b9289b8829dc06f0e
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 12:35:20 2015 +0200

    nfs4acls: Use an anon struct for SMB4ACL_T
    
    The relevant change:
    
    -typedef struct _SMB4ACL_T {char dontuse;} SMB4ACL_T;
    +struct SMB4ACL_T;
    
    We can use anonymous structs to prevent direct use. This patch will
    trigger a set of simplifications in the next patches
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 9db523b169def3aef11664d7a297cd0bc44259fd
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 11 12:12:53 2015 +0200

    nfs4acls: Use ZERO_STRUCTP
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/nfs4_acls.c         | 248 ++++++++++++++----------------------
 source3/modules/nfs4_acls.h         |  32 +++--
 source3/modules/vfs_aixacl2.c       |  16 ++-
 source3/modules/vfs_gpfs.c          |  17 +--
 source3/modules/vfs_nfs4acl_xattr.c |  36 +++---
 source3/modules/vfs_zfsacl.c        |  13 +-
 6 files changed, 153 insertions(+), 209 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 9475248..26a98b7 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -37,23 +37,19 @@
 
 extern const struct generic_mapping file_generic_mapping;
 
-#define SMB_ACE4_INT_MAGIC 0x76F8A967
-typedef struct _SMB_ACE4_INT_T
+struct SMB4ACE_T
 {
-       uint32_t magic;
        SMB_ACE4PROP_T  prop;
-       void    *next;
-} SMB_ACE4_INT_T;
+       struct SMB4ACE_T *next;
+};
 
-#define SMB_ACL4_INT_MAGIC 0x29A3E792
-typedef struct _SMB_ACL4_INT_T
+struct SMB4ACL_T
 {
-       uint32_t magic;
        uint16_t controlflags;
        uint32_t naces;
-       SMB_ACE4_INT_T  *first;
-       SMB_ACE4_INT_T  *last;
-} SMB_ACL4_INT_T;
+       struct SMB4ACE_T        *first;
+       struct SMB4ACE_T        *last;
+};
 
 enum smbacl4_mode_enum {e_simple=0, e_special=1};
 enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
@@ -69,7 +65,6 @@ typedef struct _smbacl4_vfs_params {
  * Gather special parameters for NFS4 ACL handling
  */
 static int smbacl4_get_vfs_params(
-       const char *type_name,
        struct connection_struct *conn,
        smbacl4_vfs_params *params
 )
@@ -88,23 +83,25 @@ static int smbacl4_get_vfs_params(
        };
        int enumval;
 
-       memset(params, 0, sizeof(smbacl4_vfs_params));
+       ZERO_STRUCTP(params);
 
-       enumval = lp_parm_enum(SNUM(conn), type_name, "mode",
+       enumval = lp_parm_enum(SNUM(conn), SMBACL4_PARAM_TYPE_NAME, "mode",
                               enum_smbacl4_modes, e_simple);
        if (enumval == -1) {
-               DEBUG(10, ("value for %s:mode unknown\n", type_name));
+               DEBUG(10, ("value for %s:mode unknown\n",
+                          SMBACL4_PARAM_TYPE_NAME));
                return -1;
        }
        params->mode = (enum smbacl4_mode_enum)enumval;
 
-       params->do_chown = lp_parm_bool(SNUM(conn), type_name,
+       params->do_chown = lp_parm_bool(SNUM(conn), SMBACL4_PARAM_TYPE_NAME,
                "chown", true);
 
-       enumval = lp_parm_enum(SNUM(conn), type_name, "acedup",
+       enumval = lp_parm_enum(SNUM(conn), SMBACL4_PARAM_TYPE_NAME, "acedup",
                               enum_smbacl4_acedups, e_dontcare);
        if (enumval == -1) {
-               DEBUG(10, ("value for %s:acedup unknown\n", type_name));
+               DEBUG(10, ("value for %s:acedup unknown\n",
+                          SMBACL4_PARAM_TYPE_NAME));
                return -1;
        }
        params->acedup = (enum smbacl4_acedup_enum)enumval;
@@ -172,140 +169,101 @@ static uint32_t 
map_windows_ace_flags_to_nfs4_ace_flags(uint32_t win_ace_flags)
        return nfs4_ace_flags;
 }
 
-static SMB_ACL4_INT_T *get_validated_aclint(SMB4ACL_T *theacl)
+struct SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx)
 {
-       SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)theacl;
-       if (theacl==NULL)
-       {
-               DEBUG(2, ("acl is NULL\n"));
-               errno = EINVAL;
-               return NULL;
-       }
-       if (aclint->magic!=SMB_ACL4_INT_MAGIC)
-       {
-               DEBUG(2, ("aclint bad magic 0x%x\n", aclint->magic));
-               errno = EINVAL;
-               return NULL;
-       }
-       return aclint;
-}
-
-static SMB_ACE4_INT_T *get_validated_aceint(SMB4ACE_T *ace)
-{
-       SMB_ACE4_INT_T *aceint = (SMB_ACE4_INT_T *)ace;
-       if (ace==NULL)
-       {
-               DEBUG(2, ("ace is NULL\n"));
-               errno = EINVAL;
-               return NULL;
-       }
-       if (aceint->magic!=SMB_ACE4_INT_MAGIC)
-       {
-               DEBUG(2, ("aceint bad magic 0x%x\n", aceint->magic));
-               errno = EINVAL;
-               return NULL;
-       }
-       return aceint;
-}
+       struct SMB4ACL_T *theacl;
 
-SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx)
-{
-       SMB_ACL4_INT_T  *theacl = (SMB_ACL4_INT_T *)TALLOC_ZERO_SIZE(
-               mem_ctx, sizeof(SMB_ACL4_INT_T));
+       theacl = talloc_zero(mem_ctx, struct SMB4ACL_T);
        if (theacl==NULL)
        {
                DEBUG(0, ("TALLOC_SIZE failed\n"));
                errno = ENOMEM;
                return NULL;
        }
-       theacl->magic = SMB_ACL4_INT_MAGIC;
        theacl->controlflags = SEC_DESC_SELF_RELATIVE;
        /* theacl->first, last = NULL not needed */
-       return (SMB4ACL_T *)theacl;
+       return theacl;
 }
 
-SMB4ACE_T *smb_add_ace4(SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop)
+struct SMB4ACE_T *smb_add_ace4(struct SMB4ACL_T *acl, SMB_ACE4PROP_T *prop)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       SMB_ACE4_INT_T *ace;
+       struct SMB4ACE_T *ace;
 
-       ace = (SMB_ACE4_INT_T *)TALLOC_ZERO_SIZE(
-               theacl, sizeof(SMB_ACE4_INT_T));
+       ace = talloc_zero(acl, struct SMB4ACE_T);
        if (ace==NULL)
        {
                DEBUG(0, ("TALLOC_SIZE failed\n"));
                errno = ENOMEM;
                return NULL;
        }
-       ace->magic = SMB_ACE4_INT_MAGIC;
        /* ace->next = NULL not needed */
        memcpy(&ace->prop, prop, sizeof(SMB_ACE4PROP_T));
 
-       if (aclint->first==NULL)
+       if (acl->first==NULL)
        {
-               aclint->first = ace;
-               aclint->last = ace;
+               acl->first = ace;
+               acl->last = ace;
        } else {
-               aclint->last->next = (void *)ace;
-               aclint->last = ace;
+               acl->last->next = ace;
+               acl->last = ace;
        }
-       aclint->naces++;
+       acl->naces++;
 
-       return (SMB4ACE_T *)ace;
+       return ace;
 }
 
-SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace)
+SMB_ACE4PROP_T *smb_get_ace4(struct SMB4ACE_T *ace)
 {
-       SMB_ACE4_INT_T *aceint = get_validated_aceint(ace);
-       if (aceint==NULL)
+       if (ace == NULL) {
                return NULL;
+       }
 
-       return &aceint->prop;
+       return &ace->prop;
 }
 
-SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace)
+struct SMB4ACE_T *smb_next_ace4(struct SMB4ACE_T *ace)
 {
-       SMB_ACE4_INT_T *aceint = get_validated_aceint(ace);
-       if (aceint==NULL)
+       if (ace == NULL) {
                return NULL;
+       }
 
-       return (SMB4ACE_T *)aceint->next;
+       return ace->next;
 }
 
-SMB4ACE_T *smb_first_ace4(SMB4ACL_T *theacl)
+struct SMB4ACE_T *smb_first_ace4(struct SMB4ACL_T *acl)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       if (aclint==NULL)
+       if (acl == NULL) {
                return NULL;
+       }
 
-       return (SMB4ACE_T *)aclint->first;
+       return acl->first;
 }
 
-uint32_t smb_get_naces(SMB4ACL_T *theacl)
+uint32_t smb_get_naces(struct SMB4ACL_T *acl)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       if (aclint==NULL)
+       if (acl == NULL) {
                return 0;
+       }
 
-       return aclint->naces;
+       return acl->naces;
 }
 
-uint16_t smbacl4_get_controlflags(SMB4ACL_T *theacl)
+uint16_t smbacl4_get_controlflags(struct SMB4ACL_T *acl)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       if (aclint==NULL)
+       if (acl == NULL) {
                return 0;
+       }
 
-       return aclint->controlflags;
+       return acl->controlflags;
 }
 
-bool smbacl4_set_controlflags(SMB4ACL_T *theacl, uint16_t controlflags)
+bool smbacl4_set_controlflags(struct SMB4ACL_T *acl, uint16_t controlflags)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       if (aclint==NULL)
+       if (acl == NULL) {
                return false;
+       }
 
-       aclint->controlflags = controlflags;
+       acl->controlflags = controlflags;
        return true;
 }
 
@@ -313,7 +271,7 @@ static int smbacl4_GetFileOwner(struct connection_struct 
*conn,
                                const char *filename,
                                SMB_STRUCT_STAT *psbuf)
 {
-       memset(psbuf, 0, sizeof(SMB_STRUCT_STAT));
+       ZERO_STRUCTP(psbuf);
 
        /* Get the stat struct for the owner info. */
        if (vfs_stat_smb_basename(conn, filename, psbuf) != 0)
@@ -328,7 +286,7 @@ static int smbacl4_GetFileOwner(struct connection_struct 
*conn,
 
 static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf)
 {
-       memset(psbuf, 0, sizeof(SMB_STRUCT_STAT));
+       ZERO_STRUCTP(psbuf);
 
        if (fsp->fh->fd == -1) {
                return smbacl4_GetFileOwner(fsp->conn,
@@ -346,7 +304,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, 
SMB_STRUCT_STAT *psbuf)
 
 static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
        smbacl4_vfs_params *params,
-       SMB4ACL_T *theacl, /* in */
+       struct SMB4ACL_T *acl, /* in */
        struct dom_sid *psid_owner, /* in */
        struct dom_sid *psid_group, /* in */
        bool is_directory, /* in */
@@ -354,42 +312,32 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
        int *pgood_aces /* out */
 )
 {
-       SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)theacl;
-       SMB_ACE4_INT_T *aceint;
+       struct SMB4ACE_T *aceint;
        struct security_ace *nt_ace_list = NULL;
        int good_aces = 0;
 
        DEBUG(10, ("%s entered\n", __func__));
 
-       aclint = get_validated_aclint(theacl);
-       /* We do not check for theacl being NULL here
-          because this is already checked in smb_get_nt_acl_nfs4().
-          We reserve twice the number of input aces because one nfs4
-          ace might result in 2 nt aces.*/
-       nt_ace_list = (struct security_ace *)TALLOC_ZERO_SIZE(
-               mem_ctx, 2 * aclint->naces * sizeof(struct security_ace));
+       nt_ace_list = talloc_zero_array(mem_ctx, struct security_ace,
+                                       2 * acl->naces);
        if (nt_ace_list==NULL)
        {
-               DEBUG(10, ("talloc error with %d aces", aclint->naces));
+               DEBUG(10, ("talloc error with %d aces", acl->naces));
                errno = ENOMEM;
                return false;
        }
 
-       for (aceint=aclint->first;
-            aceint!=NULL;
-            aceint=(SMB_ACE4_INT_T *)aceint->next) {
+       for (aceint = acl->first; aceint != NULL; aceint = aceint->next) {
                uint32_t mask;
                struct dom_sid sid;
                SMB_ACE4PROP_T  *ace = &aceint->prop;
                uint32_t win_ace_flags;
 
-               DEBUG(10, ("magic: 0x%x, type: %d, iflags: %x, flags: %x, "
+               DEBUG(10, ("type: %d, iflags: %x, flags: %x, "
                           "mask: %x, who: %d\n",
-                          aceint->magic, ace->aceType, ace->flags,
+                          ace->aceType, ace->flags,
                           ace->aceFlags, ace->aceMask, ace->who.id));
 
-               SMB_ASSERT(aceint->magic==SMB_ACE4_INT_MAGIC);
-
                if (ace->flags & SMB_ACE4_ID_SPECIAL) {
                        switch (ace->who.special_id) {
                        case SMB_ACE4_WHO_OWNER:
@@ -507,9 +455,9 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
                }
        }
 
-       nt_ace_list = (struct security_ace *)
-               TALLOC_REALLOC(mem_ctx, nt_ace_list,
-                                      good_aces * sizeof(struct security_ace));
+       nt_ace_list = talloc_realloc(mem_ctx, nt_ace_list, struct security_ace,
+                                    good_aces);
+
        /* returns a NULL ace list when good_aces is zero. */
        if (good_aces && nt_ace_list == NULL) {
                DEBUG(10, ("realloc error with %d aces", good_aces));
@@ -528,7 +476,7 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const 
SMB_STRUCT_STAT *sbuf,
                                           uint32_t security_info,
                                           TALLOC_CTX *mem_ctx,
                                           struct security_descriptor **ppdesc,
-                                          SMB4ACL_T *theacl)
+                                          struct SMB4ACL_T *theacl)
 {
        int good_aces = 0;
        struct dom_sid sid_owner, sid_group;
@@ -536,6 +484,7 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const 
SMB_STRUCT_STAT *sbuf,
        struct security_ace *nt_ace_list = NULL;
        struct security_acl *psa = NULL;
        TALLOC_CTX *frame = talloc_stackframe();
+       bool ok;
 
        if (theacl==NULL) {
                TALLOC_FREE(frame);
@@ -547,9 +496,10 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const 
SMB_STRUCT_STAT *sbuf,
        uid_to_sid(&sid_owner, sbuf->st_ex_uid);
        gid_to_sid(&sid_group, sbuf->st_ex_gid);
 
-       if (smbacl4_nfs42win(mem_ctx, params, theacl, &sid_owner, &sid_group,
-                            S_ISDIR(sbuf->st_ex_mode),
-                            &nt_ace_list, &good_aces)==false) {
+       ok = smbacl4_nfs42win(frame, params, theacl, &sid_owner, &sid_group,
+                             S_ISDIR(sbuf->st_ex_mode),
+                             &nt_ace_list, &good_aces);
+       if (!ok) {
                DEBUG(8,("smbacl4_nfs42win failed\n"));
                TALLOC_FREE(frame);
                return map_nt_error_from_unix(errno);
@@ -586,7 +536,7 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
                              uint32_t security_info,
                              TALLOC_CTX *mem_ctx,
                              struct security_descriptor **ppdesc,
-                             SMB4ACL_T *theacl)
+                             struct SMB4ACL_T *theacl)
 {
        SMB_STRUCT_STAT sbuf;
        smbacl4_vfs_params params;
@@ -598,7 +548,7 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
        }
 
        /* Special behaviours */
-       if (smbacl4_get_vfs_params(SMBACL4_PARAM_TYPE_NAME, fsp->conn, 
&params)) {
+       if (smbacl4_get_vfs_params(fsp->conn, &params)) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -611,7 +561,7 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
                             uint32_t security_info,
                             TALLOC_CTX *mem_ctx,
                             struct security_descriptor **ppdesc,
-                            SMB4ACL_T *theacl)
+                            struct SMB4ACL_T *theacl)
 {
        SMB_STRUCT_STAT sbuf;
        smbacl4_vfs_params params;
@@ -623,7 +573,7 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
        }
 
        /* Special behaviours */
-       if (smbacl4_get_vfs_params(SMBACL4_PARAM_TYPE_NAME, conn, &params)) {
+       if (smbacl4_get_vfs_params(conn, &params)) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -631,16 +581,13 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct 
*conn,
                                          mem_ctx, ppdesc, theacl);
 }
 
-static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *theacl)
+static void smbacl4_dump_nfs4acl(int level, struct SMB4ACL_T *acl)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       SMB_ACE4_INT_T *aceint;
+       struct SMB4ACE_T *aceint;
 
-       DEBUG(level, ("NFS4ACL: size=%d\n", aclint->naces));
+       DEBUG(level, ("NFS4ACL: size=%d\n", acl->naces));
 
-       for (aceint = aclint->first;
-            aceint!=NULL;
-            aceint=(SMB_ACE4_INT_T *)aceint->next) {
+       for (aceint = acl->first; aceint != NULL; aceint = aceint->next) {
                SMB_ACE4PROP_T *ace = &aceint->prop;
 
                DEBUG(level, ("\tACE: type=%d, flags=0x%x, fflags=0x%x, "
@@ -658,14 +605,12 @@ static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T 
*theacl)
  * return ace if found matching; otherwise NULL
  */
 static SMB_ACE4PROP_T *smbacl4_find_equal_special(
-       SMB4ACL_T *theacl,
+       struct SMB4ACL_T *acl,
        SMB_ACE4PROP_T *aceNew)
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       SMB_ACE4_INT_T *aceint;
+       struct SMB4ACE_T *aceint;
 
-       for (aceint = aclint->first; aceint != NULL;
-            aceint=(SMB_ACE4_INT_T *)aceint->next) {
+       for (aceint = acl->first; aceint != NULL; aceint = aceint->next) {
                SMB_ACE4PROP_T *ace = &aceint->prop;
 
                DEBUG(10,("ace type:0x%x flags:0x%x aceFlags:0x%x "
@@ -711,7 +656,7 @@ static bool smbacl4_fill_ace4(
 {
        DEBUG(10, ("got ace for %s\n", sid_string_dbg(&ace_nt->trustee)));
 
-       memset(ace_v4, 0, sizeof(SMB_ACE4PROP_T));
+       ZERO_STRUCTP(ace_v4);
 
        /* only ACCESS|DENY supported right now */
        ace_v4->aceType = ace_nt->type;
@@ -795,7 +740,7 @@ static bool smbacl4_fill_ace4(
 
 static int smbacl4_MergeIgnoreReject(
        enum smbacl4_acedup_enum acedup,
-       SMB4ACL_T *theacl, /* may modify it */
+       struct SMB4ACL_T *theacl, /* may modify it */
        SMB_ACE4PROP_T *ace, /* the "new" ACE */
        bool    *paddNewACE,
        int     i
@@ -828,15 +773,14 @@ static int smbacl4_MergeIgnoreReject(
 }
 
 static int smbacl4_substitute_special(
-       SMB4ACL_T *theacl,
+       struct SMB4ACL_T *acl,
        uid_t ownerUID,
        gid_t ownerGID
 )
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       SMB_ACE4_INT_T *aceint;
+       struct SMB4ACE_T *aceint;
 
-       for(aceint = aclint->first; aceint!=NULL; aceint=(SMB_ACE4_INT_T 
*)aceint->next) {
+       for (aceint = acl->first; aceint != NULL; aceint = aceint->next) {
                SMB_ACE4PROP_T *ace = &aceint->prop;
 
                DEBUG(10,("ace type: %d, iflags: %x, flags: %x, "
@@ -864,15 +808,14 @@ static int smbacl4_substitute_special(
 }
 
 static int smbacl4_substitute_simple(
-       SMB4ACL_T *theacl,
+       struct SMB4ACL_T *acl,
        uid_t ownerUID,
        gid_t ownerGID
 )
 {
-       SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       SMB_ACE4_INT_T *aceint;
+       struct SMB4ACE_T *aceint;


-- 
Samba Shared Repository

Reply via email to