1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

s3: smbd: dos_mode_from_sbuf(), can_write_to_file() -> can_write_to_fsp().

Code with MS-DFS link where smb_fname->fsp == NULL.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2021-06-02 11:59:07 -07:00 committed by Ralph Boehme
parent 92eff16d5a
commit d0fced7141

View File

@ -206,12 +206,13 @@ static uint32_t dos_mode_from_sbuf(connection_struct *conn,
result |= FILE_ATTRIBUTE_READONLY;
}
} else if (ro_opts == MAP_READONLY_PERMISSIONS) {
/* smb_fname->fsp can be NULL for an MS-DFS link. */
/* Check actual permissions for read-only. */
if (!can_write_to_file(conn,
conn->cwd_fsp,
smb_fname))
{
result |= FILE_ATTRIBUTE_READONLY;
if (smb_fname->fsp != NULL) {
if (!can_write_to_fsp(smb_fname->fsp))
{
result |= FILE_ATTRIBUTE_READONLY;
}
}
} /* Else never set the readonly bit. */