smbd: inline change_to_user_internal() into change_to_user_and_service()
[samba.git] / 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;
 }
 
 /**