[SCM] Samba Shared Repository - branch v4-18-test updated
Jule Anger
janger at samba.org
Mon Nov 13 12:17:01 UTC 2023
The branch, v4-18-test has been updated
via 9a5b46d89e2 s3: smbd: Ignore fstat() error on deleted stream in fd_close().
from cbbfc917b96 CVE-2018-14628: python:descriptor: let samba-tool dbcheck fix the nTSecurityDescriptor on CN=Deleted Objects containers
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-18-test
- Log -----------------------------------------------------------------
commit 9a5b46d89e2820d447c5e4c9c6a0c67d58962c6e
Author: Ralph Boehme <slow at samba.org>
Date: Wed Sep 20 14:21:44 2023 -0700
s3: smbd: Ignore fstat() error on deleted stream in fd_close().
In the fd_close() fsp->fsp_flags.fstat_before_close code path.
If this is a stream and delete-on-close was set, the
backing object (an xattr from streams_xattr) might
already be deleted so fstat() fails with
NT_STATUS_NOT_FOUND. So if fsp refers to a stream we
ignore the error and only bail for normal files where
an fstat() should still work. NB. We cannot use
fsp_is_alternate_stream(fsp) for this as the base_fsp
has already been closed at this point and so the value
fsp_is_alternate_stream() checks for is already NULL.
Remove knownfail.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15487
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Tue Oct 10 09:39:27 UTC 2023 on atb-devel-224
(cherry picked from commit 633a3ee6894cc1d05b44dbe47a278202803d9b21)
Autobuild-User(v4-18-test): Jule Anger <janger at samba.org>
Autobuild-Date(v4-18-test): Mon Nov 13 12:16:15 UTC 2023 on atb-devel-224
-----------------------------------------------------------------------
Summary of changes:
source3/smbd/open.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
Changeset truncated at 500 lines:
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0c9ddfe7c94..c848243c9b5 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -997,7 +997,20 @@ NTSTATUS fd_close(files_struct *fsp)
if (fsp->fsp_flags.fstat_before_close) {
status = vfs_stat_fsp(fsp);
if (!NT_STATUS_IS_OK(status)) {
- return status;
+ /*
+ * If this is a stream and delete-on-close was set, the
+ * backing object (an xattr from streams_xattr) might
+ * already be deleted so fstat() fails with
+ * NT_STATUS_NOT_FOUND. So if fsp refers to a stream we
+ * ignore the error and only bail for normal files where
+ * an fstat() should still work. NB. We cannot use
+ * fsp_is_alternate_stream(fsp) for this as the base_fsp
+ * has already been closed at this point and so the value
+ * fsp_is_alternate_stream() checks for is already NULL.
+ */
+ if (fsp->fsp_name->stream_name == NULL) {
+ return status;
+ }
}
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list