s3: cmd_vfs: cmd_set_nt_acl(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st...
[bbaumbach/samba-autobuild/.git] / source3 / torture / cmd_vfs.c
index b1c8b128e0b778bc203e390e25f4596b5aa168de..470f039c4a39d8b7e8dc60f6d690f39909615384 100644 (file)
@@ -1712,7 +1712,6 @@ static NTSTATUS cmd_fset_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
 static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        int flags;
-       int ret;
        mode_t mode;
        files_struct *fsp;
        struct files_struct *fspcwd = NULL;
@@ -1783,18 +1782,13 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
        }
        fsp_set_fd(fsp, fd);
 
-       status = NT_STATUS_OK;
-       ret = SMB_VFS_FSTAT(fsp, &smb_fname->st);
-       if (ret == -1) {
+       status = vfs_stat_fsp(fsp);
+       if (!NT_STATUS_IS_OK(status)) {
                /* If we have an fd, this stat should succeed. */
                DEBUG(0,("Error doing fstat on open file %s "
                         "(%s)\n",
                         smb_fname_str_dbg(smb_fname),
-                        strerror(errno) ));
-               status = map_nt_error_from_unix(errno);
-       }
-       
-       if (!NT_STATUS_IS_OK(status)) {
+                        nt_errstr(status) ));
                goto out;
        }