summaryrefslogtreecommitdiffstats
path: root/source3/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* param: rename lp function and variable from "cli_maxprotocol" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "client_max_protocol" Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "nis_home_map_name" to "homedir_map"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "serverstring" to "server_string"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'lockdir' to 'lock_directory'Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: use DBWRAP_LOCK_ORDER_VALID() in db_open()Michael Adam2014-02-071-9/+1
| | | | | | | | | | instead of the hand written test. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Feb 7 18:05:51 CET 2014 on sn-devel-104
* dbwrap: add dbwrap_flags argument to dbwrap_local_open()Michael Adam2014-02-071-1/+1
| | | | | | | | To be consistent with db_open() and prepare for future possible extensions. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap_open: add 'dbwrap_optimize_readonly:* = yes' optionStefan Metzmacher2014-02-071-0/+25
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dbwrap_ctdb: implement DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESSStefan Metzmacher2014-02-071-0/+21
| | | | | | | | | | For non-persistent databases we try to use CTDB_CONTROL_SET_DB_READONLY in order to make use of readonly records. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open_ctdb()Michael Adam2014-02-073-4/+7
| | | | | | | | This is in preparation of directly supporting ctdb read only record copies when opening a ctdb database from samba. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-076-6/+11
| | | | | | | | | | This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-lib: Add winbind_lookup_usersids().Andreas Schneider2014-02-052-0/+38
| | | | | | | Pair-Programmed-With: Guenther Deschner <gd@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pthreadpool: Fix a comment, "quit"->"shutdown"Volker Lendecke2014-01-281-2/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Jan 28 19:06:40 CET 2014 on sn-devel-104
* smbd: Fix format errors on FreeBSD10Volker Lendecke2014-01-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Remove unused messaging_tdb_eventVolker Lendecke2014-01-211-10/+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): Tue Jan 21 10:07:21 CET 2014 on sn-devel-104
* messaging3: remove msg_channelVolker Lendecke2014-01-212-382/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Use messaging_read_send/recvVolker Lendecke2014-01-211-13/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_read_send/recvVolker Lendecke2014-01-212-1/+126
| | | | | | | | | | | | | | | | | | | This is made to replace the msg_channel abstraction. msg_channel was created to not miss any messages. For this, some complex queueing was installed. This complexity has caused quite a few problems in the past (see bug 10284 for example). messaging_read_send/recv is able to achieve the same goal with a lot less complexity. The messaging_read_send atomically installs the reader into the messaging_context, we will not miss any messages while this installed. messaging_send_recv will deinstall that listener, but in the callback function you can directly call messaging_read_send again without going through the tevent_loop_once. As long as this is always made sure, no messages will be lost. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:lib/tldap: make use of tevent_req_set_cleanup_fn()Stefan Metzmacher2014-01-171-7/+13
| | | | | | | | | | This is more better than a custom tevent_req destructor. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jan 17 14:34:06 CET 2014 on sn-devel-104
* s3:lib/tldap: make use of tevent_req_defer_callback()Stefan Metzmacher2014-01-171-0/+2
| | | | | | | | | | In tldap_msg_received() we call tevent_req_error() for more than one request, if we do that we need to use tevent_req_defer_callback() otherwise we're likely to crash, as a triggered callback may invalidate our state. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:lib/fncall: make use of tevent_req_set_cleanup_fn()Stefan Metzmacher2014-01-171-7/+16
| | | | | | | This is more better than a custom tevent_req destructor. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:dbwrap: Use milliseconds for "Held tdb lock" messageChristof Schmitt2014-01-161-5/+6
| | | | | | | | | | | This is consistent with the parameter using milliseconds and the other warnings in the same file also using milliseconds. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jan 16 11:19:39 CET 2014 on sn-devel-104
* s3:dbwrap: Store warning thresholds in db_ctdb_ctxChristof Schmitt2014-01-161-4/+18
| | | | | | | | | Avoid the parameter lookup for the warning thresholds in the hot code path by reading them in db_open_ctdb and storing them in the db_ctdb_ctx. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:dbwrap include the hashchain in the logsChristian Ambach2014-01-161-3/+12
| | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:dbwrap report time for chainlock and CTDB migrateChristian Ambach2014-01-161-2/+15
| | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_ctdb: Instrument chainunlock timingVolker Lendecke2014-01-161-2/+26
| | | | | | | | | | | | We need an indication whether we run into the fcntl thundering herd. fcntl unlock should be blindingly fast in the normal case. If it takes longer than 5 milliseconds, warn. The timeout can be adapted by setting ctdb:unlock_warn_threshold = <number-of-milliseconds> Reviewed-by: Christof Schmitt <cs@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* ctdb_conn: Log long fetch_lock callsVolker Lendecke2014-01-161-4/+22
| | | | | | | | | | | | | | | | | With this patch, the number of fetch_lock attempts before dbwrap_ctdb logs that it took x attempts to get a record is configurable with net conf setparm global ctdb:migrate_attempts 10 This patch also adds net conf setparm global ctdb:migrate_duration 5000 to trigger the same log message if it took longer than x milliseconds to retrieve a record. Reviewed-by: Christof Schmitt <cs@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* messaging: Fix a memleak (master only..)Volker Lendecke2014-01-101-7/+9
| | | | | | | | | | Immediate tevents don't free themselves as timed events do :-) 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): Fri Jan 10 01:20:04 CET 2014 on sn-devel-104
* messaging: Use talloc_pooled_objectVolker Lendecke2014-01-091-6/+3
| | | | | | | ... not as a speed improvement, it saves the second NULL check Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging: Move the self-send logic out of messaging_tdbVolker Lendecke2014-01-092-54/+52
| | | | | | | This is not specific to tdb Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging: Fix a memleak with clusteringVolker Lendecke2014-01-091-0/+3
| | | | | | | We have to properly throw away unexpected messages that came in via ctdb Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: Add DAC_OVERRIDE capability supportAbhidnya Joshi2013-12-161-0/+4
| | | | | Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* gencache: Fix a type-punned warningVolker Lendecke2013-12-161-1/+5
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Dec 16 17:11:13 CET 2013 on sn-devel-104
* s3:lib: avoid talloc_zero_array() in poll_one_fd()Stefan Metzmacher2013-12-141-14/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: use directory_create_or_exist_strict() to create corepathGregor Beck2013-12-111-16/+17
| | | | | | | | | This simplifies the code and even works in testenv where the chown call fails. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-lib: Fix %G substitution for domain users in smbdAndreas Schneider2013-12-101-1/+11
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10286 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Dec 10 16:39:43 CET 2013 on sn-devel-104
* s3:lib/asys modify included headersChristian Ambach2013-12-101-4/+2
| | | | | | | use the headers from libreplace, not the system ones Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* CVE-2013-4408:s3:Ensure LookupRids() replies arrays are range checked.Jeremy Allison2013-12-092-0/+32
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Mon Dec 9 09:00:41 CET 2013 on sn-devel-104
* CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.Jeremy Allison2013-12-093-1/+145
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:ctdb_conn: add some length verification to ctdb_packet_more()Stefan Metzmacher2013-12-091-0/+5
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:util_tsock: add some overflow detection to ↵Stefan Metzmacher2013-12-091-0/+5
| | | | | | | | | tstream_read_packet_done() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* idmap_cache: Use gencache_parseVolker Lendecke2013-12-051-32/+47
| | | | | | | | | | This avoids a few tallocs and brings down user CPU a bit more Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Dec 5 03:06:10 CET 2013 on sn-devel-104
* idmap_cache: Use an fstring instead of talloc_asprintfVolker Lendecke2013-12-051-12/+6
| | | | | | | | In a test doing one million uid2sid calls this brings down user CPU from 1.3 seconds to 0.9 seconds. And it saves a few code lines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* messaging3: Do not go through messages.tdb for self-sendsVolker Lendecke2013-12-051-0/+54
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Fix bug 10284Volker Lendecke2013-11-261-69/+31
| | | | | | | | | | | | | | | | | | If we msg_read_send on a nonempty channel, we create one tevent_immediate. If we directly receive another message and from within the msg_read_send's tevent_req callback we immediately do another msg_read_send, we end up with two tevent_immediate events for msg_channel_trigger with just one incoming message. Test to follow. This patch simplifies msg_channel.c by removing the explicit immediate events. Instead, it relies on the implicit immediate event available via tevent_req_defer_callback. For messages received from tdb with a msg_read_send req pending, we directly finish that request without putting the message on the queue. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10284 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-lib: Add grpname to talloc_sub_specified().Andreas Schneider2013-11-211-6/+25
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=2191 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* debug: remove unused sys_adminlogDavid Disseldorp2013-11-201-25/+0
| | | | | | | | | | printing.c was the last user of this syslog wrapper. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Nov 20 10:19:32 CET 2013 on sn-devel-104
* messaging: use local talloc ctx instead of talloc_tosDavid Disseldorp2013-11-201-4/+4
| | | | | | | | | messaging_tdb_send() allocates a stackframe and stores it in a local variable, subsequent allocations should use the variable instead of calling talloc_tos(). Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* smbd: Fix a talloc hierarchy problem in msg_channelVolker Lendecke2013-11-201-1/+1
| | | | | | | | | | | | | When tearing down a watch_send with an open tevent_immediate, we talloc_free the msg_channel while the tevent_immediate still references it. Don't make the tevent_immediate outlive the msg_channel. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10250 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 Nov 20 00:13:51 CET 2013 on sn-devel-104
* netapi: Add support for info level 502 in NetShareAdd.Hans Leidekker2013-11-193-1/+58
| | | | | | | | Signed-off-by: Hans Leidekker <hans@meelstraat.net> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Nov 19 21:48:17 CET 2013 on sn-devel-104
* s3-lib: smbclient shows no error if deleting a directory with del failedJeremy Allison2013-11-141-0/+42
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260 Move dir_check_ftype() to util.c Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>