1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

smbd: Simplify dos_mode_from_sbuf

We don't need that else branch, this could be a switch as well

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2024-06-25 16:07:58 +02:00 committed by Ralph Boehme
parent e2ba614465
commit 7b03fc3d9f

View File

@ -215,13 +215,14 @@ static uint32_t dos_mode_from_sbuf(connection_struct *conn,
if ((st->st_ex_mode & S_IWUSR) == 0) {
result |= FILE_ATTRIBUTE_READONLY;
}
} else if (ro_opts == MAP_READONLY_PERMISSIONS) {
}
if (ro_opts == MAP_READONLY_PERMISSIONS) {
/* smb_fname->fsp can be NULL for an MS-DFS link. */
/* Check actual permissions for read-only. */
if ((fsp != NULL) && !can_write_to_fsp(fsp)) {
result |= FILE_ATTRIBUTE_READONLY;
}
} /* Else never set the readonly bit. */
}
if (MAP_ARCHIVE(conn) && ((st->st_ex_mode & S_IXUSR) != 0)) {
result |= FILE_ATTRIBUTE_ARCHIVE;