The Samba-Bugzilla – Attachment 16404 Details for
Bug 14617
smbd tries to delete files with wrong permissions (uses guest instead of user from force user =)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Alternative patch for master using fsp->conn->session_info
bug14617.patch (text/plain), 2.37 KB, created by
Ralph Böhme
on 2021-01-23 17:53:51 UTC
(
hide
)
Description:
Alternative patch for master using fsp->conn->session_info
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2021-01-23 17:53:51 UTC
Size:
2.37 KB
patch
obsolete
>From abef21596b901c00bf5d9c583ae562678d2cfbc1 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Sat, 23 Jan 2021 18:36:23 +0100 >Subject: [PATCH] smbd: use fsp->conn->session_info for the initial > delete-on-close token > >There's a correctly set up session_info at fsp->conn->session_info, we can just >use that. It has all the bells and whistles ("force user" and "force group"). > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14617 >--- > source3/smbd/close.c | 25 ++++--------------------- > 1 file changed, 4 insertions(+), 21 deletions(-) > >diff --git a/source3/smbd/close.c b/source3/smbd/close.c >index 97d13473082..f05619d1886 100644 >--- a/source3/smbd/close.c >+++ b/source3/smbd/close.c >@@ -342,21 +342,13 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, > > if (fsp->fsp_flags.initial_delete_on_close && > !is_delete_on_close_set(lck, fsp->name_hash)) { >- struct auth_session_info *session_info = NULL; >- > /* Initial delete on close was set and no one else > * wrote a real delete on close. */ > >- status = smbXsrv_session_info_lookup(conn->sconn->client, >- fsp->vuid, >- &session_info); >- if (!NT_STATUS_IS_OK(status)) { >- return NT_STATUS_INTERNAL_ERROR; >- } > fsp->fsp_flags.delete_on_close = true; > set_delete_on_close_lck(fsp, lck, >- session_info->security_token, >- session_info->unix_token); >+ fsp->conn->session_info->security_token, >+ fsp->conn->session_info->unix_token); > } > > delete_file = is_delete_on_close_set(lck, fsp->name_hash) && >@@ -1175,24 +1167,15 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, > } > > if (fsp->fsp_flags.initial_delete_on_close) { >- 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. */ > >- 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, >- session_info->security_token, >- session_info->unix_token); >+ fsp->conn->session_info->security_token, >+ fsp->conn->session_info->unix_token); > fsp->fsp_flags.delete_on_close = true; > } > >-- >2.26.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 14617
:
16403
|
16404
|
16405
|
16406
|
16408