s3: smbd: Fix timestamp rounding inside SMB2 create.
authorJeremy Allison <jra@samba.org>
Fri, 29 Jan 2016 00:35:13 +0000 (16:35 -0800)
committerVolker Lendecke <vl@samba.org>
Fri, 29 Jan 2016 09:41:01 +0000 (10:41 +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

source3/smbd/smb2_create.c

index 54a598d663d1540137e71fcad134f9bb66974870..62948a06969b6b4a6bd4a50b592f0c4d510f8d1c 100644 (file)
@@ -1280,6 +1280,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));