summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* s3:smb2_server: move sconn->smb2.requests to xconn->smb2.requestsStefan Metzmacher2014-08-067-13/+25
| | | | | | | | 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:smb2_server: move sconn->smb2.*credits* to xconn->smb2.credits.*Stefan Metzmacher2014-08-063-93/+103
| | | | | | | | 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:smb2_negprot: remove unused variable 'conn' we already have 'xconn'...Stefan Metzmacher2014-08-061-19/+17
| | | | | | | | We don't need two helper variables for the same thing. 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_*Stefan Metzmacher2014-08-068-20/+19
| | | | | | | | 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:smb2_server: move sconn->smb2.negprot_2ff to xconn->smb2.allow_2ffStefan Metzmacher2014-08-062-4/+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>
* s3:smb2_server: move sconn->smb2.send_queue* to xconn->smb2.send_queue*Stefan Metzmacher2014-08-062-24/+21
| | | | | | | | 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:smb2_server: move sconn->smb2.request_read_state to ↵Stefan Metzmacher2014-08-062-15/+16
| | | | | | | | | | xconn->smb2.request_read_state 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:smb2_server: use xconn->transport.fde also for smb2Stefan Metzmacher2014-08-062-12/+11
| | | | | | | | 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: move libasys state from smbXsrv_connection to smbd_server_connectionStefan Metzmacher2014-08-062-13/+13
| | | | | | | | | | This doesn't belong to a connection, it's state used within the VFS stack. And smbd_server_connection is the legacy structure we're using for global VFS state. 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 xconn->msg_state to xconn->smb1.msg_stateStefan Metzmacher2014-08-062-19/+23
| | | | | | 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->smb1.unix_info.* to xconn->smb1.unix_info.*Stefan Metzmacher2014-08-062-18/+18
| | | | | | | | 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: move sconn->smb1.echo_handler.* to xconn->smb1.echo_handler.*Stefan Metzmacher2014-08-065-82/+84
| | | | | | | | 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: move sconn->smb1.signing_state to xconn->smb1.signing_stateStefan Metzmacher2014-08-0610-38/+46
| | | | | | | | 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: move sconn->smb1.sessions.* to xconn->smb1.sessions.*Stefan Metzmacher2014-08-067-31/+41
| | | | | | | | 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: move sconn->smb1.negprot.* to xconn->smb1.negprot.*Stefan Metzmacher2014-08-066-45/+53
| | | | | | | | 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: move sconn->status to xconn->transport.statusStefan Metzmacher2014-08-064-12/+16
| | | | | | | | 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: move sconn->smb1.fde to xconn->transport.fdeStefan Metzmacher2014-08-063-12/+11
| | | | | | | | 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: move sconn->sock to xconn->transport.sockStefan Metzmacher2014-08-068-43/+62
| | | | | | | | 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: move sconn->nbt.* to xconn->transport.nbt.*Stefan Metzmacher2014-08-063-7/+9
| | | | | | | | 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()Stefan Metzmacher2014-08-063-75/+88
| | | | | | | | | 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>
* s3:smbd: add smbXsrv_connection_dbg()Stefan Metzmacher2014-08-062-0/+25
| | | | | | | | This is similar to fsp_fnum_dbg() and fsp_str_dbg(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* locking: posix_lock_list does not use "fsp"Volker Lendecke2014-08-061-4/+0
| | | | | | | | 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 Aug 6 03:27:36 CEST 2014 on sn-devel-104
* locking: Avoid a pointless castVolker Lendecke2014-08-061-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: strings: Simplify strcasecmpVolker Lendecke2014-08-061-35/+13
| | | | | | | | | This makes us fallback to strcasecmp early if any INVALID_CODEPOINT appears. Without this patch we just continue to compare if both strings happen to have an INVALID_CODEPOINT in the same spot. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: tests: Added local.charset test for Bug 10716 - smbd constantly crashes ↵Jeremy Allison2014-08-061-0/+12
| | | | | | | | when filename contains non-ascii character https://bugzilla.samba.org/show_bug.cgi?id=10716 Signed-off-by: Jeremy Allison <jra@samba.org>
* lib: strings: Fix the behavior of strncasecmp_m_handle() in the face of bad ↵Jeremy Allison2014-08-061-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conversions. When either string has a bad conversion, we fall back to doing raw ascii byte comparisons using strcasecmp(). This is wrong - we should fall back to strncasecmp. The problem is we've already stepped past the character that failed the conversion, so we're not re-testing those characters for comparison. This can have the effect of causing strncasecmp_m_handle() to report that two strings are identical when they are not, if the failed conversion takes place at the end of the string. The correct behavior is to step back to the point of the string(s) that failed the conversion, and continue the test from there. This is a litle trickier than the previous fix, as it requires converting the incoming n variable from remaining characters to compare to remaining bytes to compare. As bytes are always the smallest character size (1 byte) then it's safe to convert the remaining characters to check by decrementing the source string by the last character length (in bytes) and incrementing the remaining bytes to scan by the same value, then calling strncasecmp() with the stepped back strings remaining. Signed-off-by: Jeremy Allison <jra@samba.org>
* lib: strings: Fix the behavior of strcasecmp_m_handle() in the face of bad ↵Jeremy Allison2014-08-061-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conversions. When either string has a bad conversion, we fall back to doing raw ascii byte comparisons using strcasecmp(). The problem is we've already stepped past the character that failed the conversion, so we're not re-testing those characters for comparison. This can have the effect of causing strcasecmp_m_handle() to report that two strings are identical when they are not, if the failed conversion takes place at the end of the string. The correct behavior is to step back to the point of the string(s) that failed the conversion, and continue the test from there. Found by <lev@zadarastorage.com> when investigating bug 10716 - smbd constantly crashes when filename contains non-ascii character. Given the normal character set of utf-8, and an on disk filename of ISO-8859-1 of file-é on disk hex value: 66 69 6c 65 2d e9, an incoming open given the correct utf8 name of file-é will collide when it should not. Fixes: Bug 10716 - smbd constantly crashes when filename contains non-ascii character https://bugzilla.samba.org/show_bug.cgi?id=10716 Signed-off-by: Jeremy Allison <jra@samba.org>
* ctdb-locking: Add per database queues for pending and active lock requestsAmitay Isaacs2014-08-042-32/+82
| | | | | | | | | | | | | | | | This avoids traversing a single pending queue which is quite expensive when there are lots of pending lock requests. This seems to happen quite a lot on a loaded cluster for notify_index.tdb. Adding per database queues avoids the need to traverse pending queue for that database if there are already the maximum number of active lock requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Aug 4 20:23:45 CEST 2014 on sn-devel-104
* ctdb-locking: Update a commentAmitay Isaacs2014-08-041-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Simplify check for locks on record or databaseAmitay Isaacs2014-08-041-3/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Decrement pending statistics when lock is scheduledAmitay Isaacs2014-08-041-2/+2
| | | | | | | and not when the lock is obtained. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Update ctdb statistics for all lock typesAmitay Isaacs2014-08-041-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Add DB lock requests to head of the pending queueAmitay Isaacs2014-08-041-1/+8
| | | | | | | | This allows to schedule DB locks quickly without having to scan through the pending lock requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Remove unused variable lock_num_pendingAmitay Isaacs2014-08-042-5/+0
| | | | | | | | The number of pending locks displayed in ctdb statistics are stored in ctdb_statistics structure and not ctdb_context. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Increase number of lock processes per database to 200Amitay Isaacs2014-08-041-1/+1
| | | | | | | This was the original limit in the older versions of CTDB. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Add new tunable LockProcessesPerDBAmitay Isaacs2014-08-043-4/+3
| | | | | | | | This allows to change the maximum number of lock processes that can be active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Allocate lock request soon after allocating lock contextAmitay Isaacs2014-08-041-6/+6
| | | | | | | This avoids extra work in case lock request allocation fails. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Remove unused function find_lock_context()Amitay Isaacs2014-08-041-53/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Schedule the next possible lock based on per-db limitAmitay Isaacs2014-08-041-15/+5
| | | | | | | | | This prevents searching through active lock requests for every pending lock request to check if the pending lock request can be scheduled or not. The locks are scheduled in strict first-in-first-out order. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Remove multiple lock requests per lock context (part 2)Amitay Isaacs2014-08-041-20/+12
| | | | | | | | Store only a single request instead of storing a queue in lock context. Lock request structure does not need to be a linked list any more. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Remove multiple lock requests per lock context (part 1)Amitay Isaacs2014-08-041-41/+29
| | | | | | | | | | | This was a bad idea and caused out of order scheduling of lock requests. The logic to append lock requests to existing lock context is already commented. Remove the commented code and there is no need to check if lock_ctx is NULL, since we are always creating a new one. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Remove unused structure membersAmitay Isaacs2014-08-041-3/+0
| | | | | | | | | block_child was used to keep track of a process which was created to debug why a lock process has blocked. That logic was replaced to execute an external debug script. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Fix the lock_type_str corresponding to LOCK_ALLDBAmitay Isaacs2014-08-041-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* selftest: Improve check to detect if nmbd is working.Andreas Schneider2014-08-041-10/+25
| | | | | | | | | | | With this change you mostly have to wait only for one second till the tests get executed instead of ten seconds. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Aug 4 17:58:58 CEST 2014 on sn-devel-104
* selftest: Use the actual name of the nmblookup binary.Andreas Schneider2014-08-041-1/+1
| | | | | | | | nmblookup3 is just a binary mapping. We shouldn't use the mapping anymore. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Remove unused nstrcpyVolker Lendecke2014-08-041-5/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Aug 4 09:58:16 CEST 2014 on sn-devel-104
* lib: Make DEBUG a subsystem of its ownVolker Lendecke2014-08-021-2/+7
| | | | | | | | | | | In the future this might become a library, but even with the SUBSYSTEM it should be clear what debug.c depends upon. 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): Sat Aug 2 00:36:50 CEST 2014 on sn-devel-104
* lib: Make close_low_fd() independently linkableVolker Lendecke2014-08-016-51/+101
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* debug: Use close_low_fd in reopen_logs_internalVolker Lendecke2014-08-011-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Use close_low_fd in close_low_fdsVolker Lendecke2014-08-011-33/+19
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>