]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: inline change_to_user_by_session()
authorRalph Boehme <slow@samba.org>
Sat, 13 Jul 2019 14:38:02 +0000 (16:38 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 11 Sep 2019 19:59:34 +0000 (19:59 +0000)
Prepares for removing changing cwd from become_user*() in a subsequent commit.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/uid.c

index 554bd4d544cafff0b5671a6ad7cd853c501cde26..913e9f30b00f6e8c86095b0a9332a83d81337c69 100644 (file)
@@ -253,7 +253,7 @@ static bool check_user_ok(connection_struct *conn,
 
        /*
         * It's actually OK to call check_user_ok() with
-        * vuid == UID_FIELD_INVALID as called from change_to_user_by_session().
+        * vuid == UID_FIELD_INVALID as called from become_user_by_session().
         * All this will do is throw away one entry in the cache.
         */
 
@@ -495,15 +495,6 @@ bool change_to_user_and_service_by_fsp(struct files_struct *fsp)
        return change_to_user_and_service(fsp->conn, fsp->vuid);
 }
 
-static bool change_to_user_by_session(connection_struct *conn,
-                                     const struct auth_session_info *session_info)
-{
-       SMB_ASSERT(conn != NULL);
-       SMB_ASSERT(session_info != NULL);
-
-       return change_to_user_internal(conn, session_info, UID_FIELD_INVALID);
-}
-
 /****************************************************************************
  Go back to being root without changing the security context stack,
  but modify the current_user entries.
@@ -699,6 +690,9 @@ bool become_user_by_session(connection_struct *conn,
 {
        bool ok;
 
+       SMB_ASSERT(conn != NULL);
+       SMB_ASSERT(session_info != NULL);
+
        ok = push_sec_ctx();
        if (!ok) {
                return false;
@@ -706,7 +700,7 @@ bool become_user_by_session(connection_struct *conn,
 
        push_conn_ctx();
 
-       ok = change_to_user_by_session(conn, session_info);
+       ok = change_to_user_internal(conn, session_info, UID_FIELD_INVALID);
        if (!ok) {
                pop_sec_ctx();
                pop_conn_ctx();