summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-07-13 16:38:02 +0200
committerJeremy Allison <jra@samba.org>2019-09-11 19:59:34 +0000
commit5a736db046d1922e2b7ad13baf38c42b46f2115d (patch)
tree52695655897c2aa5dc5b43a94f96f1eac8d9092b
parent1d6fe10ec62d447b004c0e691deb0f970268bad9 (diff)
downloadsamba-5a736db046d1922e2b7ad13baf38c42b46f2115d.tar.gz
smbd: inline change_to_user_by_session()
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>
-rw-r--r--source3/smbd/uid.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index 554bd4d544c..913e9f30b00 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -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();