/* Version 42 - Move SMB_VFS_SYMLINK -> SMB_VFS_SYMLINKAT. */
/* Version 42 - Move SMB_VFS_MKDIR -> SMB_VFS_MKDIRAT. */
/* Version 42 - Move change_to_user() -> change_to_user_and_service() */
+/* Version 42 - Move change_to_user_by_fsp() -> change_to_user_and_service_by_fsp() */
#define SMB_VFS_INTERFACE_VERSION 42
return;
}
- ok = change_to_user_by_fsp(state->dst_fsp);
+ ok = change_to_user_and_service_by_fsp(state->dst_fsp);
SMB_ASSERT(ok);
state->dst_fsp = NULL;
}
return tevent_req_post(req, ev);
}
- ok = change_to_user_by_fsp(src_fsp);
+ ok = change_to_user_and_service_by_fsp(src_fsp);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return tevent_req_post(req, ev);
state->src_off += nread;
- ok = change_to_user_by_fsp(state->dst_fsp);
+ ok = change_to_user_and_service_by_fsp(state->dst_fsp);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
return;
}
- ok = change_to_user_by_fsp(state->src_fsp);
+ ok = change_to_user_and_service_by_fsp(state->src_fsp);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->dir_fsp);
+ ok = change_to_user_and_service_by_fsp(state->dir_fsp);
SMB_ASSERT(ok);
ret = pthreadpool_tevent_job_recv(subreq);
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->fsp);
+ ok = change_to_user_and_service_by_fsp(state->fsp);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return;
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->dir_fsp);
+ ok = change_to_user_and_service_by_fsp(state->dir_fsp);
SMB_ASSERT(ok);
status = SMB_VFS_GET_DOS_ATTRIBUTES_RECV(subreq,
uint32_t *p_share_access,
bool *p_readonly_share);
bool change_to_user_and_service(connection_struct *conn, uint64_t vuid);
-bool change_to_user_by_fsp(struct files_struct *fsp);
+bool change_to_user_and_service_by_fsp(struct files_struct *fsp);
bool smbd_change_to_root_user(void);
bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info);
bool smbd_unbecome_authenticated_pipe_user(void);
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->fsp);
+ ok = change_to_user_and_service_by_fsp(state->fsp);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return;
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->fsp);
+ ok = change_to_user_and_service_by_fsp(state->fsp);
SMB_ASSERT(ok);
state->async_sharemode_count--;
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->fsp);
+ ok = change_to_user_and_service_by_fsp(state->fsp);
SMB_ASSERT(ok);
status = fetch_dos_mode_recv(subreq);
return change_to_user_internal(conn, vuser->session_info, vuid);
}
-bool change_to_user_by_fsp(struct files_struct *fsp)
+/**
+ * Impersonate user and change directory to service
+ *
+ * change_to_user_and_service_by_fsp() 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_by_fsp(struct files_struct *fsp)
{
return change_to_user_and_service(fsp->conn, fsp->vuid);
}
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->dir_fsp);
+ ok = change_to_user_and_service_by_fsp(state->dir_fsp);
SMB_ASSERT(ok);
status = state->recv_fn(subreq,
/*
* Make sure we run as the user again
*/
- ok = change_to_user_by_fsp(state->dir_fsp);
+ ok = change_to_user_and_service_by_fsp(state->dir_fsp);
SMB_ASSERT(ok);
state->retval = state->recv_fn(subreq,