mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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>
This commit is contained in:
parent
8283fd0e00
commit
0d88b37fc6
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user