diff options
author | Jeremy Allison <jra@samba.org> | 2013-12-03 17:22:19 -0800 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-12-05 08:12:09 +0100 |
commit | a926d0f4616e70d0e50222b5b6b03f4be374ff3e (patch) | |
tree | 98b27fd8e311afb0fae7a6f438131bf9cf0e46a9 /source3 | |
parent | 97e8b56250f30e73ad4bdcae292fe5c0df65e69a (diff) | |
download | samba-a926d0f4616e70d0e50222b5b6b03f4be374ff3e.tar.gz samba-a926d0f4616e70d0e50222b5b6b03f4be374ff3e.tar.xz samba-a926d0f4616e70d0e50222b5b6b03f4be374ff3e.zip |
smbd - allow updates on directory write times on open handles.
If we set a non-null 'old timestamp' in the share mode database
when creating a directory handle, this prevents mtime (write time)
updates from being seen by clients, as we will always return the
timestamp stored in the database whilst the handle is open.
For files this is ok, as we update the stored timestamp
ourselves when we write to the handle. For directories
we should just rely on the mtime value from the underlying
filesystem.
Torture test to follow.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9870
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/open.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 2d866bbce52..200c1ce08ce 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3202,7 +3202,14 @@ static NTSTATUS open_directory(connection_struct *conn, return status; } - mtimespec = smb_dname->st.st_ex_mtime; + /* Don't store old timestamps for directory + handles in the internal database. We don't + update them in there if new objects + are creaded in the directory. Currently + we only update timestamps on file writes. + See bug #9870. + */ + ZERO_STRUCT(mtimespec); #ifdef O_DIRECTORY status = fd_open(conn, fsp, O_RDONLY|O_DIRECTORY, 0); |