summaryrefslogtreecommitdiffstats
path: root/source3/smbd/smb2_close.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2015-02-19 18:49:03 -0800
committerJeremy Allison <jra@samba.org>2015-02-20 18:25:06 +0100
commit4a8c6988e349a4f714f3052ebf3f96f801d3c11f (patch)
tree735566660671e7e50d6f68333fd10e94e12b30a4 /source3/smbd/smb2_close.c
parent2ccfdf760e4adcf25d59c629c9d6d6b31a10a9f1 (diff)
downloadsamba-4a8c6988e349a4f714f3052ebf3f96f801d3c11f.tar.gz
samba-4a8c6988e349a4f714f3052ebf3f96f801d3c11f.tar.xz
samba-4a8c6988e349a4f714f3052ebf3f96f801d3c11f.zip
s3: smbd: SMB2 close. Call utility function setup_close_full_information()
Replaces existing inline code. 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>
Diffstat (limited to 'source3/smbd/smb2_close.c')
-rw-r--r--source3/smbd/smb2_close.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/source3/smbd/smb2_close.c b/source3/smbd/smb2_close.c
index 40c2d30d57..755a4b69f3 100644
--- a/source3/smbd/smb2_close.c
+++ b/source3/smbd/smb2_close.c
@@ -245,32 +245,17 @@ static NTSTATUS smbd_smb2_close(struct smbd_smb2_request *req,
}
if (in_flags & SMB2_CLOSE_FLAGS_FULL_INFORMATION) {
- int ret;
- if (posix_open) {
- ret = SMB_VFS_LSTAT(conn, smb_fname);
- } else {
- ret = SMB_VFS_STAT(conn, smb_fname);
- }
- if (ret == 0) {
- flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION;
- dos_attrs = dos_mode(conn, smb_fname);
- *out_last_write_ts = smb_fname->st.st_ex_mtime;
- *out_last_access_ts = smb_fname->st.st_ex_atime;
- *out_creation_ts = get_create_timespec(conn, NULL, smb_fname);
- *out_change_ts = get_change_timespec(conn, NULL, smb_fname);
-
- if (lp_dos_filetime_resolution(SNUM(conn))) {
- dos_filetime_timespec(out_creation_ts);
- dos_filetime_timespec(out_last_write_ts);
- dos_filetime_timespec(out_last_access_ts);
- dos_filetime_timespec(out_change_ts);
- }
- if (!(dos_attrs & FILE_ATTRIBUTE_DIRECTORY)) {
- file_size = get_file_size_stat(&smb_fname->st);
- }
-
- allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, NULL, &smb_fname->st);
- }
+ 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);
}
*out_flags = flags;