diff options
author | Jeremy Allison <jra@samba.org> | 2013-01-16 12:58:17 -0800 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2013-01-18 00:06:52 +0100 |
commit | d562e9006a341ade6f38ee129598dd2e1dc3a493 (patch) | |
tree | 6c546a07895e6e230417320ff62cb4e008e501ec /source3 | |
parent | d6e10f00666b9baa17927067e58361ab39901fa1 (diff) | |
download | samba-d562e9006a341ade6f38ee129598dd2e1dc3a493.tar.gz samba-d562e9006a341ade6f38ee129598dd2e1dc3a493.tar.bz2 samba-d562e9006a341ade6f38ee129598dd2e1dc3a493.zip |
Add additional copychunk checks.
For printer, ipc$ connections, and directory handles.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_ioctl_network_fs.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c index a59a83b570..7fc75076a1 100644 --- a/source3/smbd/smb2_ioctl_network_fs.c +++ b/source3/smbd/smb2_ioctl_network_fs.c @@ -200,6 +200,28 @@ static NTSTATUS copychunk_check_handles(struct files_struct *src_fsp, return NT_STATUS_ACCESS_DENIED; } + if (src_fsp->is_directory) { + DEBUG(5, ("copy chunk no read on src directory handle (%s).\n", + smb_fname_str_dbg(src_fsp->fsp_name) )); + return NT_STATUS_ACCESS_DENIED; + } + + if (dst_fsp->is_directory) { + DEBUG(5, ("copy chunk no read on dst directory handle (%s).\n", + smb_fname_str_dbg(dst_fsp->fsp_name) )); + return NT_STATUS_ACCESS_DENIED; + } + + if (IS_IPC(src_fsp->conn) || IS_IPC(dst_fsp->conn)) { + DEBUG(5, ("copy chunk no access on IPC$ handle.\n")); + return NT_STATUS_ACCESS_DENIED; + } + + if (IS_PRINT(src_fsp->conn) || IS_PRINT(dst_fsp->conn)) { + DEBUG(5, ("copy chunk no access on PRINT handle.\n")); + return NT_STATUS_ACCESS_DENIED; + } + return NT_STATUS_OK; } |