1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Jeremy Allison 2013-04-25 14:02:24 -07:00 committed by Volker Lendecke
parent a91aac4a5f
commit 77e3099483

View File

@ -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