summaryrefslogtreecommitdiffstats
path: root/lib/ldb/common
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* ldb: Allow to register extended match rulesSamuel Cabrero2014-12-222-36/+146
| | | | | | | | | | | | 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>
* 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/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: 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: 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>
* 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: 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>
* ldb: bad if test in ldb_comparison_fold()Jeremy Allison2013-12-071-1/+1
| | | | | | | | | | | | Found by David Binderman <dcb314@hotmail.com> BUG: https://bugzilla.samba.org/show_bug.cgi?id=10305 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat Dec 7 11:10:47 CET 2013 on sn-devel-104
* ldb: use of NULL pointer bugfixPavel Reichl2013-12-031-2/+2
| | | | | Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Tue Dec 3 21:13:53 CET 2013 on sn-devel-104
* ldb: Show the type of failing operation in default error messageAndrew Bartlett2013-09-161-1/+26
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ldb: Cope with substring match with no chunks in ldb_filter_from_treeAndrew Bartlett2013-06-241-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldb: Ensure not to segfault on a filter such as (mail=)Andrew Bartlett2013-06-221-0/+5
| | | | | | | | | | | | | As reported by Robin McCorkell <xenopathic@gmail.com> triggered by Mozilla Thunderbird as an LDAP client. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Jun 22 09:33:14 CEST 2013 on sn-devel-104
* ldb: use strncmp instead of strcmp when comparing the val partMatthieu Patou2013-02-081-2/+2
| | | | | | | val part of a DN's component is DATA_BLOB and nothing insure that it will be finished by a '\0' Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: Ensure to decrement the transaction_active whenever we delete a transactionAndrew Bartlett2013-01-261-0/+1
| | | | | | | | | | | | | | | | | This is in the error path for prepare_commit, which rarely fails, but when it does we need to ensure that when a new transaction is opened, that it really starts a new transaction. We bump the version to recognise critical fix for the AD DC Without this fix, a single invalid inbound replicated link disables all subsequent replication as we operate without a transaction (which is refused by ldb_tdb). Andrew Bartlett Reviewed-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ldb: fix a typo in the comment for ldb_req_is_untrusted()Michael Adam2012-11-301-1/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Nov 30 15:44:46 CET 2012 on sn-devel-104
* lib/ldb: add missing newline in the output of ldb_ldif_write_trace()Stefan Metzmacher2012-11-131-1/+1
| | | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Nov 13 13:53:31 CET 2012 on sn-devel-104
* ldb: fixed callers for ldb_pack_data() and ldb_unpack_data()Andrew Tridgell2012-11-011-26/+23
| | | | | | | | | | | with ltdb_pack_data() and ltdb_unpack_data() now moved into common, we need to increase the minor version and fixup callers of the API Note that this relies on struct ldb_val being the same shape as TDB_DATA, in much the same way as we rely on ldb_val and DATA_BLOB being the same shape. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb: move ldb_pack.c into commonAndrew Tridgell2012-11-011-0/+290
| | | | | | | | | this code should not be tied to the ldb_tdb backend, both because it could be used for any record oriented backend, and because it should be exposed for use by diagnosis/repair tools such as the recently added ldbdump tool Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* At Michael's suggestion, factor common code into a function. My bad :-).Jeremy Allison2012-09-111-4/+9
| | | | | Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Sep 11 20:08:37 CEST 2012 on sn-devel-104
* Fix bug #9147 - winbind can't fetch user or group info from AD via LDAPJeremy Allison2012-09-101-2/+4
| | | | | Don't use "isprint" in ldb_binary_encode(). This is locale specific. Restrict to ASCII only, hex encode everything else.
* lib/ldb: Avoid printing secret attributes in ldb trace logsAndrew Bartlett2012-08-293-13/+80
| | | | | | | | These are printed when Samba has debug level 10, which is often used for debugging. Instead, print a note to say that this attribute has been skipped. Andrew Bartlett
* LDB:ldif_handlers.c - LDB_OP_GREATER/LDB_OP_LESS are thought as ">=" or "<="Matthias Dieter Wallnöfer2012-08-221-1/+1
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* lib/ldb: Do not vasprintf() the tevent debug messages that will not be shownAndrew Bartlett2012-08-092-9/+16
| | | | | | | | | | This malloc() and free() actually shows up quite high on a call profile of provision of the AD DC. This allows the debug handler to decide if the argument list should be printed. Andrew Bartlett
* lib/ldb: Print trace messages for modify correctlyAndrew Bartlett2012-06-271-1/+1
|
* ldb: lay foundation for proper utc/generalized time handlingMatthieu Patou2012-06-222-5/+41
| | | | | | | We use to handle UTCtime and generalized time the same way. The thing is that it's not the case, they are different in the way they are set (most of the time) with different format and also stored and return in different format too.
* ldb: add the VERIFY_NAME controlMatthieu Patou2012-06-221-0/+53
|
* ldb: added ldb_msg_element_equal_ordered()Andrew Tridgell2012-04-181-0/+20
| | | | | this gives us a order sensitive msg element comparison. We need this to allow dbcheck to fix the order of objectClass attributes.
* LDB:ldb_msg.c - add another OOM check in "ldb_msg_copy()"Matthias Dieter Wallnöfer2012-04-111-0/+1
|
* ldb: Allow access to the line number while reading ldif from a fileAndrew Bartlett2012-04-101-6/+13
|
* ldb:ldb/common/ldb_controls.c - reference "err_string" variable correctlyMatthias Dieter Wallnöfer2012-01-021-1/+1
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* ldb: fix compiler warningDavid Disseldorp2011-11-021-1/+1
| | | | | | | Mixed declarations and code. Autobuild-User: David Disseldorp <ddiss@samba.org> Autobuild-Date: Wed Nov 2 16:51:24 CET 2011 on sn-devel-104
* ldb:common/ldb_modules.c - fix a typo in commentMatthias Dieter Wallnöfer2011-10-271-1/+1
| | | | Reviewed-by: abartlet
* ldb: ldb_errstring() takes ldb_contxt as an argumentAmitay Isaacs2011-10-201-1/+1
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* dsdb: improve debug messageAndrew Tridgell2011-10-201-3/+3
| | | | | | | show the reply type in "Invalid reply type" messages Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Oct 20 00:57:05 CEST 2011 on sn-devel-104
* ldb: Output more error information when a connect failsAndrew Bartlett2011-10-181-1/+1
|
* ldb:ldb_autotransaction_request - error string shouldn't be set hereMatthias Dieter Wallnöfer2011-10-111-5/+0
| | | | | | | | | | | A generic error string should be set independently of the access mechanism to an LDB operation. Hence it should be handled in "ldb_wait" and "ldb_request" Signed-off-by: Andrew Tridgell <tridge@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Oct 11 10:15:18 CEST 2011 on sn-devel-104
* ldb:ldb.c/"ldb_wait" - make "ldb_wait" always return an error stringMatthias Dieter Wallnöfer2011-10-111-4/+39
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* ldb:ldb.c/"ldb_wait" - change "ldb_wait" slightly in order to introduce ↵Matthias Dieter Wallnöfer2011-10-111-3/+5
| | | | | | | | | | | | | | | error messages In this occasion remove a redundant check for "LDB_ASYNC_DONE": if (handle->state == LDB_ASYNC_DONE || if (handle->state == LDB_ASYNC_DONE) handle->status != LDB_SUCCESS) { return handle->status; return handle->status; == if (handle->status != LDB_SUCCESS) } return handle->status; ... ... return LDB_SUCCESS; return LDB_SUCCESS; Signed-off-by: Andrew Tridgell <tridge@samba.org>
* ldb:ldb.c/"ldb_request" - make "ldb_request" always return an error stringMatthias Dieter Wallnöfer2011-10-111-1/+15
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* ldb:ldb.c - "ldb_set_errstring" can be implemented by using ↵Matthias Dieter Wallnöfer2011-10-111-10/+7
| | | | | | "ldb_asprintf_errstring" Signed-off-by: Andrew Tridgell <tridge@samba.org>
* ldb:ldb_autotransaction_request - fix a typo in a commentMatthias Dieter Wallnöfer2011-10-111-1/+1
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* Revert "ldb: support raw OIDs in control string parsing"Stefan Metzmacher2011-10-071-18/+0
| | | | | | | | This reverts commit ea41860d32d38448e08cefd79d30ee1150317a9e. This is not needed, because we already have the 'local_oid' magic. metze
* ldb/ldb_controls: allow oid up to 255 charsStefan Metzmacher2011-10-071-1/+1
| | | | | | We have char oid[256], so allow sscanf() to consume 255 chars. metze
* ldb: support raw OIDs in control string parsingAndrew Tridgell2011-10-061-0/+18
| | | | | | | this makes it possible to use a raw OID string on the command line or in python scripts Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb: fixed memory leak in control string parsingAndrew Tridgell2011-10-061-0/+24
| | | | | | if parsing fails, free ctrl Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb:"ldb_extended" -make the call more similar to "ldb_search"Matthias Dieter Wallnöfer2011-09-191-2/+6
| | | | | | For example NULL out the LDB result pointer on failures. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* ldb:ldb_controls.c - remove duplicate definition of "LDB_CONTROL_CMP"Matthias Dieter Wallnöfer2011-09-111-11/+3
| | | | | | And fix the comment Reviewed-by: Jelmer