summaryrefslogtreecommitdiffstats
path: root/source4/lib/messaging/messaging.c
Commit message (Collapse)AuthorAgeFilesLines
* s4-messaging: Remove unused struct imessaging_recAndrew Bartlett2015-02-161-19/+0
| | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
* messaging4: Enable POOL_USAGEVolker Lendecke2015-02-141-0/+18
| | | | | | | | | | | | | | With this you can watch "samba"'s talloc hierarchy live using smbcontrol <pid> pool-usage Enjoy :-) 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): Sat Feb 14 01:59:19 CET 2015 on sn-devel-104
* messaging4: Use messages_dgmVolker Lendecke2015-02-131-336/+106
| | | | | | | | | | | | | This replaces the transport mechanism in source4 with calls to the messages_dgm code. It is supposed to enable "smbcontrol samba pool-usage" as an example without having to rewrite smbcontrol using the source4 based messaging subsystem. This moves the source3 based names.tdb (which is unused so far) to the lock directory, source4 does not have a cache directory. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Use server_id_dbVolker Lendecke2015-02-131-125/+29
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Fix an error path memleakVolker Lendecke2014-09-181-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* messaging4: Simplify imessaging_pathVolker Lendecke2014-07-291-9/+4
| | | | | | | | | | Use server_id_str_buf 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): Tue Jul 29 00:30:55 CEST 2014 on sn-devel-104
* messaging4: Simplify ping_message with server_id_str_buf()Volker Lendecke2014-07-241-3/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Fix a just-introduced error memleakVolker Lendecke2014-07-221-0/+5
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jul 22 15:31:38 CEST 2014 on sn-devel-104
* messaging4: Change irpc_servers_by_name to NTSTATUSVolker Lendecke2014-07-211-19/+24
| | | | | | | | | | | | For me, counted arrays are easier to deal with than NULL-terminated ones. Here we also had a "server_id_is_disconnection" convention, which was not really obvious. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jul 21 20:28:53 CEST 2014 on sn-devel-104
* messaging4: Fix a memleak in an error pathVolker Lendecke2014-07-211-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Remove unnecessary lockingVolker Lendecke2014-07-211-6/+0
| | | | | | | | We don't do any modifying operations on the database, so locking is not needed here Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Remove an unused NTSTATUS varVolker Lendecke2014-07-211-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Move str_list_addVolker Lendecke2014-07-211-6/+7
| | | | | | | | If this fails, we'd have to revert the tdb_append. str_list_remove is simpler :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Add NULL check to irpc_add_nameVolker Lendecke2014-07-211-0/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Use tdb_append in irpc_add_nameVolker Lendecke2014-07-211-19/+11
| | | | | | | This makes the custom locking code unnecessary here Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* imessaging: Fix a commentVolker Lendecke2014-05-311-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:imessaging: Remove event context from irpc and imessaging structuresAndrew Bartlett2014-05-131-16/+13
| | | | | | | | | | | | | | | | | | | The only part of this code with a stored event context is now the binding_handle created by irpc_binding_handle() when in the client dcerpc_binding_handle_set_sync_ev() is called, otherwise a new nested event context is created for sync calls. Note that the FD event associated with the socket still implies the long term event context passed to imessaging_[client]_init(). Andrew Bartlett Change-Id: I9aeae94b26e3736370f449daa96808e6cdc2d55d Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue May 13 02:33:24 CEST 2014 on sn-devel-104
* s4:imessaging: Remove dcerpc_binding_handle_set_sync_ev() call from ↵Andrew Bartlett2014-05-131-2/+0
| | | | | | | | | | irpc_binding_handle() The callers do this explicitly now if required. Change-Id: I0e6f562aac4e3c0a75149c5850eb9f96269a3caf Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Simplify irpc_namedb_open a bitVolker Lendecke2014-03-311-5/+5
| | | | | | | | It does not really need the msg_ctx, and it also removes the implicit talloc hierarchy. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging4: Remove lp_ctx from imessaging_contextVolker Lendecke2014-03-311-13/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging4: Store a names_db handle in the imessaging_contextVolker Lendecke2014-03-311-36/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging4: Add some NULL checksVolker Lendecke2014-03-311-0/+15
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging4: Add "goto fail" to imessaging_initVolker Lendecke2014-03-311-12/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb_wrap: Remove tdb_wrap_open_ againVolker Lendecke2014-03-311-4/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* imessaging: Avoid passing lp_ctx to tdb_wrap_open in irpc_namedb_openVolker Lendecke2014-03-311-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix blank line endingsVolker Lendecke2014-03-311-29/+29
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Use the new directory_create_or_exist_strict() function.Andreas Schneider2013-01-091-1/+1
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:lib/messaging: terminate the irpc_servers_byname() result with ↵Stefan Metzmacher2013-01-091-2/+2
| | | | | | | | server_id_set_disconnected() (bug #9540) Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-lib: Use directory_create_or_exist() to create messaging dir.Andreas Schneider2012-12-211-1/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* imessaging: Add irpc_all_servers() to list all available serversAndrew Bartlett2012-10-311-0/+71
| | | | | | | | This is implemented with a tdb_traverse_read(), and will allow a tool to disover the name and server_id of all Samba processes, as each process registers itself to recieve messages. Andrew Bartlett
* s4-messaging: Fill in the whole server_id in all use casesAndrew Bartlett2012-04-301-1/+6
| | | | | | | | | | | | This started per https://bugzilla.samba.org/show_bug.cgi?id=8872#c4 and avoids any possible collision with a different process. We also need to ensure that across a Samba installation on a single node that id.vnn is the same. Samba4 previously used 0, while Samba3 used NONCLUSTER_VNN. When a message is sent between these 'different' nodes, the error NT_STATUS_INVALID_DEVICE_REQUEST is raised. Andrew Bartlett
* s4-messaging: Use generate_random() to get a unique ID for messaging clientsAndrew Bartlett2012-04-251-1/+2
| | | | | | | | | | | | The call to random() resulted in duplicate values for s3fs configurations which, due to the forked child, all started with the same random seed. A future improvement would be to move to a proven unique value. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Apr 25 11:43:40 CEST 2012 on sn-devel-104
* tdb_wrap: Move to specific directory.Jelmer Vernooij2012-03-101-1/+1
| | | | | | | | | | It's a bit confusing to mix low-level and high-level libraries. We had multiple libraries in one directory, and there were have circular dependencies with other libraries outside that directory (in this case, samba-hostconfig). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
* lib/util: Add back control of mmap and hash size in tdb for top level buildAndrew Bartlett2011-10-131-1/+8
| | | | | | | | This passes down a struct loadparm_context to allow these parameters to be checked. This may be s3 or s4 context, allowing the #if _SAMBA_BUILD_ macro to go away safely. Andrew Bartlett
* s4-messaging: Pass the loadparm context, not just the messaging pathAndrew Bartlett2011-10-131-5/+8
| | | | | | This will allow the TDB layer to get at the lp_ctx for tdb options. Andrew Bartlett
* s4:lib/messaging: let irpc handles return NT_STATUS_CONNECTION_DISCONNECTEDStefan Metzmacher2011-09-141-2/+2
| | | | | | We should return the same in all places. metze
* s4-messaging ensure we do not segfault on a NULL msg context in cleanupAndrew Bartlett2011-08-261-0/+4
|
* s4:lib: use tevent_ fns names instead of legcay event_ onesSimo Sorce2011-08-131-6/+6
|
* s4:messaging: use tevent_ function names instead of legacy event_ onesSimo Sorce2011-08-131-2/+2
|
* s4-messaging: fixed the removal of messaging sockets in child tasksAndrew Tridgell2011-07-221-7/+16
| | | | | | | | | | | | | | when a child task exits we were firing a destructor on any inherited messaging contexts, which could trigger a removal of the parents message socket and messaging database entry. This adds a new auto_remove flag to imessaging_init(), and exposes the cleanup code for use by the stream service. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Fri Jul 22 08:09:06 CEST 2011 on sn-devel-104
* Use tevent_req_oomVolker Lendecke2011-06-201-1/+1
| | | | This fixes a few Coverity errors
* tdb_compat.h: divert every tdb build and includes to tdb_compatRusty Russell2011-06-201-1/+1
| | | | | | | | We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/util Bring procid_str() into lib/util as server_id_string()Andrew Bartlett2011-06-091-4/+4
| | | | | | | This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett
* lib/util Move source3 tdb_wrap_open() into the common code.Andrew Bartlett2011-05-061-1/+1
| | | | | | | | | This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in the top level build, these options are not available for these databases. However, having two different tdb_wrap lists is a worse fate, so this will do for now. Andrew Bartlett
* s4-messaging Rename messaging -> imessagingAndrew Bartlett2011-05-031-78/+78
| | | | | | | This avoid symbol and structure conflicts between Samba3 and Samba4, and chooses a less generic name. Andrew Bartlett
* s4:cluster Rename .id to .pid in server_idAndrew Bartlett2011-05-031-4/+6
| | | | | | | This also changes some DEBUG messages to use cluster_id_string() rather than .id, to isolate them from this and other changes. Andrew Bartlett
* Use <tdb.h> to include tdb, so the system include file gets used when ↵Jelmer Vernooij2011-02-281-1/+1
| | | | | | building against system tdb.
* s4/irpc: Add function to add security token to the binding handleAnatoliy Atanasov2010-09-271-0/+10
|
* s4:irpc: optionaly pass the security_token via IRPC requests.Stefan Metzmacher2010-09-271-0/+3
| | | | metze
* s4:irpc: use LIBNDR_FLAG_REF_ALLOC for the server side when pullingStefan Metzmacher2010-09-231-0/+2
| | | | | | | | | | | | | The dcerpc server also uses it, so it was surprising that the IRPC server side doesn't used it. The reason to have this is that we want to handle error cases and returns like NT_STATUS_NOT_SUPPORTED sane, without crashing while marshalling the response. metze Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>