1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

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 <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Ralph Boehme 2022-07-29 14:56:41 +02:00 committed by Volker Lendecke
parent 55e55804bb
commit 3af8f8e874

View File

@ -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)));