vfs: Fix alternative posix and no-op sys acl implementations to take a mem_ctx
authorAndrew Bartlett <abartlet@samba.org>
Thu, 11 Oct 2012 03:42:39 +0000 (14:42 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 11 Oct 2012 03:45:03 +0000 (14:45 +1100)
These were missed with the initial conversion to use a talloc context.

Andrew Bartlett

source3/lib/sysacls.c
source3/modules/vfs_aixacl.c
source3/modules/vfs_irixacl.c
source3/modules/vfs_solarisacl.c

index 22454910309b6729ee7e1b6782fb15b2f9e52d92..d77b2a6822bcd08c1b92b90131adfa9d2040bcfc 100644 (file)
@@ -395,14 +395,16 @@ int sys_acl_delete_def_file(vfs_handle_struct *handle,
 #elif defined(HAVE_AIX_ACLS)
 
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type)
+                          const char *path_p, SMB_ACL_TYPE_T type,
+                          TALLOC_CTX *mem_ctx)
 {
-       return aixacl_sys_acl_get_file(handle, path_p, type);
+       return aixacl_sys_acl_get_file(handle, path_p, type, mem_ctx);
 }
 
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
+SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+                          TALLOC_CTX *mem_ctx)
 {
-       return aixacl_sys_acl_get_fd(handle, fsp);
+       return aixacl_sys_acl_get_fd(handle, fsp, mem_ctx);
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
@@ -426,14 +428,17 @@ int sys_acl_delete_def_file(vfs_handle_struct *handle,
 #elif defined(HAVE_TRU64_ACLS)
  
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type)
+                          const char *path_p, SMB_ACL_TYPE_T type,
+                          TALLOC_CTX *mem_ctx)
 {
-       return tru64acl_sys_acl_get_file(handle, path_p, type);
+       return tru64acl_sys_acl_get_file(handle, path_p, type,
+                                        mem_ctx);
 }
 
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
+SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+                        TALLOC_CTX *mem_ctx)
 {
-       return tru64acl_sys_acl_get_fd(handle, fsp);
+       return tru64acl_sys_acl_get_fd(handle, fsp, mem_ctx);
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
@@ -457,14 +462,18 @@ int sys_acl_delete_def_file(vfs_handle_struct *handle,
 #elif defined(HAVE_SOLARIS_ACLS) || defined(HAVE_UNIXWARE_ACLS)
 
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type)
+                          const char *path_p, SMB_ACL_TYPE_T type,
+                          TALLOC_CTX *mem_ctx)
 {
-       return solarisacl_sys_acl_get_file(handle, path_p, type);
+       return solarisacl_sys_acl_get_file(handle, path_p, type,
+                                          mem_ctx);
 }
 
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
+SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+                        TALLOC_CTX *mem_ctx)
 {
-       return solarisacl_sys_acl_get_fd(handle, fsp);
+       return solarisacl_sys_acl_get_fd(handle, fsp,
+                                        mem_ctx);
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
@@ -488,14 +497,16 @@ int sys_acl_delete_def_file(vfs_handle_struct *handle,
 #elif defined(HAVE_HPUX_ACLS)
 
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type)
+                          const char *path_p, SMB_ACL_TYPE_T type,
+                          TALLOC_CTX *mem_ctx)
 {
-       return hpuxacl_sys_acl_get_file(handle, path_p, type);
+       return hpuxacl_sys_acl_get_file(handle, path_p, type, mem_ctx);
 }
 
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
+SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+                          TALLOC_CTX *mem_ctx)
 {
-       return hpuxacl_sys_acl_get_fd(handle, fsp);
+       return hpuxacl_sys_acl_get_fd(handle, fsp, mem_ctx);
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
@@ -519,14 +530,16 @@ int sys_acl_delete_def_file(vfs_handle_struct *handle,
 #elif defined(HAVE_IRIX_ACLS)
 
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type)
+                          const char *path_p, SMB_ACL_TYPE_T type,
+                          TALLOC_CTX *mem_ctx)
 {
-       return irixacl_sys_acl_get_file(handle, path_p, type);
+       return irixacl_sys_acl_get_file(handle, path_p, type, mem_ctx);
 }
 
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
+SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+                        TALLOC_CTX *mem_ctx)
 {
-       return irixacl_sys_acl_get_fd(handle, fsp);
+       return irixacl_sys_acl_get_fd(handle, fsp, mem_ctx);
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
@@ -550,7 +563,8 @@ int sys_acl_delete_def_file(vfs_handle_struct *handle,
 #else /* No ACLs. */
 
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type)
+                          const char *path_p, SMB_ACL_TYPE_T type,
+                          TALLOC_CTX *mem_ctx)
 {
 #ifdef ENOTSUP
        errno = ENOTSUP;
@@ -560,7 +574,8 @@ SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
        return NULL;
 }
 
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
+SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+                        TALLOC_CTX *mem_ctx)
 {
 #ifdef ENOTSUP
        errno = ENOTSUP;
index 25d9089ba5cf7b83bd064430cd98f90e95fa9042..459ea6f2979e7c743bc958e3cbf21661d4d1b33f 100644 (file)
@@ -23,8 +23,9 @@
 #include "vfs_aixacl_util.h"
 
 SMB_ACL_T aixacl_sys_acl_get_file(vfs_handle_struct *handle,
-                                   const char *path_p,
-                                   SMB_ACL_TYPE_T type)
+                                 const char *path_p,
+                                 SMB_ACL_TYPE_T type,
+                                 TALLOC_CTX *mem_ctx)
 {
        struct acl *file_acl = (struct acl *)NULL;
        struct smb_acl_t *result = (struct smb_acl_t *)NULL;
@@ -71,7 +72,7 @@ SMB_ACL_T aixacl_sys_acl_get_file(vfs_handle_struct *handle,
        DEBUG(10,("Got facl and returned it\n"));
 
        
-       result = aixacl_to_smbacl(file_acl);
+       result = aixacl_to_smbacl(file_acl, mem_ctx);
        SAFE_FREE(file_acl);
        return result;
        
@@ -80,7 +81,8 @@ SMB_ACL_T aixacl_sys_acl_get_file(vfs_handle_struct *handle,
 }
 
 SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
-                               files_struct *fsp)
+                               files_struct *fsp,
+                               TALLOC_CTX *mem_ctx)
 {
 
        struct acl *file_acl = (struct acl *)NULL;
@@ -122,7 +124,7 @@ SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
 
        DEBUG(10,("Got facl and returned it\n"));
 
-       result = aixacl_to_smbacl(file_acl);
+       result = aixacl_to_smbacl(file_acl, mem_ctx);
        SAFE_FREE(file_acl);
        return result;
        
index b3972246b9a24afc076001a1c2093c865a57813c..78484fc7f815d7a5017cbed64f2e554e401eff8c 100644 (file)
 /* public functions - the api */
 
 SMB_ACL_T irixacl_sys_acl_get_file(vfs_handle_struct *handle,
-                                   const char *path_p,
-                                   SMB_ACL_TYPE_T type)
+                                  const char *path_p,
+                                  SMB_ACL_TYPE_T type,
+                                  TALLOC_CTX *mem_ctx)
 {
        errno = ENOTSUP;
        return NULL;
 }
 
 SMB_ACL_T irixacl_sys_acl_get_fd(vfs_handle_struct *handle,
-                                files_struct *fsp)
+                                files_struct *fsp,
+                                TALLOC_CTX *mem_ctx)
 {
        errno = ENOTSUP;
        return NULL;
index a5f787f49410b43ead3676ababb1e238b024c957..dd5fe82cfa906abb45695efa01747f731f8910fe 100644 (file)
@@ -120,7 +120,7 @@ SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
         * access acl. So we need to filter this out here.  
         */
        result = solaris_acl_to_smb_acl(solaris_acl, count,
-                                       SMB_ACL_TYPE_ACCESS);
+                                       SMB_ACL_TYPE_ACCESS, mem_ctx);
        if (result == NULL) {
                DEBUG(10, ("conversion solaris_acl -> smb_acl failed (%s).\n",
                           strerror(errno)));