From: Ralph Boehme Date: Fri, 29 Jul 2022 12:56:41 +0000 (+0200) Subject: smbd: ignore request to set the SPARSE attribute on streams X-Git-Tag: talloc-2.4.0~1482 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3af8f8e8741cc8c889bbf416ccd38a1b702917ec;p=thirdparty%2Fsamba.git smbd: ignore request to set the SPARSE attribute on streams As per MS-FSA 2.1.1.5 this is a per stream attribute, but our backends don't support it in a consistent way, therefor just pretend success and ignore the request. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index dd07b5f3882..3d69a35b366 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -1102,6 +1102,19 @@ NTSTATUS file_set_sparse(connection_struct *conn, return NT_STATUS_INVALID_PARAMETER; } + if (fsp_is_alternate_stream(fsp)) { + /* + * MS-FSA 2.1.1.5 IsSparse + * + * This is a per stream attribute, but our backends don't + * support it a consistent way, therefor just pretend + * success and ignore the request. + */ + DBG_DEBUG("Ignoring request to set FILE_ATTRIBUTE_SPARSE on " + "[%s]\n", fsp_str_dbg(fsp)); + return NT_STATUS_OK; + } + DEBUG(10,("file_set_sparse: setting sparse bit %u on file %s\n", sparse, smb_fname_str_dbg(fsp->fsp_name)));