From b9f3016640559b11dad9f894b9ff567f1a5cef91 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Jul 2021 09:33:05 -0700 Subject: [PATCH] s3: smbd: Ensure we set is_fsa inside fsp_bind_smb() as soon as we have called smbXsrv_open_create(). The destructor has been set up at that point and so the correct path in close must be called, either close_normal_file() or close_directory(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14763 Signed-off-by: Jeremy Allison --- source3/smbd/files.c | 2 ++ source3/smbd/open.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/smbd/files.c b/source3/smbd/files.c index b70ce9f70e6..e8b92596650 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -129,6 +129,8 @@ NTSTATUS fsp_bind_smb(struct files_struct *fsp, struct smb_request *req) fsp->mid = req->mid; req->chain_fsp = fsp; + fsp->fsp_flags.is_fsa = true; + DBG_DEBUG("fsp [%s] mid [%" PRIu64"]\n", fsp_str_dbg(fsp), fsp->mid); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index b9f5472b765..5c54118d06d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5979,8 +5979,6 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, goto fail; } - fsp->fsp_flags.is_fsa = true; - if ((ea_list != NULL) && ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN))) { status = set_ea(conn, fsp, ea_list); -- 2.27.0