mirror of
https://github.com/samba-team/samba.git
synced 2025-03-30 06:50:24 +03:00
smbd: avoid become_user_without_service() in close_directory()
Here we called become_user_without_service() just in order to be able to fetch the nt_token and unix_token subsequently via get_current_[nt|u]tok(conn). The same can be achieved by fetching the session_info with smbXsrv_session_info_lookup(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
367c0d1910
commit
3d09993725
@ -1138,25 +1138,25 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
|
||||
}
|
||||
|
||||
if (fsp->fsp_flags.initial_delete_on_close) {
|
||||
bool became_user = False;
|
||||
struct auth_session_info *session_info = NULL;
|
||||
|
||||
/* Initial delete on close was set - for
|
||||
* directories we don't care if anyone else
|
||||
* wrote a real delete on close. */
|
||||
|
||||
if (get_current_vuid(fsp->conn) != fsp->vuid) {
|
||||
become_user_without_service(fsp->conn, fsp->vuid);
|
||||
became_user = True;
|
||||
status = smbXsrv_session_info_lookup(fsp->conn->sconn->client,
|
||||
fsp->vuid,
|
||||
&session_info);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
send_stat_cache_delete_message(fsp->conn->sconn->msg_ctx,
|
||||
fsp->fsp_name->base_name);
|
||||
set_delete_on_close_lck(fsp, lck,
|
||||
get_current_nttok(fsp->conn),
|
||||
get_current_utok(fsp->conn));
|
||||
session_info->security_token,
|
||||
session_info->unix_token);
|
||||
fsp->fsp_flags.delete_on_close = true;
|
||||
if (became_user) {
|
||||
unbecome_user_without_service();
|
||||
}
|
||||
}
|
||||
|
||||
delete_dir = get_delete_on_close_token(
|
||||
|
Loading…
x
Reference in New Issue
Block a user