summaryrefslogtreecommitdiff
path: root/source4/lib/messaging
AgeCommit message (Collapse)AuthorFilesLines
2025-05-19s4:messaging/tests: correctly teardown imessage contextsStefan Metzmacher1-2/+13
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-01-29s4:lib/messaging: make use of CHECK_DEBUGLVLC(DBGC_RPC_PARSE, ...) in ↵Stefan Metzmacher1-1/+1
irpc_bh_do_ndr_print() This makes sure the debug class rpc_parse is used for ndr dump output. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2024-09-26s4:lib/messaging: implement irpc_bh_get_binding()Stefan Metzmacher1-2/+42
We just use NCACN_INTERNAL here... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-18s4:lib/messaging: fix interaction between imessaging_reinit and irpc_destructorStefan Metzmacher1-0/+9
This was missing in commit 0d096931196524a2d1bf59470bc629dc9231131e. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15280 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Sep 18 19:45:56 UTC 2024 on atb-devel-224
2024-03-28lib: Use struct initialization in imessaging_client_init()Volker Lendecke1-8/+8
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): Thu Mar 28 09:13:43 UTC 2024 on atb-devel-224
2024-03-28lib: Fix whitespaceVolker Lendecke2-10/+9
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-12-08pymessaging: Remove trailing whitespaceJoseph Sutton1-6/+6
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-20Use python.h from libreplaceAndreas Schneider1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01librpc:ndr: Introduce ‘ndr_flags_type’ typeJoseph Sutton1-1/+1
Instead of ‘int’ or ‘uint32_t’, neither of which convey much meaning, consistently use a newly added type to hold NDR_ flags. Update the NDR 4.0.0 ABI. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13s4:messaging: Remove redundant codeJoseph Sutton1-3/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-06-16lib: Add a few required #includesVolker Lendecke2-0/+3
You find them if you try to #include these files directly Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-05-24s4/messaging/py: Fix typoJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Fix leaksJoseph Sutton1-1/+8
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Fix leak of p_server_idJoseph Sutton1-6/+6
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Check py_return_ndr_struct() return valueJoseph Sutton1-0/+3
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Fix callback return value leakJoseph Sutton1-5/+7
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Fix leakJoseph Sutton1-1/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Fix leaksJoseph Sutton1-1/+6
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging: Return the number of previously-registered functions that are ↵Joseph Sutton2-5/+10
removed Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Fix typoJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Add more helpful error message for a wrongly-sized tupleJoseph Sutton1-3/+10
>>> m = Messaging((1,2,3,4,5)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: function takes exactly 1 argument (5 given) Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Document lp_ctx parameter of messaging.Messaging()Joseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-24s4/messaging/py: Remove incorrect function names in messaging.Messaging()Joseph Sutton1-3/+3
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-01-10lib: Remove idtree from samba_util.hVolker Lendecke1-0/+1
No need to recompile the world when only a few files need this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-06s4:lib/messaging: fix interaction between imessaging_context_destructor and ↵Stefan Metzmacher2-0/+16
irpc_destructor BUG: https://bugzilla.samba.org/show_bug.cgi?id=15280 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-11-24s4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc callsStefan Metzmacher1-0/+33
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15253 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-10-13s4:messaging: let imessaging_client_init() use ↵Stefan Metzmacher1-1/+1
imessaging_init_discard_incoming() imessaging_client_init() is for temporary stuff only, so we should drop (unexpected) incoming messages unless we expect irpc responses. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15201 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Oct 13 13:32:30 UTC 2022 on sn-devel-184
2022-10-13s4:messaging: add imessaging_init_discard_incoming()Stefan Metzmacher3-1/+85
We often create imessaging contexts just for sending messages, but we'll never process incoming messages because a temporary event context was used and we just queue a lot of imessaging_post_state structures with immediate events. With imessaging_init_discard_incoming() we'll discard any incoming messages unless we have pending irpc requests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15201 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-06lib/messaging: Move messages_dgm out of source3Amitay Isaacs2-4/+4
... so CTDB can also use it. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-23py3: Remove #define PyInt_FromLong PyLong_FromLongAndrew Bartlett1-2/+2
This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power
2019-12-08build: messaging.c uses talloc_report_printf()Volker Lendecke1-1/+1
This used to be talloc_report_str() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-12-08build: Multi-line a long list of depsVolker Lendecke1-1/+11
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-18messaging: Do POOL_USAGE via a socketVolker Lendecke1-10/+10
This makes debugging run-away processes much more efficient and even possible at all: If the pool-usage output is more than 256MB, the previous code could not realloc it and threw it away. Also, it is not helpful for an already huge process to allocate even more. 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 Sep 18 21:27:30 UTC 2019 on sn-devel-184
2019-09-18lib: Align integer typesVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-18messaging4: Pass fds to messaging handlersVolker Lendecke5-28/+179
Boiler-plate replacement moving the (num_fds!=0) check down Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-08-06s4/messaging/py: don't DECREF borrowed referencesDouglas Bagnall1-2/+0
This made Message.deregister() a decref machine, with talloc crashes and segfaults available thus: from samba import messaging m = messaging.Messaging() for i in range(20): m.deregister(m) Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-05-21s4:messaging: Use GnuTLS MD5 in messaging testAndreas Schneider1-9/+11
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-16s4: squash 'cast between incompatible function types' warningNoel Power1-8/+15
To avoid warning above produced by using -Wcast-function-type we; + ensure PyCFunctions of type METH_NOARGS defined dummy arg + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG macro + ensure PyCFunctions of type METH_KEYWORDS really actually use the problematic kargs param, if not remove it Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-05-10s4/messaging: do not deref NULL state (CID 1437973)Douglas Bagnall1-4/+4
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-21build: Remove bld.gen_python_environments()Andrew Bartlett1-5/+3
This was part of --extra-python support. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-02-08s4/messaging/py: use better format strings for variable typesDouglas Bagnall1-4/+4
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-01-29s4:messaging: add support 'smbcontrol <pid> debug/debuglevel'Stefan Metzmacher1-0/+72
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13752 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Baumbach <bbaumbach@samba.org>
2019-01-28s4:lib: Use C99 initializer for PyGetSetDef in pymessagingAndreas Schneider1-3/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-01-20s4/messaging: Fix undefined reference in linking libMESSAGING-samba4.soAnoop C S1-2/+2
Early check for DEVELOPER or ENABLE_SELFTEST configure options inside messaging_handlers.c leaves us with the following undefined reference linkage error: [1315/3712] Linking bin/default/source4/lib/messaging/libMESSAGING-samba4.so /usr/bin/ld: source4/lib/messaging/messaging.c.4.o: in function `imessaging_init_internal': /root/samba.git/bin/default/../../source4/lib/messaging/messaging.c:472: undefined reference to `imessaging_register_extra_handlers' collect2: error: ld returned 1 exit status This happened due to failure in including "includes.h" before checking the above mentioned configure options. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-01-11Revert "s4:messaging: make sure only imessaging_client_init() can be used ↵Ralph Boehme1-26/+2
with a wrapper tevent_context wrapper" This reverts commit e186d6a06b1b300256a2cb4138f0532d518d0597. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-12-19s4 messaging: Add support for smbcontrol sleepGary Lockyer1-0/+33
Add a sleep command that pauses the target process for the specified number of seconds This command is only enabled on developer and self test builds. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-19s4 messaging: support smbcontrol inject fault commandGary Lockyer4-1/+101
Add support of the smbcontrol inject fault command to the samba daemon. This is useful for manual testing of process restart etc. command is only enabled for developer and self test builds Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-23source4 messaging: clean up terminated processesGary Lockyer2-0/+44
Now that the smbd pre-fork process model restarts failed processes rather than terminating, we end up with names registered to defunct processes. This patch adds a function to clean up all the names registered to a process. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-12s4:messaging: make sure only imessaging_client_init() can be used with a ↵Stefan Metzmacher1-2/+26
wrapper tevent_context wrapper imessaging_client_init() can be used with a wrapper tevent_context, but only if a global messaging_dgm_ref() already exist. All other uses of imessaging_init() and imessaging_client_init() require a raw tevent_context. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Jul 12 02:23:37 CEST 2018 on sn-devel-144
2018-07-11s4:messaging: allow imessaging_post_handler() to free the messaging context ↵Stefan Metzmacher1-0/+33
from a handler In usecases like using messaging_client_init() with irpc processing we may free the imessaging_context during the messaging handler. imessaging_post_handler() is not yet really used, but it will change in the next commits. imessaging_post_state is a child of imessaging_context and might be implicitly free'ed before the explicit TALLOC_FREE(state). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>