If we delete the file on close, the stat after the close
will fail so we fail to return the attributes requested.
Bug 11104 - SMB2/SMB3 close response does not include attributes when requested.
https://bugzilla.samba.org/show_bug.cgi?id=11104
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <sfrench@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 20 20:54:18 CET 2015 on sn-devel-104
return NT_STATUS_NO_MEMORY;
}
+ if ((in_flags & SMB2_CLOSE_FLAGS_FULL_INFORMATION) &&
+ (fsp->initial_delete_on_close || fsp->delete_on_close)) {
+ /*
+ * We might be deleting the file. Ensure we
+ * return valid data from before the file got
+ * removed.
+ */
+ setup_close_full_information(conn,
+ smb_fname,
+ posix_open,
+ out_creation_ts,
+ out_last_access_ts,
+ out_last_write_ts,
+ out_change_ts,
+ &flags,
+ &allocation_size,
+ &file_size,
+ &dos_attrs);
+ }
+
status = close_file(smbreq, fsp, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(5,("smbd_smb2_close: close_file[%s]: %s\n",