summaryrefslogtreecommitdiffstats
path: root/lib/ldb
Commit message (Collapse)AuthorAgeFilesLines
* pyldb: Add tests for type errorsPetr Viktorin2015-03-041-0/+42
| | | | | | | | | Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Mar 4 01:49:02 CET 2015 on sn-devel-104
* pyldb: Report errors converting controls list to char**Petr Viktorin2015-03-031-0/+20
| | | | | | | | | With this change, passing an unexpected type to the CRUD methods will result in an informative TypeError. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Better error reportingPetr Viktorin2015-03-031-2/+2
| | | | | | | | Provide more useful error messages for some type errors Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Type-check arguments parsed with PyArg_ParseTuple*Petr Viktorin2015-03-031-8/+8
| | | | | | | | | PyObject* arguments need to be type-checked before they're cast to subtypes. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Fix reference leaksPetr Viktorin2015-03-031-6/+12
| | | | | | | | | | | | | The parse_ldif and MessageElement.__iter__ functions leaked references to intermediate lists whose iterators they return. The MessageElement repr used the undocumented macro PyObject_REPR, which leaks references. (It was used internally in CPython before fatal errors, and will be removed in Python 3.5.) Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Remove use of staticforward macroPetr Viktorin2015-03-031-1/+1
| | | | | | Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Properly preallocate result control listPetr Viktorin2015-03-031-1/+5
| | | | | | | | | | | The list was always allocated with size 1, so if there is more than 1 result control, the additional items would not be added in the list, and would become leaked references. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Use the Py_TYPE macroPetr Viktorin2015-03-031-3/+3
| | | | | | | | | | The "ob_type" member of Python objects is going away in Python 3 for compliance with C's strict aliasing rules. The Py_TYPE macro should be used instead. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyldb: Correct reference counting when returning boolsPetr Viktorin2015-03-031-4/+4
| | | | | | | | | Simply returning Py_True/PyFalse doesn't increment the bool object's reference count. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix the O3 developer buildVolker Lendecke2015-03-031-1/+1
| | | | | | | | | | Different gcc versions complain at different places Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Mar 3 13:14:53 CET 2015 on sn-devel-104
* Force rebuild of ldb if pyldb-util is not available.Jelmer Vernooij2015-02-171-4/+4
| | | | | | | | | This is necessary since pyldb-util uses ldb_private.h, so we want to build against the same source ldb. Change-Id: I802974b9eef7deb102fea15b67ec5f87e8e353bd Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* wscript: Expand tabs.Jelmer Vernooij2015-02-171-1/+1
| | | | | | | Change-Id: I2746f775accceeb2eeb02679f2c91b02085560b6 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* ldb: version 1.1.20Stefan Metzmacher2015-01-243-1/+266
| | | | | | | | - Bug 9810 - validate_ldb of String(Generalized-Time) does not accept millisecond format ".000Z" Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* lib/ldb: fix logic in ldb_val_to_time()Stefan Metzmacher2015-01-241-6/+32
| | | | | | | | | | | | 040408072012Z should represent 20040408072012.0Z as well as 20040408072012.000Z or 20040408072012.RandomIgnoredCharaters...Z Bug: https://bugzilla.samba.org/show_bug.cgi?id=9810 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* Remove use of the "staticforward" macroPetr Viktorin2015-01-221-7/+7
| | | | | | | | | | This macro was used for compatibility with broken compilers. Since Python 2.3, it is always defined as `static`, and only exists "for source compatibility with old C extensions". Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* ldb: bump to version 1.1.19Andrew Bartlett2014-12-223-1/+266
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz>
* ldb: Allow to register extended match rulesSamuel Cabrero2014-12-224-36/+165
| | | | | | | | | | | | This allows to extend LDB by registering extended match rules from outside the library itself. This is necessary when the implementation requires knowledge about syntaxes implemented in samba extensions, like the LDAP_MATCHING_RULE_TRANSITIVE_EVAL match. Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me> Singed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* ldb: version 1.1.18Stefan Metzmacher2014-11-293-1/+265
| | | | | | | | | | | | | | This release contains: - fixes for segfaults in pyldb - documentation fixes - build system improvements Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Nov 29 14:45:56 CET 2014 on sn-devel-104
* lib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()Kamen Mazdrashki2014-11-251-1/+2
| | | | | | | | | Change-Id: I0d09374b27708fcaad3523d985a2db7983dbd81a Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Nov 25 07:24:12 CET 2014 on sn-devel-104
* lib-pyldb: Fix docstring for msg.add() method - it was "S.append()"Kamen Mazdrashki2014-11-251-1/+1
| | | | | | Change-Id: I9492d3c3993fc3d68d7bf24405db6e8cd746eaac Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-ldb-test: Test copying message element from a message to a new messageKamen Mazdrashki2014-11-251-0/+14
| | | | | | Change-Id: Iefcafb418a170ee410aec900bb36eb8e01e946b1 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-pyldb: Avoid crash when copying MessageElements between Python Message ↵Kamen Mazdrashki2014-11-251-4/+22
| | | | | | | | | | | | | | | | | | | | objects This patch allows for following snipets in Python: res = ldb.search(...) m_from = res[0] m_to = Message() m_to.add(m_from["attrName"]) The problem previously is that we are trying to reference a ldb_message_element that may not be a memory context on its own. For instance, when search request from above example returns Messages with more than one attribute, this leads immediately to "Bad talloc magic value" crash, every message element beside the first one is not a memory context Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-ldb_ldif: Stop processing if ldb_message element name is NULLKamen Mazdrashki2014-11-251-0/+7
| | | | | | | | | | I have hit this while using Python bindings for testing and forgot to pass 'name' argument to MessageElement constructor Passing NULL as 'name' is obviously a mistake and this commits aims to warn about such unintetional mistakes. Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-ldb: Check for input parameter when searching attributes by nameKamen Mazdrashki2014-11-251-2/+13
| | | | | | | | This prevents a segfault that is hard to be tracked down from Python bindings for instance. Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-pyldb: Throw exception when we can't create MessageElement objectKamen Mazdrashki2014-11-251-0/+2
| | | | | | | | At the moment we return an error, but no exception and it is hard to instantly see what the problem is from Python Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-pyldb: Avoid leaking memory in error casesKamen Mazdrashki2014-11-251-2/+6
| | | | | Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_StringKamen Mazdrashki2014-11-251-0/+5
| | | | | Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/ldb: remove unused 'allow_warnings=True'Stefan Metzmacher2014-11-141-2/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/ldb: fix compiler warnings in ldb_tdb.cStefan Metzmacher2014-11-141-3/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/ldb: fix compiler warnings in ldb_modules_list_from_string()Stefan Metzmacher2014-11-141-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldb: fix a typo in the comment, LDB_FLAGS_MOD_xxx -> LDB_FLAG_MOD_xxxMatthieu Patou2014-09-301-2/+2
| | | | | | | | | Change-Id: I99ac6e272aa0f54a2720c58f630ae472068f255b Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Matthieu Patou <mat@samba.org> Autobuild-Date(master): Tue Sep 30 08:19:55 CEST 2014 on sn-devel-104
* lib/ldb/wscript: pass dep_vars=['LDB_VERSION'] to SAMBA_GENERATOR()Stefan Metzmacher2014-09-051-2/+1
| | | | | | | bld.add_manual_dependency() only works for files not for environment variables. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Fix typo in ldbrename manpageMarc Muehlfeld2014-08-281-1/+1
| | | | | Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Jeremy Allson <jra@samba.org>
* ldb: Fix check for third_partyAmitay Isaacs2014-08-211-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* third_party/popt: Initial support for popt.Ira Cooper2014-08-091-3/+15
| | | | | | | ctdb, ldb, and samba are supported builds for third_party popt. Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldb:build: improve detection of srcdirMichael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ldb: make the successful ldb_transaction_start() message clearerAndrew Bartlett2014-05-031-4/+8
| | | | | | | | | | | Change-Id: I00d0705484c3b53f55c4a8ec2953e92329b7408e Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat May 3 10:20:52 CEST 2014 on sn-devel-104
* ldb: change version to 1.1.17Stefan Metzmacher2014-05-023-1/+265
| | | | | | | | This adds some pyldb methods for ldb.Dn. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb:pyldb: add some more helper functions for LdbDnStefan Metzmacher2014-05-021-0/+112
| | | | | | | | This adds [g|s]et_component[|_name|_value]() and get_rdn_[name|value](). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb:pyldb: fix doc string for set_extended_component()Stefan Metzmacher2014-05-021-1/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb:pyldb: add some const to PyObject_FromLdbValue()Stefan Metzmacher2014-05-021-1/+1
| | | | | | | | PyString_FromStringAndSize() makes a copy of the value... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: Add a env variable to disable RTLD_DEEPBIND.Andreas Schneider2014-04-171-6/+19
| | | | | | | | | | | | | | We need a way to disable this in order to allow the ldb_*ldap modules to work with a preloaded socket wrapper. The only known user is the bind_dlz module, but symbol versioniong might be enough... So in future we may remove this completely or at least invert the default behavior. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dlinklist: Fix a typoVolker Lendecke2014-04-021-1/+1
| | | | | | | | 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): Wed Apr 2 17:11:37 CEST 2014 on sn-devel-104
* lib/ldb: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: pass module init errors back to the callerAndrew Bartlett2014-02-051-2/+3
| | | | | | | | | | | This makes provision errors clearer in Samba, as we can now get permission denied errors presented from LDB modules. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* ldb: Return LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS rather than OPERATIONS_ERROR ↵Andrew Bartlett2014-02-051-2/+5
| | | | | | | | | | | | on EACCES and EPERM This makes provision errors clearer in Samba. Andrew Bartlett Reviewed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* samba:python - Py_RETURN_NONE remove compatibility code for releases < 2.4Matthias Dieter Wallnöfer2014-01-092-9/+0
| | | | | | | | | http://www.python.org/doc//current/c-api/none.html Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date(master): Thu Jan 9 16:27:47 CET 2014 on sn-devel-104
* ldb: Fix 1138330 Dereference null return valueVolker Lendecke2013-12-171-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/ldb fix compiler warningsChristian Ambach2013-12-121-2/+2
| | | | | | | about potentially uninitialized variables Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/ldb fix compiler warningsChristian Ambach2013-12-121-2/+2
| | | | | | | about potentially uninitialized variables Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>