summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
* s3:smbd: avoid a compiler warning in open_sockets_smbd()Stefan Metzmacher2014-11-251-1/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: do casting of dm_sessid_t in stepsStefan Metzmacher2014-11-251-4/+6
| | | | | | | This makes it more explicit and avoids compiler warnings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: track connect_count and disconnect_countStefan Metzmacher2014-11-192-0/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: report idle state of 'idle_count' and 'idle_time'Stefan Metzmacher2014-11-191-8/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: improve profiling for the security context switching.Stefan Metzmacher2014-11-191-3/+21
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'Stefan Metzmacher2014-11-192-1/+12
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: use async smbprofile macrosStefan Metzmacher2014-11-195-94/+78
| | | | | | | | This improves profiling and corrently counts the total and idle time for async requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: Use "smbd profiling level"Volker Lendecke2014-11-191-6/+6
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: improve writecache profilingStefan Metzmacher2014-11-191-6/+33
| | | | | | | | | | | | | | | | | In order to have useful profiling counters should never be decremented. We need a separate counter for deallocation events. The current value can be calculated by allocations - deallocations. We also use better names and avoid having an array for the flush reasons. This will simplify further profiling improvements a lot. The value writecache_num_write_caches (this was similar to writecache_allocations) is replaced by writecache_cached_writes, which counts the amount of writes which were completely handled by the cache. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_break: First test for NT_STATUS_INVALID_OPLOCK_PROTOCOL, then for ↵Volker Lendecke2014-11-121-11/+11
| | | | | | | | | | | in_oplock_level being reasonable Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 12 00:03:34 CET 2014 on sn-devel-104
* s3:locking: convert brl_have_read field to brl_num_read.Volker Lendecke2014-11-113-56/+76
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: Don't set fsp->oplock_type before we've granted any oplocks.Jeremy Allison2014-11-111-3/+0
| | | | | | | | | It's not needed, and may lead to unexpected side effects. grant_fsp_oplock_type() is the only place to touch this. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: move all oplock granting code to grant_fsp_oplock_type()Volker Lendecke2014-11-111-29/+44
| | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Pair-Programmed-With: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* s3:smbd: break oplocks to none with FILE_OVERWRITEVolker Lendecke2014-11-111-0/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Use tevent_req_simple_recv_unix in a few placesVolker Lendecke2014-11-101-6/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix file corruption using "write cache size != 0"Stefan Metzmacher2014-11-061-0/+3
| | | | | | | | | | | | | | | | A client can: - open a handle (h1) - write some data to h1. - open a 2nd handle h2 (downgrades both handles to level II) - try to read the data on h2 (this gets old data) Bug: https://bugzilla.samba.org/show_bug.cgi?id=10921 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Nov 6 13:09:38 CET 2014 on sn-devel-104
* smbXsrv: don't leak lock_path onto talloc tosDavid Disseldorp2014-11-034-3/+19
| | | | | | | Also check for allocation failures. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* notify_internal: don't leak lock_path onto talloc tosDavid Disseldorp2014-11-031-3/+18
| | | | | | | Also check for allocation failures. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: Don't rename a dir with files open underneathVolker Lendecke2014-10-311-1/+120
| | | | | | | | This is an EXPENSIVE check. We'll have to guard this with an option Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smb2_server: pass xconn->smb2.server.cipher to ↵Stefan Metzmacher2014-10-161-5/+5
| | | | | | | smb2_signing_[de|en]ncrypt_pdu() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: check xconn->smb2.server.cipher instead of ↵Stefan Metzmacher2014-10-163-3/+3
| | | | | | | | | | | xconn->smb2.server.capabilities SMB 3.10 and later won't have SMB2_CAP_ENCRYPTION anymore. xconn->smb2.server.cipher == 0 is the indication that we don't support encryption on the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_negprot: remember xconn->smb2.server.cipherStefan Metzmacher2014-10-162-0/+5
| | | | | | | | For now we always use SMB2_ENCRYPTION_AES128_CCM or 0. 0 is the indication that we don't support encryption on the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a use-after-freeVolker Lendecke2014-10-101-1/+4
| | | | | | | | | | We can't reference xconn->next after it was talloc_free'ed Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Oct 10 14:32:53 CEST 2014 on sn-devel-104
* smbd: Simplify remove_child_pidVolker Lendecke2014-10-071-1/+1
| | | | | | | In this if-branch ret is always != 0. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* lanman: don't leak cache_path onto talloc tosDavid Disseldorp2014-10-061-2/+9
| | | | | | | | | | | Also check for allocation failures. Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> 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): Mon Oct 6 21:41:22 CEST 2014 on sn-devel-104
* smbd: Always use uint8_t for inbuf pointerChristof Schmitt2014-10-041-7/+8
| | | | | | | This avoids some casts from char pointers. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass only cmd to construct_reply_common instead of complete reqChristof Schmitt2014-10-041-6/+5
| | | | | | | construct_reply_common only needs the commands code and the inbuf field, not the complete request. Signed-off-by: Christof Schmitt <cs@samba.org>
* smbd: Use MIN macro in fake_sendfileChristof Schmitt2014-10-041-5/+1
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* profiling: Remove a big DEBUG statementVolker Lendecke2014-10-031-25/+0
| | | | | | | | | | | | | | | | | | | | | I would like to have the freedom to play with the profiling implementation. This is kindof in the way. This code is from pre-SVN days: > commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda > Author: Jeremy Allison <jra@samba.org> > AuthorDate: Thu Oct 5 18:50:18 2000 +0000 > Commit: Jeremy Allison <jra@samba.org> > CommitDate: Thu Oct 5 18:50:18 2000 +0000 > > Herb's fixes for profiling & compiler warnings. > Jeremy. Herb, please speak up quickly if you still need this :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* profiling: Remove some #ifdefsVolker Lendecke2014-10-032-8/+0
| | | | | | | | | The DO_PROFILE_INC thingies already #define to nothing without WITH_PROFILE, and any sane compiler will just not compile the if-condition if there is no body to be executed. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_negprot: allow really large io sizes up to allmost 16MBStefan Metzmacher2014-09-301-2/+7
| | | | | | | The default is still 8MB (as on Windows 2012 *). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* fileserver: raise debug level for share connection closing for non-IPC to 2.Jelmer Vernooij2014-09-281-1/+1
| | | | | | | | | | This reduces spamming during 'make test' runs. This change is consistent with aad5eeb9b4f67b03988ceefb7888cb63ecefcf30, which raised the log level for logging of new non-IPC connections. Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Change-Id: I4343570c8d6158b6715e514a8a7cd323a9c727ae Reviewed-by: Michael Adam <obnox@samba.org>
* smbd:smb2: improve smbd_smb2_protocol_dialect_match(), removing code duplicationMichael Adam2014-09-271-73/+25
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:messaging: add fds-array to messaging_send_iov()Michael Adam2014-09-241-1/+1
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* smbd: fix a comment typo.Michael Adam2014-09-211-1/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sun Sep 21 22:43:55 CEST 2014 on sn-devel-104
* s3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()Stefan Metzmacher2014-09-191-3/+7
| | | | | | | | For the continuation of a SMB2 SessionSetup we already have the smb2req->session (with NT_STATUS_MORE_PROCESSING_REQUIRED). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_server: add smbd_smb2_signing_key() helper functionStefan Metzmacher2014-09-191-5/+24
| | | | | | | | | | This will find the correct signing key for the connection. If there's already a channel session key, we need to use that otherwise we need to use the global session key. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbXsrv_session: add smbXsrv_session_find_channel()Stefan Metzmacher2014-09-192-0/+22
| | | | | | | | This function can check if a smbXsrv_connection is already bound to a smbXsrv_session. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a ↵Stefan Metzmacher2014-09-191-0/+1
| | | | | | | | | session A session will be usable from multiple connections in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: split out a smbd_add_connection() helper function.Stefan Metzmacher2014-09-192-159/+244
| | | | | | | This attaches a smbXsrv_connection to a smbXsrv_client structure. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: remove now unused smbd_server_connection->connStefan Metzmacher2014-09-192-6/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_lock: iterate over all sconn->client->connectionsStefan Metzmacher2014-09-191-81/+109
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_lock: always use tevent_req_defer_callback() if we go asyncStefan Metzmacher2014-09-191-1/+1
| | | | | | | | | | | | process_blocking_lock_queue_smb2() can call reprocess_blocked_smb2_lock() multiple times, which results in multiple tevent_req_done() calls. As we could disconnect the connection from there, process_blocking_lock_queue_smb2() could crash as the local state might be destroyed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_glue: remove chained fsps from all connections in ↵Stefan Metzmacher2014-09-191-8/+15
| | | | | | | remove_smb2_chained_fsp() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock ↵Stefan Metzmacher2014-09-191-1/+8
| | | | | | | | | | | | breaks This means we use the first connection for now. TODO: we may need to use the connection on which the SMB2 create was done and fallback to other connections. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()Stefan Metzmacher2014-09-193-4/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_create: pass smbXsrv_connection to *deferred*_smb2Stefan Metzmacher2014-09-193-15/+14
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()Stefan Metzmacher2014-09-193-5/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()Stefan Metzmacher2014-09-193-4/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to open_was_deferred()Stefan Metzmacher2014-09-196-15/+16
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>