s3: smbd: Fix timestamp rounding inside SMB2 create.
authorJeremy Allison <jra@samba.org>
Fri, 29 Jan 2016 00:35:13 +0000 (16:35 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Feb 2016 14:33:08 +0000 (15:33 +0100)
Setting "dos filetime resolution = yes" should round
to 2 second increments. Fix missing path inside smbd.

Fix confirmed by reporter Hubert Gilch <hg@sepag.de>.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11703

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 29 10:41:01 CET 2016 on sn-devel-144

(cherry picked from commit 8024f532e6bcb6cbd8179817fafdd0f12929d629)

Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-3-test): Tue Feb  2 15:33:08 CET 2016 on sn-devel-104

source3/smbd/smb2_create.c

index ad21533a0cb507d70c5786ccb5079478c4909733..76d6d6915ffface4870daffa60b3136f5ab58a14 100644 (file)
@@ -1281,6 +1281,14 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
        state->out_last_write_ts = result->fsp_name->st.st_ex_mtime;
        state->out_change_ts = get_change_timespec(smb1req->conn,
                                        result, result->fsp_name);
+
+       if (lp_dos_filetime_resolution(SNUM(smb2req->tcon->compat))) {
+               dos_filetime_timespec(&state->out_creation_ts);
+               dos_filetime_timespec(&state->out_last_access_ts);
+               dos_filetime_timespec(&state->out_last_write_ts);
+               dos_filetime_timespec(&state->out_change_ts);
+       }
+
        state->out_allocation_size =
                        SMB_VFS_GET_ALLOC_SIZE(smb1req->conn, result,
                                               &(result->fsp_name->st));