summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_lock.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all ↵Jeremy Allison2018-03-221-0/+3
| | | | | | | | | | | | 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> (cherry picked from commit 8dabcf8948c2e514b489169c34673e093519b583)
* s3:smb2_server: allow logoff, close, unlock, cancel and echo on expired sessionsStefan Metzmacher2017-12-221-0/+17
| | | | | | | | | | | | | | | | | Windows client at least doesn't have code to replay a SMB2 Close after getting NETWORK_SESSION_EXPIRED, which locks out a the client and generates an endless loop around NT_STATUS_SHARING_VIOLATION. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13197 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Dec 21 23:28:42 CET 2017 on sn-devel-144 (cherry picked from commit c4919d4d5f78aeb54a438b95d4eab2f082a8174e)
* smbd: Fix CID 1273096 Dereference before null checkVolker Lendecke2015-06-231-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: use async smbprofile macrosStefan Metzmacher2014-11-191-0/+4
| | | | | | | | 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: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_server: pass smbXsrv_connection to smbd_server_connection_terminate*()Stefan Metzmacher2014-08-061-3/+3
| | | | | | 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: move sconn->smb2.requests to xconn->smb2.requestsStefan Metzmacher2014-08-061-3/+6
| | | | | | | | 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>
* smbd: Fix a typoVolker Lendecke2014-07-221-1/+1
| | | | | | | | 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): Tue Jul 22 17:57:56 CEST 2014 on sn-devel-104
* smbd: brl_lock_cancel does not need "blr" anymoreVolker Lendecke2014-07-041-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: do_lock does not need "blr" anymoreVolker Lendecke2014-07-041-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: brl_lock does not need "blr" anymoreVolker Lendecke2014-07-041-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Factor out unlocking from smbd_do_lockingVolker Lendecke2014-07-041-10/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix some typosVolker Lendecke2014-07-021-3/+3
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 2 02:25:47 CEST 2014 on sn-devel-104
* smbd: Remove an unused variableVolker Lendecke2014-07-021-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Clarify smb2 lock checksVolker Lendecke2014-07-021-5/+18
| | | | | | | | | | When reading the code it was not immediately clear to me how one of the conditions in [MS-SMB2] 3.3.5.14.2 was satisfied. A separate loop to me is clearer and given that we don't expect thousands of locks in a single call also not significantly less efficient. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: SMB2 : Fix leak of blocking lock records in the database.Jeremy Allison2014-06-301-0/+1
| | | | | | | | | | | | | | | | | | Based on a fix from Hemanth Thummala <hemanth.thummala@gmail.com> Bug #10673 - Increasing response times for byte range unlock requests. The previous refactoring makes it obvious we need to call remove_pending_lock() in all places where we are returning from the SMB2 blocking lock call. https://bugzilla.samba.org/show_bug.cgi?id=10673 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jun 30 14:59:16 CEST 2014 on sn-devel-104
* s3: smb2: Simplify logic in reprocess_blocked_smb2_lock().Jeremy Allison2014-06-301-30/+25
| | | | | | | | | SMB2 blocking locks can only have one lock per request, so there can never be any other locks to wait for. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smb2: Remove unused code from remove_pending_lock().Jeremy Allison2014-06-301-13/+0
| | | | | | | | | SMB2 blocking locks can only have one lock per request, so there can never be any previous locks to remove. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:smb2_lock: return RANGE_NOT_LOCKED instead of CANCELLED for logoff and tdisStefan Metzmacher2014-03-121-0/+20
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_lock: fix whitespaces/tabs in smbd_smb2_lock_cancel()Stefan Metzmacher2014-03-121-11/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_lock: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a panic when a smb2 brlock times outVolker Lendecke2013-12-051-1/+1
| | | | | | | | | | Found by Peter Somogyi. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Dec 5 21:21:35 CET 2013 on sn-devel-104
* s3:smbd: remove struct member smbd_smb2_request.cancelled - it was only writtenMichael Adam2012-09-221-1/+0
|
* s3:smb2_lock: let smbd_smb2_lock_cancel() trigger NT_STATUS_CANCELEDStefan Metzmacher2012-09-221-26/+3
| | | | | | Instead of violating the tevent_req layers. metze
* s3:smb2_lock: make use of SMBD_SMB2_* macrosStefan Metzmacher2012-08-051-10/+7
| | | | metze
* s3:smb2_lock: remove unused in_smbpidStefan Metzmacher2012-08-051-8/+0
| | | | metze
* s3:smbd: make use of smbXsrv_open for smb1/2/3Stefan Metzmacher2012-06-291-1/+1
| | | | | | | | | | | | This makes sure we generate unique persistent file ids, which are stored in smbXsrv_open_global.tdb. Pair-Programmed-With: Michael Adam <obnox@samba.org> metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jun 29 21:01:11 CEST 2012 on sn-devel-104
* s3:smbd: change smb2_lock.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-6/+6
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smb2_lock: make use of file_fsp_smb2()Stefan Metzmacher2012-06-091-30/+12
| | | | metze
* s3:smb2_lock: use fsp->fnum as locking contextStefan Metzmacher2012-06-091-1/+1
| | | | | | | | | fsp->fnum is the same as in_file_id_volatile. When we start to support durable handles we should pass in_file_id_persistent. metze
* s3:smb2_lock: use smb2req->compat_chain_fsp instead of looking it up againStefan Metzmacher2012-06-091-6/+1
| | | | metze
* s3:smbd: avoid using sconn_server_id()Stefan Metzmacher2011-12-161-3/+3
| | | | metze
* s3:smb2_lock: use talloc_get_type_abort() as private_data can't be NULLStefan Metzmacher2011-12-141-5/+1
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Dec 14 13:34:25 CET 2011 on sn-devel-104
* s3:smb2_lock: pass smbd_server_connection as private_data to ↵Stefan Metzmacher2011-12-121-6/+7
| | | | | | received_unlock_msg() metze
* s3:smb2_server: use sconn->ev_ctx instead of sconn->smb2.event_ctxStefan Metzmacher2011-12-121-1/+1
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon Dec 12 16:08:59 CET 2011 on sn-devel-104
* s3:smb2_lock: avoid using server_event_context()Stefan Metzmacher2011-12-121-2/+2
| | | | metze
* s3:smb2_server: pass explicit defer_times to smbd_smb2_request_pending_queue()Stefan Metzmacher2011-11-151-1/+1
| | | | metze
* s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_lock.cStefan Metzmacher2011-09-071-11/+5
| | | | metze
* lib/util/time.c: timeval_current_ofs_msecRusty Russell2011-06-011-3/+1
| | | | | | | | | | Several places want "milliseconds from current time", and several were simply doing "msec * 1000" which can (and does in one place) result in a usec value over 1 a million. Using a helper to do this is safer and more readable. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3-globals Remove smbd_event_context() (use server_event_context())Andrew Bartlett2011-05-311-1/+1
| | | | | | | | This has been a wrapper around server_event_context() for some time now, and removing this from dummmysmbd.c assists with library dependencies. Andrew Bartlett
* s3-tevent: only include ../lib/util/tevent wrappers where needed.Günther Deschner2011-04-291-0/+1
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
* s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner2011-03-301-1/+0
| | | | Guenther
* s3-messages: only include messages.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: Remove smbd_server_conn from smb2 receive_unlock_msgVolker Lendecke2010-10-031-1/+9
|
* s3: Remove procid_self() from cancel_pending_lock_requests_by_fid_smb2()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove procid_self() from remove_pending_lock()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove smbd_messaging_context() from reprocess_blocked_smb2_lock()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove smbd_messaging_context() from remove_pending_lock()Volker Lendecke2010-07-051-1/+1
|