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:
parent
e2ba614465
commit
7b03fc3d9f
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user