summaryrefslogtreecommitdiff
path: root/source4/param
AgeCommit message (Collapse)AuthorFilesLines
2025-08-22libsmb: Add "smb_encryption_over_quic" to smb311_capabilitiesVolker Lendecke1-2/+4
Put here from the "client smb encryption over quic" settings Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-18s4:param: let lpcfg_smbcli_options() use lpcfg_client_smb_transports()Stefan Metzmacher1-2/+2
It means we'll use 'client smb transports' instead of 'smb ports' for the client side. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: introduce smbcli_options.transports based on lpcfg_smb_ports()Stefan Metzmacher1-0/+2
This will allow us to avoid passing lpcfg_smb_ports() explicitly in a lot of places in the following commits. Once that's done we will change away from "smb ports" to something like "client smb transports". Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-01-02specify some deps on private libs actually used directlyMichael Tokarev1-1/+1
Lots of samba libraries has incomplete dependencies listed in wscript files. This usually is not a problem since the link line includes dependencies of their dependencies of their dependencies, and somewhere down that line all immediate dependencies which are missing are actually present. But sometimes this becomes a problem when a library does not declare direct dependency on at least one private library which it actually uses: in case no private library is listed as direct dependency, private library directory is not put into RUNPATH of the resulting binary, so the binary can not find its own dependencies. Fix a few such places, including some libraries which are a part of public abi (libsmbldap, libndr). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2023-11-20Use python.h from libreplaceAndreas Schneider3-3/+3
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-08-08s4:param: Add missing newlines to logging messagesJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-08python: Use correct function signaturesJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-07-21s4:param: replace calls to deprecated Python methodsDmitry Antipov1-3/+15
Replace calls to (obsolete but still stable) PyEval_CallObjectWithKeywords() with PyObject_Call() by using trivial wrapper. Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> [abartlet@samba.org Adjusted to always use the PyObject_Call() as it is available in all of Samba's supported python versions]
2022-10-03python: whitespace fixesVolker Lendecke1-11/+11
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-11s4:param: add ↵Stefan Metzmacher1-1/+10
--option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4" support... We already handle this in the source3/libsmb code, but it's good to have this also for torture tests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-06pyparam: expose lpcfg_dump_globals()Douglas Bagnall1-0/+33
This is needed by samba-tool testparm, in the next commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15070 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: David Mulder <dmulder@suse.com>
2021-07-15libcli/smb: actually make use of "client/server smb3 signing algorithms"Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-07-15s4:param: make use of 'client smb3 encryption algorithms'Stefan Metzmacher1-9/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-03-26smb.conf: Remove "share backend" optionAndrew Bartlett6-638/+12
This is a confusing hold-over from the NTVFS fileserver that never became part of the merged architecture. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-03-17s4:param: let lpcfg_smbcli_options() fill smb3_capabilities.ciphersStefan Metzmacher1-0/+9
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14512 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-03-10lib/param: Remove lpcfg_volume_label() and only caller in NTVFS file serverAndrew Bartlett2-5/+0
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2020-10-29s4:param: Add 'weak crypto' getter to pyparamAndreas Schneider1-0/+22
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-08-28lib/util: remove extra safe_string.h fileMatthew DeVore1-0/+2
lib/util/safe_string.h is similar to source3/include/safe_string.h, but the former has fewer checks. It is missing bcopy, strcasecmp, and strncasecmp. Add the missing elements to lib/util/safe_string.h remove the other safe_string.h which is in the source3-specific path. To accomodate existing uses of str(n?)casecmp, add #undef lines to source files where they are used. Signed-off-by: Matthew DeVore <matvore@google.com> Reviewed-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184
2020-07-08s4:param: use struct initializer in lpcfg_smbcli_session_options()Stefan Metzmacher1-3/+5
We should zero all fields not initialiazed explicitly. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2020-07-08s4:param: use struct initializer in lpcfg_smbcli_options()Stefan Metzmacher1-14/+16
We should zero all fields not initialiazed explicitly. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2020-06-23Add python binding for DATADIR build pathDavid Mulder1-0/+7
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-05-08Fix clang 9 missing-field-initializer warningsGary Lockyer1-3/+3
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-23py3: Remove #define PyInt_FromLong PyLong_FromLongAndrew Bartlett2-5/+5
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
2020-03-19s4/param: py_sid shouldn't be decref'ed after insertion into dictNoel Power1-8/+2
This was causing samba.tests.net_join_no_spnego(ad_dc) to core dumps sometimes on tumbleweed with python3.8 with... =============================================================== INTERNAL ERROR: Signal 11 in pid 1781 (4.12.0) If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting =============================================================== smb_panic_default: PANIC (pid 1781): internal error BACKTRACE: 64 stack frames: 7128 #0 bin/shared/libsamba-util.so.0(log_stack_trace+0x1f) [0x7fa541c5b220] 7129 #1 bin/shared/libsamba-util.so.0(+0x1efc8) [0x7fa541c5afc8] 7130 #2 bin/shared/libsamba-util.so.0(log_stack_trace+0) [0x7fa541c5b201] 7131 #3 bin/shared/libsamba-util.so.0(+0x1eed9) [0x7fa541c5aed9] 7132 #4 bin/shared/libsamba-util.so.0(+0x1eeee) [0x7fa541c5aeee] 7133 #5 /lib64/libc.so.6(+0x3bf20) [0x7fa542631f20] 7134 #6 /usr/lib64/libpython3.8.so.1.0(PyObject_GC_UnTrack+0xd) [0x7fa542386c1d] 7135 #7 /usr/lib64/libpython3.8.so.1.0(+0x12d599) [0x7fa542387599] 7136 #8 /usr/lib64/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4d6d) [0x7fa5424269ed] 7137 #9 /usr/lib64/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x30c) [0x7fa5423eaf5c] 7138 #10 /usr/lib64/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x18e) [0x7fa5423ebcbe] 7139 #11 /usr/lib64/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4a3a) [0x7fa5424266ba] etc.... Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Mar 19 22:23:52 UTC 2020 on sn-devel-184
2020-03-19s4/param: treat NULL value passed to dict_insert as errorNoel Power1-0/+3
insert_dict is used as a convenience to decrement the values to prevent leaks with orpahaned PyObjects and avoid excessive creation of temp variables. if (!dict_insert(parameters, "rootdn", PyUnicode_FromString(settings->root_dn_str))) { status = NT_STATUS_UNSUCCESSFUL; goto out; } Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-03-19s4/param: don't decref object we don't ownNoel Power1-1/+0
provision_fn is a borrowed reference we should not call Py_CLEAR on it Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-05s4:param: make sure secrets_db_connect() no longer creates on empty secrets.ldbStefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Feb 5 10:13:02 UTC 2020 on sn-devel-184
2020-02-05s4:param: make use of secrets_db_create() in provision_store_self_join()Stefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-02-05s4:param: add secrets_db_create() helper functionStefan Metzmacher2-0/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-09-01Spelling fixes s/tempates/templates/Mathieu Parent1-1/+1
Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-06-24py3: Remove duplicated PyUnicode_Check() after the py3 compat macros were ↵Andrew Bartlett2-2/+2
removed This came about because in py2 we had to check for strings and unicode. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Mon Jun 24 18:48:53 UTC 2019 on sn-devel-184
2019-06-24py3: Remove PyStr_AsString() compatability macroAndrew Bartlett3-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-06-24py3: Remove PyStr_FromFormat() compatability macroAndrew Bartlett1-2/+2
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-37/+37
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_Check() compatability macroAndrew Bartlett2-2/+2
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-16s4: squash 'cast between incompatible function types' warningNoel Power1-6/+6
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-03-21build: Remove bld.gen_python_environments()Andrew Bartlett1-28/+26
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-21s4/param: Fix provision_get_schema leaking python objectNoel Power1-8/+4
provision_get_schema returns a ldb_context object which is stored in a python object. As a result the parent python object is never decrefed and probably not released ever. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-13Make sure results from GetAttrString are decref'ed where neededNoel Power1-5/+21
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett abartlet@samba.org Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Feb 13 14:51:12 CET 2019 on sn-devel-144
2019-02-13Fix instances of PyDict_SetItem to decref the valueNoel Power1-105/+241
Although it would be better to use the BuildValue approach to create the dictionares here, unfortunately the dictionaries created here have key/values that are created dynamically (based on input params). Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett abartlet@samba.org
2019-02-07decref results of PyStr_FromStringNoel Power1-3/+12
Where we create temporary objects (which are added to containers) these objects already get there ref count incremented. In this case we need to decref those objects to ensure they are released. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-02-07Cleanup references to module objects returned from PyImport_ImportModuleNoel Power1-2/+6
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-02-01s4/param/provision: check samdb argument in provision_bare()Douglas Bagnall1-2/+7
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-01-29s4/param/provision py_dom_sid_FromSid: avoid python memleakDouglas Bagnall1-4/+6
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): Tue Jan 29 16:54:48 CET 2019 on sn-devel-144
2019-01-28s4:pyparam: Use C99 initializer for PyGetSetDefAndreas Schneider1-4/+10
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-11-08debug: Use debuglevel_(get|set) functionAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 8 11:03:11 CET 2018 on sn-devel-144
2018-09-15s4/param: py2/p3 compat override_prefixmap should be string/bytesNoel Power1-1/+1
2018-07-12param: Add python binding for lpcfg_state_pathDavid Mulder1-0/+27
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-28param: Add non-global smb.cfg option (support 2 different smb.confs)Aaron Haslett1-1/+46
The default behaviour is that there is only a single global underlying LoadParm object. E.g. if you create 2 different LoadParm objects in python, they both modify the same underlying object. This patch adds a mechanism to override this and create a separate non-global LoadParm object. The use-case is the backup tool, where we want to manipulate 2 different smb.conf files (the one used to create the backup, and the smb.conf in the backup itself). Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-04-30s4/param: Additionally accept unicode as string param in Py2Noel Power2-2/+2
With the changes to make samba python code Py2/Py3 compatible there now are many instances where string content is decoded. Decoded string variables in Py2 are returned as the unicode type. Many Py2 c-module functions that take string arguments only check for the string type. However now it's quite possibe the content formally passed as a string argument is now passed as unicode after being decoded, such arguments are rejected and code can fail subtly. This only affects places where the type is directly checked e.g. via PyStr_Check etc. arguments that are parsed by ParseTuple* functions generally already accept both string and unicode (if 's', 'z', 's*' format specifiers are used) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>