s3-vfs: Add pread_send/recv to vfs modules
[kai/samba.git] / source3 / modules / vfs_acl_xattr.c
index 90959f322e0e28d5d6a1fa9c25d59d264a08a5ce..c1b0a60e16a7c5457b7e6e731a1a2bfffb30bd5a 100644 (file)
@@ -18,8 +18,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-/* NOTE: This is an experimental module, not yet finished. JRA. */
-
 #include "includes.h"
 #include "smbd/smbd.h"
 #include "librpc/gen_ndr/xattr.h"
@@ -55,7 +53,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 
   again:
 
-       tmp = TALLOC_REALLOC_ARRAY(ctx, val, uint8_t, size);
+       tmp = talloc_realloc(ctx, val, uint8_t, size);
        if (tmp == NULL) {
                TALLOC_FREE(val);
                return NT_STATUS_NO_MEMORY;
@@ -121,12 +119,12 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
        }
        unbecome_root();
        if (ret) {
-               errno = saved_errno;
                DEBUG(5, ("store_acl_blob_fsp: setting attr failed for file %s"
                        "with error %s\n",
                        fsp_str_dbg(fsp),
-                       strerror(errno) ));
-               return map_nt_error_from_unix(errno);
+                       strerror(saved_errno) ));
+               errno = saved_errno;
+               return map_nt_error_from_unix(saved_errno);
        }
        return NT_STATUS_OK;
 }
@@ -203,21 +201,17 @@ static int connect_acl_xattr(struct vfs_handle_struct *handle,
 
 static struct vfs_fn_pointers vfs_acl_xattr_fns = {
        .connect_fn = connect_acl_xattr,
-       .opendir = opendir_acl_common,
-       .mkdir = mkdir_acl_common,
-       .rmdir = rmdir_acl_common,
-       .open = open_acl_common,
-       .create_file = create_file_acl_common,
-       .unlink = unlink_acl_common,
-       .chmod = chmod_acl_module_common,
-       .fchmod = fchmod_acl_module_common,
-       .fget_nt_acl = fget_nt_acl_common,
-       .get_nt_acl = get_nt_acl_common,
-       .fset_nt_acl = fset_nt_acl_common,
-       .chmod_acl = chmod_acl_acl_module_common,
-       .fchmod_acl = fchmod_acl_acl_module_common,
-       .sys_acl_set_file = sys_acl_set_file_xattr,
-       .sys_acl_set_fd = sys_acl_set_fd_xattr
+       .rmdir_fn = rmdir_acl_common,
+       .unlink_fn = unlink_acl_common,
+       .chmod_fn = chmod_acl_module_common,
+       .fchmod_fn = fchmod_acl_module_common,
+       .fget_nt_acl_fn = fget_nt_acl_common,
+       .get_nt_acl_fn = get_nt_acl_common,
+       .fset_nt_acl_fn = fset_nt_acl_common,
+       .chmod_acl_fn = chmod_acl_acl_module_common,
+       .fchmod_acl_fn = fchmod_acl_acl_module_common,
+       .sys_acl_set_file_fn = sys_acl_set_file_xattr,
+       .sys_acl_set_fd_fn = sys_acl_set_fd_xattr
 };
 
 NTSTATUS vfs_acl_xattr_init(void)