]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: consolidate nested if expressions
authorRalph Boehme <slow@samba.org>
Tue, 29 Mar 2022 15:29:18 +0000 (17:29 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 31 Mar 2022 23:58:54 +0000 (23:58 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 31 23:58:54 UTC 2022 on sn-devel-184

source3/smbd/open.c

index 7cf1e5ea3a5469f4aa2c0ff58428514e34bb93c2..35f572211717f16a431554bb263ef5dbd675b4be 100644 (file)
@@ -4343,12 +4343,12 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
                return NT_STATUS_NOT_A_DIRECTORY;
        }
 
-       if (lp_store_dos_attributes(SNUM(conn))) {
-               if (!posix_open) {
-                       file_set_dosmode(conn, smb_dname,
-                                        file_attributes | FILE_ATTRIBUTE_DIRECTORY,
-                                        parent_dir_fname, true);
-               }
+       if (lp_store_dos_attributes(SNUM(conn)) && !posix_open) {
+               file_set_dosmode(conn,
+                                smb_dname,
+                                file_attributes | FILE_ATTRIBUTE_DIRECTORY,
+                                parent_dir_fname,
+                                true);
        }
 
        if (lp_inherit_permissions(SNUM(conn))) {