summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-11-17 23:44:52 +0000
committerJeremy Allison <jra@samba.org>1998-11-17 23:44:52 +0000
commit490439d77a7fe3daadce1f30f17f03896c6739aa (patch)
tree3f183b3cc8b3c0a6e8c5b9fdb90c7798f1f954ef /source3/smbd/trans2.c
parent157fe90d2ea172faa0b2f4e5fe5bfb8ce44a6520 (diff)
downloadsamba-490439d77a7fe3daadce1f30f17f03896c6739aa.tar.gz
samba-490439d77a7fe3daadce1f30f17f03896c6739aa.tar.bz2
samba-490439d77a7fe3daadce1f30f17f03896c6739aa.zip
Fixed NT modify timestamp issue.
If a client does a modify timestamp on an open file (which will do no good at all on UNIX :-) then keep the modify request pending in the files_struct and apply it at close instead. Jeremy. (This used to be commit 92a7a86f0e0255e3812dd35bebfcd653091514ae)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index f1d415e290..81ba511c77 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1496,14 +1496,16 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
char *fname;
int fd = -1;
BOOL bad_path = False;
+ files_struct *fsp = NULL;
if (!CAN_WRITE(conn))
return(ERROR(ERRSRV,ERRaccess));
if (tran_call == TRANSACT2_SETFILEINFO) {
- files_struct *fsp = file_fsp(params,0);
info_level = SVAL(params,2);
+ fsp = file_fsp(params,0);
+
if(fsp && fsp->open && fsp->is_directory) {
/*
* This is actually a SETFILEINFO on a directory
@@ -1802,7 +1804,18 @@ dev = %x, inode = %.0f\n", iterate_fsp->fnum, (unsigned int)dev, (double)inode))
*/
if (st.st_mtime != tvs.modtime || st.st_atime != tvs.actime)
{
- if(file_utime(conn, fname, &tvs)!=0)
+ if(fsp != NULL)
+ {
+ /*
+ * This was a setfileinfo on an open file.
+ * NT does this a lot. It's actually pointless
+ * setting the time here, as it will be overwritten
+ * on the next write, so we save the request
+ * away and will set it on file code. JRA.
+ */
+ fsp->pending_modtime = tvs.modtime;
+ }
+ else if(file_utime(conn, fname, &tvs)!=0)
{
return(UNIXERROR(ERRDOS,ERRnoaccess));
}