summaryrefslogtreecommitdiff
path: root/source4/lib
AgeCommit message (Collapse)AuthorFilesLines
2019-06-30source4: Update all consumers of strtoul_err(), strtoull_err() to new APISwen Schillig2-5/+16
Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-06-26lib/tls: Remove unused header definitions from source4/lib/tls/tls.h (tls ↵Andrew Bartlett1-27/+0
socket wrapper) These were removed in eb15acdd35600878aba3319e070199200d9a1357 but the header declarations were not removed. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-06-24py3: Remove PyStr_AsString() compatability macroAndrew Bartlett1-1/+1
We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
2019-06-24py3: Remove PyStr_FromString() compatability macroAndrew Bartlett2-4/+4
We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
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 Power2-12/+24
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/lib/policy/gp_ldap: use ldb API to find messagesDouglas Bagnall1-12/+12
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-10s4: use ldb_msg_new(), not talloc/talloc_zeroDouglas Bagnall1-2/+2
ldb_msg_new() is currently the same as talloc_zero(), but it might not always be. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-10s4/policy/gp_filesys: avoid SIZE_MAX smbcli write (CID 1034779)Douglas Bagnall1-0/+6
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@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-05-08s4 lib socket: Ensure address string owned by parent structGary Lockyer1-1/+1
The local address string was not owned by it's parent structure, which caused a use after free error in continue_ip_open_socket source4/librpc/rpc/dcerpc_sock.c:267 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13929 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed May 8 20:03:42 UTC 2019 on sn-devel-184
2019-05-06libnet: Remove unused source4/libnet/libnet_sam{dump,sync}:Andrew Bartlett2-28/+0
The last caller was removed in samba-tool: Remove C version of samba-tool (e2af38415163f248e3dbd5a2abc156761e74b87c) by Amitay Isaacs in 2011 This was a tool to dump a genine NT4 DC (never Samba) into smbpasswd file. It did work against Windows AD, but DRS replication is much more comprehensive. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Mon May 6 07:11:51 UTC 2019 on sn-devel-184
2019-05-06lib/tls: Remove unused source4/lib/tls/tls.c (tls socket wrapper)Andrew Bartlett2-611/+0
The last caller was removed in 72c79e30f07bcc98610cca878f5de50e7db239a0 to remove the web server as all other callers use tls_tstream. Found by callcatcher. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-04-30waf: Remove configure steps from source4/lib/tlsAndreas Schneider2-87/+17
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-30s3:tls: Remove #ifdef for GnuTLSAndreas Schneider3-241/+3
This is a requirement now. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-11source4: Update error check for new string conversion wrapperSwen Schillig1-1/+1
The new string conversion wrappers detect and flag errors which occured during the string to integer conversion. Those modifications required an update of the callees error checks. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-03-21build: Remove bld.gen_python_environments()Andrew Bartlett3-16/+12
This was part of --extra-python support. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-03-01source4: Use wrapper for string to integer conversionSwen Schillig2-4/+22
In order to detect an value overflow error during the string to integer conversion with strtoul/strtoull, the errno variable must be set to zero before the execution and checked after the conversion is performed. This is achieved by using the wrapper function strtoul_err and strtoull_err. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-02-08s4/registry/py: use unsigned ParseTuple format for unsigned valueDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Feb 8 17:09:51 CET 2019 on sn-devel-144
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-02-07Cleanup (decref) some objects added to list.Noel Power1-2/+16
PyList_Append doesn't steal references, so if the item created is a temp object, created just to be added to the list we need to decref the item appended in order for it to be released. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
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-28s4:lib: Use C99 initializer for poptOption in popt_credentialsAndreas Schneider1-12/+75
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-01-28s4:lib: Use C99 initializer for poptOption in popt_commonAndreas Schneider1-23/+134
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-28s4:lib: Use #ifdef instead of #if for config.h definitionsAndreas Schneider3-4/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
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-09-05source4/lib/tls/wscript: update to handle waf 2.0.4Alexander Bokovoy1-2/+2
Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix W391: blank line at end of fileJoe Guo1-2/+0
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix W291: trailing whitespaceJoe Guo1-3/+3
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E701: multiple statements on one line (colon)Joe Guo1-8/+16
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E305: expected 2 blank lines after class or function definition, ↵Joe Guo1-0/+7
found 1 Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo1-0/+9
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E301: expected 1 blank line, found 0Joe Guo1-0/+3
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E261: at least two spaces before inline commentJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E231: missing whitespace after ','Joe Guo1-19/+19
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E203: whitespace before ':'Joe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix W602: deprecated form of raising exceptionJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-11s4:lib: Fix a possible fd leak in gp_get_file()Andreas Schneider1-8/+16
Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13567 Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Jeremy Allison <jra@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>
2018-07-10s4:messaging: add local.messaging.multi_ctx.multi_ctx testStefan Metzmacher1-0/+221
This tests the usage of multiple imessaging_contexts in one process and also freeing two of them during a message handler. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13514 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-13s4/lib/py-registry: initialize optional parameters for open_* functionsDouglas Bagnall1-2/+6
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-04-13s3/lib/policy/wscript_build: build samba_policy lib for extra-python/py3Noel Power1-6/+9
pypolicy module needs appropriate samba_policy library for extra-python/py3 therefore we need to build it for it to be available Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-13wscript_build: make sure we link extra-python versions of librariesNoel Power1-1/+1
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05wscript_build: fix c modules deps name for Python 3Joe Guo1-5/+7
In wscript_build, the lib name in deps list may have postfix for Python 3. Instead of hard coding the base name directly, need to load correct name for each Python version with `bld.pyembed_libname`. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>