summaryrefslogtreecommitdiff
path: root/source3/smbd/uid.c
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-07-13 16:17:17 +0200
committerJeremy Allison <jra@samba.org>2019-09-11 19:59:34 +0000
commitd836f4a7d6ffbd3719a8be8141b7a186648556dd (patch)
treea53356a778900a087b060d9610c2472c3ce8a7bd /source3/smbd/uid.c
parentae3cfa5da9e86a4f379df7bba8e45ef31a28bc4d (diff)
downloadsamba-d836f4a7d6ffbd3719a8be8141b7a186648556dd.tar.gz
smbd: rename change_to_user() to change_to_user_and_service()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/uid.c')
-rw-r--r--source3/smbd/uid.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index 8fa38e459dd..2dd0d11367a 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -454,7 +454,14 @@ static bool change_to_user_internal(connection_struct *conn,
return true;
}
-bool change_to_user(connection_struct *conn, uint64_t vuid)
+/**
+ * Impersonate user and change directory to service
+ *
+ * change_to_user_and_service() is used to impersonate the user associated with
+ * the given vuid and to change the working directory of the process to the
+ * service base directory.
+ **/
+bool change_to_user_and_service(connection_struct *conn, uint64_t vuid)
{
struct user_struct *vuser;
int snum = SNUM(conn);
@@ -478,7 +485,7 @@ bool change_to_user(connection_struct *conn, uint64_t vuid)
bool change_to_user_by_fsp(struct files_struct *fsp)
{
- return change_to_user(fsp->conn, fsp->vuid);
+ return change_to_user_and_service(fsp->conn, fsp->vuid);
}
static bool change_to_user_by_session(connection_struct *conn,
@@ -661,7 +668,7 @@ bool become_user(connection_struct *conn, uint64_t vuid)
push_conn_ctx();
- if (!change_to_user(conn, vuid)) {
+ if (!change_to_user_and_service(conn, vuid)) {
pop_sec_ctx();
pop_conn_ctx();
return False;