1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

dosmode: fix FSCTL_SET_SPARSE request validation

Check that FSCTL_SET_SPARSE requests does not refer to directories. Also
reject such requests when issued over IPC or printer share connections.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10787

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 28 04:22:37 CEST 2014 on sn-devel-104
This commit is contained in:
David Disseldorp 2014-08-27 15:42:00 +02:00 committed by Jeremy Allison
parent 4ee65a4666
commit 0751495b13

View File

@ -886,6 +886,19 @@ NTSTATUS file_set_sparse(connection_struct *conn,
return NT_STATUS_ACCESS_DENIED;
}
if (fsp->is_directory) {
DEBUG(9, ("invalid attempt to %s sparse flag on dir %s\n",
(sparse ? "set" : "clear"),
smb_fname_str_dbg(fsp->fsp_name)));
return NT_STATUS_INVALID_PARAMETER;
}
if (IS_IPC(conn) || IS_PRINT(conn)) {
DEBUG(9, ("attempt to %s sparse flag over invalid conn\n",
(sparse ? "set" : "clear")));
return NT_STATUS_INVALID_PARAMETER;
}
DEBUG(10,("file_set_sparse: setting sparse bit %u on file %s\n",
sparse, smb_fname_str_dbg(fsp->fsp_name)));