mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
smbd: rename change_to_user_by_fsp() to change_to_user_and_service_by_fsp()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
d836f4a7d6
commit
1f4ec34447
@ -279,6 +279,7 @@
|
||||
/* 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
|
||||
|
||||
|
@ -1790,7 +1790,7 @@ static void vfswrap_offload_write_cleanup(struct tevent_req *req,
|
||||
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;
|
||||
}
|
||||
@ -1906,7 +1906,7 @@ static struct tevent_req *vfswrap_offload_write_send(
|
||||
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);
|
||||
@ -2021,7 +2021,7 @@ static void vfswrap_offload_write_read_done(struct tevent_req *subreq)
|
||||
|
||||
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;
|
||||
@ -2092,7 +2092,7 @@ static void vfswrap_offload_write_write_done(struct tevent_req *subreq)
|
||||
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;
|
||||
@ -3253,7 +3253,7 @@ static void vfswrap_getxattrat_done(struct tevent_req *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);
|
||||
|
||||
ret = pthreadpool_tevent_job_recv(subreq);
|
||||
|
@ -620,7 +620,7 @@ static void smbd_smb1_do_locks_retry(struct tevent_req *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;
|
||||
|
@ -866,7 +866,7 @@ static void dos_mode_at_vfs_get_dosmode_done(struct tevent_req *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);
|
||||
|
||||
status = SMB_VFS_GET_DOS_ATTRIBUTES_RECV(subreq,
|
||||
|
@ -1190,7 +1190,7 @@ NTSTATUS check_user_share_access(connection_struct *conn,
|
||||
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);
|
||||
|
@ -579,7 +579,7 @@ static void smbd_smb2_lock_retry(struct tevent_req *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;
|
||||
|
@ -736,7 +736,7 @@ static void smb2_query_directory_fetch_write_time_done(struct tevent_req *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);
|
||||
SMB_ASSERT(ok);
|
||||
|
||||
state->async_sharemode_count--;
|
||||
@ -765,7 +765,7 @@ static void smb2_query_directory_dos_mode_done(struct tevent_req *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);
|
||||
SMB_ASSERT(ok);
|
||||
|
||||
status = fetch_dos_mode_recv(subreq);
|
||||
|
@ -483,7 +483,14 @@ bool change_to_user_and_service(connection_struct *conn, uint64_t vuid)
|
||||
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);
|
||||
}
|
||||
|
@ -2493,7 +2493,7 @@ static void smb_vfs_call_get_dos_attributes_done(struct tevent_req *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);
|
||||
|
||||
status = state->recv_fn(subreq,
|
||||
@ -2770,7 +2770,7 @@ static void smb_vfs_call_getxattrat_done(struct tevent_req *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,
|
||||
|
Loading…
Reference in New Issue
Block a user