summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-12-16 21:04:19 +0000
committerJeremy Allison <jra@samba.org>2001-12-16 21:04:19 +0000
commit0fd94a5c4b659e715e16fa4b2d5102520412ad55 (patch)
tree49c6435e62fa301fa34c5b8cb558cf84697ebe3f /source3/smbd/reply.c
parent9c1120faeb116ef0bdbf03a9f2bd30fadced0007 (diff)
downloadsamba-0fd94a5c4b659e715e16fa4b2d5102520412ad55.tar.gz
samba-0fd94a5c4b659e715e16fa4b2d5102520412ad55.tar.bz2
samba-0fd94a5c4b659e715e16fa4b2d5102520412ad55.zip
Ensured filetimes set (by name) after close. Ignore errors. This is the
correct way to ensure times set in 'pending modtime' and 'time close' are always set correctly. Inspired by patch from Juergen Hasch. Jeremy. (This used to be commit 24053858543fa6c22c0c3222570109fbfdabab9e)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 675c06f75f..00e0cb8b86 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2242,21 +2242,10 @@ int reply_close(connection_struct *conn, char *inbuf,char *outbuf, int size,
* Close ordinary file.
*/
int close_err;
+ pstring file_name;
- /*
- * If there was a modify time outstanding,
- * try and set it here.
- */
- if(fsp->pending_modtime)
- set_filetime(conn, fsp->fsp_name, fsp->pending_modtime);
-
- /*
- * Now take care of any time sent in the close.
- */
- mtime = make_unix_date3(inbuf+smb_vwv1);
-
- /* try and set the date */
- set_filetime(conn, fsp->fsp_name,mtime);
+ /* Save the name for time set in close. */
+ pstrcpy( file_name, fsp->fsp_name);
DEBUG(3,("close fd=%d fnum=%d (numopen=%d)\n",
fsp->fd, fsp->fnum,
@@ -2273,6 +2262,16 @@ int reply_close(connection_struct *conn, char *inbuf,char *outbuf, int size,
END_PROFILE(SMBclose);
return (UNIXERROR(ERRHRD,ERRgeneral));
}
+
+ /*
+ * Now take care of any time sent in the close.
+ */
+
+ mtime = make_unix_date3(inbuf+smb_vwv1);
+
+ /* try and set the date */
+ set_filetime(conn, file_name, mtime);
+
}
/* We have a cached error */