From 86c16092194836d8478144b97da9ca08aec7fac6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Nov 2011 16:49:42 -0800 Subject: Always set the attribute first, before the time. --- source3/smbd/reply.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 0adc4e80f6..541789d846 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1269,13 +1269,6 @@ void reply_setatr(struct smb_request *req) mode = SVAL(req->vwv+0, 0); mtime = srv_make_unix_date3(req->vwv+1); - ft.mtime = convert_time_t_to_timespec(mtime); - status = smb_set_file_time(conn, NULL, smb_fname, &ft, true); - if (!NT_STATUS_IS_OK(status)) { - reply_nterror(req, status); - goto out; - } - if (mode != FILE_ATTRIBUTE_NORMAL) { if (VALID_STAT_OF_DIR(smb_fname->st)) mode |= FILE_ATTRIBUTE_DIRECTORY; @@ -1289,6 +1282,13 @@ void reply_setatr(struct smb_request *req) } } + ft.mtime = convert_time_t_to_timespec(mtime); + status = smb_set_file_time(conn, NULL, smb_fname, &ft, true); + if (!NT_STATUS_IS_OK(status)) { + reply_nterror(req, status); + goto out; + } + reply_outbuf(req, 0, 0); DEBUG(3, ("setatr name=%s mode=%d\n", smb_fname_str_dbg(smb_fname), -- cgit