]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use session->global->auth_session_info in switch_message()
authorRalph Boehme <slow@samba.org>
Thu, 2 Jan 2020 07:07:31 +0000 (08:07 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 13 Jan 2020 19:41:35 +0000 (19:41 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/process.c

index b128d98cf8c6d8a1637a5f9211ee08aa6ab82621..29108402bd69b1b982f1c24fbf9bfa501908d538 100644 (file)
@@ -1587,9 +1587,10 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
                }
        }
 
-       if (session != NULL && !(flags & AS_USER)) {
-               struct user_struct *vuser = session->compat;
-
+       if (session != NULL &&
+           session->global->auth_session_info != NULL &&
+           !(flags & AS_USER))
+       {
                /*
                 * change_to_user() implies set_current_user_info()
                 * and chdir_connect_service().
@@ -1597,12 +1598,10 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
                 * So we only call set_current_user_info if
                 * we don't have AS_USER specified.
                 */
-               if (vuser) {
-                       set_current_user_info(
-                               vuser->session_info->unix_info->sanitized_username,
-                               vuser->session_info->unix_info->unix_name,
-                               vuser->session_info->info->domain_name);
-               }
+               set_current_user_info(
+                       session->global->auth_session_info->unix_info->sanitized_username,
+                       session->global->auth_session_info->unix_info->unix_name,
+                       session->global->auth_session_info->info->domain_name);
        }
 
        /* Does this call need to be run as the connected user? */