From: Volker Lendecke Date: Tue, 25 Jun 2024 14:07:58 +0000 (+0200) Subject: smbd: Simplify dos_mode_from_sbuf X-Git-Tag: tdb-1.4.11~257 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b03fc3d9f25ce3b82108e0deaffdf70dc83a414;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 51d9c0508fe..796cd39626b 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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;