summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-25 14:02:24 -0700
committerVolker Lendecke <vl@samba.org>2013-04-27 14:11:10 +0200
commit77e3099483489ef4d59087dc6542fe7f7b589224 (patch)
tree34f2ff96e912ca805a09379d7d34b50638ea0af8 /source3/smbd
parenta91aac4a5f0bd2077be267e49d1fc4f0321bb39c (diff)
downloadsamba-77e3099483489ef4d59087dc6542fe7f7b589224.tar.gz
samba-77e3099483489ef4d59087dc6542fe7f7b589224.tar.bz2
samba-77e3099483489ef4d59087dc6542fe7f7b589224.zip
Ensure we don't try the open_file_fchmod() if we can't write to the file.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/smbd')
-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 1fb00886f7..4a34947e25 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -856,6 +856,11 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
bits on a file. Just like file_ntimes below.
*/
+ if (!can_write_to_file(conn, smb_fname)) {
+ errno = EACCES;
+ return -1;
+ }
+
/*
* We need to open the file with write access whilst
* still in our current user context. This ensures we