From 77e3099483489ef4d59087dc6542fe7f7b589224 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Apr 2013 14:02:24 -0700 Subject: Ensure we don't try the open_file_fchmod() if we can't write to the file. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/smbd/dosmode.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/smbd') 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 -- cgit