summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-09-16 20:06:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:40 -0500
commit20f2305c50dc7eedd3b211a13937b2ed85235971 (patch)
tree228cc75b84f5591f6815fb6f0ca5c09d9e999649 /source3/smbd
parent5d5d0b2f3b684e332c24b56e7b320682a830295a (diff)
downloadsamba-20f2305c50dc7eedd3b211a13937b2ed85235971.tar.gz
samba-20f2305c50dc7eedd3b211a13937b2ed85235971.tar.bz2
samba-20f2305c50dc7eedd3b211a13937b2ed85235971.zip
r10276: Fix for bug #3104 from Leo Weppelman <leo@wau.mis.ah.nl>.
Don't update the time on read-only shares. We need this as set_filetime (which can be called on close and other paths) can end up calling this function without the NEED_WRITE protection. Jeremy. (This used to be commit 54eab3828aa0405288b68f6954abba201564c9e7)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/dosmode.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index a2bc424b8e..ee2f1095fa 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -451,6 +451,17 @@ int file_utime(connection_struct *conn, const char *fname, struct utimbuf *times
errno = 0;
ZERO_STRUCT(sbuf);
+ /* Don't update the time on read-only shares */
+ /* We need this as set_filetime (which can be called on
+ close and other paths) can end up calling this function
+ without the NEED_WRITE protection. Found by :
+ Leo Weppelman <leo@wau.mis.ah.nl>
+ */
+
+ if (!CAN_WRITE(conn)) {
+ return 0;
+ }
+
if(SMB_VFS_UTIME(conn,fname, times) == 0)
return 0;