vfs: add acl type arg to SMB_VFS_SYS_ACL_SET_FD()
[samba.git] / source3 / modules / vfs_nfs4acl_xattr.c
index 5c80d1b03265a1f9bdb5a102ced514f3ea47d1a5..33bf0661648ac3b031498ec9170951e8597c0d5d 100644 (file)
@@ -133,7 +133,7 @@ static NTSTATUS nfs4acl_get_blob(struct vfs_handle_struct *handle,
                        return NT_STATUS_NO_MEMORY;
                }
 
-               if (fsp != NULL && fsp->fh->fd != -1) {
+               if (fsp != NULL && fsp_get_pathref_fd(fsp) != -1) {
                        length = SMB_VFS_NEXT_FGETXATTR(handle,
                                                        fsp,
                                                        config->xattr_name,
@@ -262,41 +262,6 @@ static NTSTATUS nfs4acl_xattr_fget_nt_acl(struct vfs_handle_struct *handle,
        return status;
 }
 
-static NTSTATUS nfs4acl_xattr_get_nt_acl(struct vfs_handle_struct *handle,
-                                 const struct smb_filename *smb_fname,
-                                 uint32_t security_info,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct security_descriptor **sd)
-{
-       struct SMB4ACL_T *smb4acl = NULL;
-       TALLOC_CTX *frame = talloc_stackframe();
-       DATA_BLOB blob;
-       NTSTATUS status;
-
-       status = nfs4acl_get_blob(handle, NULL, smb_fname, frame, &blob);
-       if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
-               TALLOC_FREE(frame);
-               return nfs4acl_xattr_default_sd(
-                       handle, smb_fname, mem_ctx, sd);
-       }
-       if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(frame);
-               return status;
-       }
-
-       status = nfs4acl_blob_to_smb4(handle, &blob, frame, &smb4acl);
-       if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(frame);
-               return status;
-       }
-
-       status = smb_get_nt_acl_nfs4(handle->conn, smb_fname, NULL,
-                                    security_info, mem_ctx, sd,
-                                    smb4acl);
-       TALLOC_FREE(frame);
-       return status;
-}
-
 static NTSTATUS nfs4acl_xattr_get_nt_acl_at(struct vfs_handle_struct *handle,
                                struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname,
@@ -370,7 +335,7 @@ static bool nfs4acl_smb4acl_set_fn(vfs_handle_struct *handle,
                return false;
        }
 
-       if (fsp->fh->fd != -1) {
+       if (fsp_get_pathref_fd(fsp) != -1) {
                ret = SMB_VFS_NEXT_FSETXATTR(handle, fsp, config->xattr_name,
                                             blob.data, blob.length, 0);
        } else {
@@ -431,7 +396,7 @@ static NTSTATUS nfs4acl_xattr_fset_nt_acl(vfs_handle_struct *handle,
 
                restored_mode = existing_mode | expected_mode;
 
-               if (fsp->fh->fd != -1) {
+               if (fsp_get_io_fd(fsp) != -1) {
                        ret = SMB_VFS_NEXT_FCHMOD(handle,
                                                  fsp,
                                                  restored_mode);
@@ -665,6 +630,7 @@ static int nfs4acl_xattr_fail__sys_acl_set_file(vfs_handle_struct *handle,
 
 static int nfs4acl_xattr_fail__sys_acl_set_fd(vfs_handle_struct *handle,
                                       files_struct *fsp,
+                                      SMB_ACL_TYPE_T type,
                                       SMB_ACL_T theacl)
 {
        return -1;
@@ -695,7 +661,6 @@ static int nfs4acl_xattr_fail__sys_acl_blob_get_fd(vfs_handle_struct *handle, fi
 static struct vfs_fn_pointers nfs4acl_xattr_fns = {
        .connect_fn = nfs4acl_connect,
        .fget_nt_acl_fn = nfs4acl_xattr_fget_nt_acl,
-       .get_nt_acl_fn = nfs4acl_xattr_get_nt_acl,
        .get_nt_acl_at_fn = nfs4acl_xattr_get_nt_acl_at,
        .fset_nt_acl_fn = nfs4acl_xattr_fset_nt_acl,