]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: inline change_to_user_internal() into change_to_user_and_service()
authorStefan Metzmacher <metze@samba.org>
Tue, 16 Jul 2019 12:11:22 +0000 (14:11 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 11 Sep 2019 19:59:35 +0000 (19:59 +0000)
There was only one caller left.

Pair-Programmed-With: Ralph Boehme <slow@samba.org>

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

index 0e8d5bca4de01421659f0acc49c7e56060499a87..487caaa87eefa9dfc1ebfb952058ceb58cee95b2 100644 (file)
@@ -428,32 +428,6 @@ static bool change_to_user_impersonate(connection_struct *conn,
        return true;
 }
 
-static bool change_to_user_internal(connection_struct *conn,
-                                   const struct auth_session_info *session_info,
-                                   uint64_t vuid)
-{
-       bool ok;
-
-       ok = change_to_user_impersonate(conn, session_info, vuid);
-       if (!ok) {
-               return false;
-       }
-
-       current_user.need_chdir = conn->tcon_done;
-       current_user.done_chdir = false;
-
-       if (current_user.need_chdir) {
-               ok = chdir_current_service(conn);
-               if (!ok) {
-                       return false;
-               }
-               current_user.done_chdir = true;
-       }
-
-       print_impersonation_info(conn);
-       return true;
-}
-
 /**
  * Impersonate user and change directory to service
  *
@@ -465,6 +439,7 @@ bool change_to_user_and_service(connection_struct *conn, uint64_t vuid)
 {
        struct user_struct *vuser;
        int snum = SNUM(conn);
+       bool ok;
 
        if (conn == NULL) {
                DBG_WARNING("Connection not open\n");
@@ -480,7 +455,24 @@ bool change_to_user_and_service(connection_struct *conn, uint64_t vuid)
                return false;
        }
 
-       return change_to_user_internal(conn, vuser->session_info, vuid);
+       ok = change_to_user_impersonate(conn, vuser->session_info, vuid);
+       if (!ok) {
+               return false;
+       }
+
+       current_user.need_chdir = conn->tcon_done;
+       current_user.done_chdir = false;
+
+       if (current_user.need_chdir) {
+               ok = chdir_current_service(conn);
+               if (!ok) {
+                       return false;
+               }
+               current_user.done_chdir = true;
+       }
+
+       print_impersonation_info(conn);
+       return true;
 }
 
 /**