]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Make complex if-expression in file_set_dosmode() easier to read
authorVolker Lendecke <vl@samba.org>
Fri, 4 Mar 2022 07:39:01 +0000 (08:39 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 4 Mar 2022 17:43:42 +0000 (17:43 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/dosmode.c

index b1e6fbc4fec57c5f414c055d03eca8346eb570b4..43bb48d38c59ebfce4212d0ae122fb20056e45dd 100644 (file)
@@ -1022,9 +1022,11 @@ int file_set_dosmode(connection_struct *conn,
         * Simply refuse to do the chmod in this case.
         */
 
-       if (S_ISDIR(smb_fname->st.st_ex_mode) && (unixmode & S_ISGID) &&
-                       geteuid() != sec_initial_uid() &&
-                       !current_user_in_group(conn, smb_fname->st.st_ex_gid)) {
+       if (S_ISDIR(smb_fname->st.st_ex_mode) &&
+           (unixmode & S_ISGID) &&
+           geteuid() != sec_initial_uid() &&
+           !current_user_in_group(conn, smb_fname->st.st_ex_gid))
+       {
                DEBUG(3,("file_set_dosmode: setgid bit cannot be "
                        "set for directory %s\n",
                        smb_fname_str_dbg(smb_fname)));