We need to return the correct atime
authorVolker Lendecke <vl@samba.org>
Wed, 26 Dec 2007 13:18:11 +0000 (14:18 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 26 Dec 2007 13:55:57 +0000 (14:55 +0100)
On systems with nanosecond atime we need to re-stat after messing with the fd,
at least Solaris 10 updates atime after we stat(2)ed the file.

source/smbd/open.c

index 9428b47b6a2776c233f2a381303bfd1e950fb5f5..f30808b30ac2ea458264604a512098c206614e83 100644 (file)
@@ -2667,7 +2667,12 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
                *pinfo = info;
        }
        if (psbuf != NULL) {
-               *psbuf = sbuf;
+               if ((fsp->fh == NULL) || (fsp->fh->fd == -1)) {
+                       *psbuf = sbuf;
+               }
+               else {
+                       SMB_VFS_FSTAT(fsp, fsp->fh->fd, psbuf);
+               }
        }
        return NT_STATUS_OK;