summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-25 13:59:22 -0700
committerVolker Lendecke <vl@samba.org>2013-04-27 14:10:52 +0200
commit0d88b37fc63023eeb749080713449b124e346e9e (patch)
tree113f51595096e46307f17bec2dd632b19f4c24f1 /source3
parent8283fd0e0090ed12b0b12d5acb550642d621b026 (diff)
downloadsamba-0d88b37fc63023eeb749080713449b124e346e9e.tar.gz
samba-0d88b37fc63023eeb749080713449b124e346e9e.tar.bz2
samba-0d88b37fc63023eeb749080713449b124e346e9e.zip
Add early return in file_set_dosmode() on a read only share.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dosmode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 19b7675a54..cd7a1fdca1 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -706,6 +706,11 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
uint32_t old_mode;
struct timespec new_create_timespec;
+ if (!CAN_WRITE(conn)) {
+ errno = EROFS;
+ return -1;
+ }
+
/* We only allow READONLY|HIDDEN|SYSTEM|DIRECTORY|ARCHIVE here. */
dosmode &= (SAMBA_ATTRIBUTES_MASK | FILE_ATTRIBUTE_OFFLINE);