Revert "smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds the event context used for the request processing" This reverts commit 894e5001c747ce765dad5517778dda55d7d1f4d9. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds the event context used for the request processing In future this will an impersonation wrapper tevent_context based on the user session. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all smbd/smb2_*.c files with it. Will allow easier smb2-specific debugging. https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
smbd: Move check for SMB2 compound request to new function BUG: https://bugzilla.samba.org/show_bug.cgi?id=13047 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECK As per MS-SMB2 and MS-FSA and our SMB_VFS_STRICT_LOCK implementation, we're merely testing for locks, not setting any. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12887 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 11 03:37:44 CEST 2017 on sn-devel-144
s3/vfs: remove SMB_VFS_STRICT_UNLOCK It's just a noop, so let's remove it. SMB_VFS_STRICT_LOCK doesn't set logs, it just checks for the presence of incompatible locks. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12887 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3/smbd: remove flags2 FLAGS2_READ_PERMIT_EXECUTE hack in the SMB2 code By adding a SMB2 specific CHECK_READ_SMB2 macro called that always grants read access if execute was granted, we can get rid of the flags2 hack. All callers in the SMB2 code are converted to use the CHECK_READ_SMB2 macro. Amongs other things, this later allows moving the handle checks in copychunk_check_handles() down into the VFS layer where we don't have access to the smbreq. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
s3/smb2_read: Better fallback for incorrectly configured sendfile setups When "use sendfile" is enabled but not supported by the underlying VFS module then fallback to normal copy and print out a warning for the admin. Pair-Programmed-With: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
lib: Move sys_rw* to lib/util genrand.c will require it soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3:smb2_read: pass in_flags to smbd_smb2_read_send() For now we still ignore the flags. Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib: Split out write_data[_iov] Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3:smb2_server: propagate NTSTATUS from smb2_sendfile_send_data() to smbd_smb2_flush_send_queue() Calling exit_server() from within a destructor is a bit ugly... This will result in smbd_server_connection_terminate() instead of directly calling exit_server(), which will be useful for multi-channel in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
smbd: Use %s/__func__ Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smbd: pass smbXsrv_connection explicitly to sendfile_short_send() We now let the caller terminate the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smbd: pass smbXsrv_connection explicitly to fake_sendfile() In future (with multi-channel) a fsp can be used from multiple connections, we need to make it explicit on which we want to reply. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smb2_server: pass smbXsrv_connection to smbd_server_connection_terminate*() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smb2_*: make use of smb2req->xconn where possible We need to use the connection that is used by the current request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smb2_server: use xconn->smb2.server.max_* instead of sconn->smb2.max_* We don't need this twice... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smbd: move sconn->sock to xconn->transport.sock This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
s3:smbd: avoid get_peer_addr() and use smbXsrv_connection_dbg() There's no need to do syscalls, if we already have the information in userspace. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>