smbd: simplify uid_entry_in_group()
authorRalph Boehme <slow@samba.org>
Tue, 21 Jan 2020 11:05:59 +0000 (12:05 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 30 May 2020 02:40:22 +0000 (02:40 +0000)
conn->session_info is always valid since
1fa05e5c76e718142326915f8671299217a093df and preceeding commits.

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): Sat May 30 02:40:22 UTC 2020 on sn-devel-184

source3/smbd/posix_acls.c

index df2b3b57f2ae06b2ab67e1027746d100290e6434..db2d36a89a1e7f18dfdf9b3c3f0b0c7165d3bd37 100644 (file)
@@ -1263,26 +1263,18 @@ static bool uid_entry_in_group(connection_struct *conn, canon_ace *uid_ace, cano
        if (dom_sid_equal(&group_ace->trustee, &global_sid_World))
                return True;
 
-       /*
-        * if we have session info in conn, we already have the (SID
-        * based) NT token and don't need to do the complex
-        * user_in_group_sid() call
-        */
-       if (conn->session_info) {
-               security_token = conn->session_info->security_token;
-               /* security_token should not be NULL */
-               SMB_ASSERT(security_token);
-               is_sid = security_token_is_sid(security_token,
-                                              &uid_ace->trustee);
-               if (is_sid) {
-                       has_sid = security_token_has_sid(security_token,
-                                                        &group_ace->trustee);
-
-                       if (has_sid) {
-                               return true;
-                       }
+       security_token = conn->session_info->security_token;
+       /* security_token should not be NULL */
+       SMB_ASSERT(security_token);
+       is_sid = security_token_is_sid(security_token,
+                                      &uid_ace->trustee);
+       if (is_sid) {
+               has_sid = security_token_has_sid(security_token,
+                                                &group_ace->trustee);
+
+               if (has_sid) {
+                       return true;
                }
-
        }
 
        /*