diff options
author | Stefan Metzmacher <metze@samba.org> | 2019-07-16 14:11:22 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-11 19:59:35 +0000 |
commit | e9256b306ecd4299aa96b27d81800382414572a9 (patch) | |
tree | 02bfb91b856e9c8dc0b1fd772417e45f32980720 | |
parent | 5da24aa18e9c0ff6f2852b5421945111ef5c6b2b (diff) | |
download | samba-e9256b306ecd4299aa96b27d81800382414572a9.tar.gz |
smbd: inline change_to_user_internal() into change_to_user_and_service()
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>
-rw-r--r-- | source3/smbd/uid.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 0e8d5bca4de..487caaa87ee 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -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; } /** |