diff options
author | Jeremy Allison <jra@samba.org> | 2013-04-25 13:59:22 -0700 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-04-27 14:10:52 +0200 |
commit | 0d88b37fc63023eeb749080713449b124e346e9e (patch) | |
tree | 113f51595096e46307f17bec2dd632b19f4c24f1 /source3 | |
parent | 8283fd0e0090ed12b0b12d5acb550642d621b026 (diff) | |
download | samba-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.c | 5 |
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); |