diff options
author | Jeremy Allison <jra@samba.org> | 2013-04-25 14:02:24 -0700 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-04-27 14:11:10 +0200 |
commit | 77e3099483489ef4d59087dc6542fe7f7b589224 (patch) | |
tree | 34f2ff96e912ca805a09379d7d34b50638ea0af8 | |
parent | a91aac4a5f0bd2077be267e49d1fc4f0321bb39c (diff) | |
download | samba-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>
-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 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 |