summaryrefslogtreecommitdiffstats
path: root/source4/lib/ldb
Commit message (Collapse)AuthorAgeFilesLines
* ldb: make ldb a top level library for Samba 4.0Andrew Bartlett2011-07-05140-46149/+0
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* pyldb: added methods to get/set extended components on DNsAndrew Tridgell2011-06-221-0/+51
| | | | | | this will be used by the dbcheck code Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb: added extended_str() method to pyldbAndrew Tridgell2011-06-221-0/+16
| | | | | | this gives access to ldb_dn_get_extended_linearized() from python Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb: expose syntax oids to pythonAndrew Tridgell2011-06-221-0/+10
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* tdb2: tie it into build process if --enable-tdb2-breaks-compatRusty Russell2011-06-201-1/+1
| | | | | | | | | | | This is simplistic. We need to support making TDB2 a standalone library, but for now, we simply built it in-tree. Once we have tdb1 compatibility in tdb2, we can rename this option to --enable-tdb2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_compat: use tdb_open_compat.Rusty Russell2011-06-202-28/+50
| | | | | | | | | This is a helper for the common case of opening a tdb with a logging function, but it doesn't do all the work, since TDB1 and TDB2's log functions are different types. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb2: #ifdef out TDB_ERR_NOLOCK and TDB_ERR_LOCK_TIMEOUT.Rusty Russell2011-06-201-0/+4
| | | | | | | | These don't exist in tdb2. The former is used in one weird place in tdb1, and the latter not at all. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* ldb: replace 'struct TDB_DATA' with 'TDB_DATA'Rusty Russell2011-06-203-6/+6
| | | | | | | The typedef is TDB2 compatible, the struct isn't. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_unlockall/tdb_unlockall_read: ignore return value.Rusty Russell2011-06-201-1/+2
| | | | | | | | | TDB2 returns void here. tdb_unlockall will *always* return with the database unlocked, but it will complain via the log function if it wasn't locked. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell2011-06-202-3/+3
| | | | | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for < 0 instead of == -1. Also, there's no tdb_traverse_read in TDB2: we don't try to make traverse reliable any more, so there are no write locks anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_transaction_cancel: ignore return value.Rusty Russell2011-06-201-4/+1
| | | | | | | | | TDB2 returns void here. tdb_transaction_cancel will *always* return with the transaction cancelled, but it will complain via the log function if a transaction wasn't in progress. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_store: check returns for 0, not -1.Rusty Russell2011-06-202-2/+2
| | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_fetch_compat: use instead of tdb_fetch.Rusty Russell2011-06-203-5/+7
| | | | | | | This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_compat.h: divert every tdb build and includes to tdb_compatRusty Russell2011-06-202-7/+12
| | | | | | | | We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* pyldb: add unit test for get(myattribute, defVal)Matthieu Patou2011-06-201-0/+5
| | | | | Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Mon Jun 20 09:23:15 CEST 2011 on sn-devel-104
* py-ldb: allow dictionnary like usage (ie. e.get("myattribute", defVal)Matthieu Patou2011-06-191-3/+8
|
* pyldb: make ldb operations more consistentAndrew Tridgell2011-06-141-12/+21
| | | | | | | This changes the controls option on ldb operations to be a keyword argument, which is more consistent with general python conventions. This also fixes the pydoc output to include the controls option.
* pyldb: added validate option to ldb.modify()Andrew Tridgell2011-06-141-9/+15
| | | | | | This allows validation of ldb messages in a ldb modify operation to be bypassed, by setting validate=False. This is useful in the dbcheck tool to allow for removing invalid empty attributes from the database
* ldb:ldb_msg.c - move away from "errno"Matthias Dieter Wallnöfer2011-06-091-3/+0
| | | | Reviewed-by: Tridge
* ldb:pyldb.c - all flags should be unsignedMatthias Dieter Wallnöfer2011-05-211-10/+10
| | | | | | Adapt it to the previous commits Reviewed-by: Jelmer + Metze
* ldb:ldb_sqlite3.c - all LDB flags should be handled as "unsigned"Matthias Dieter Wallnöfer2011-05-211-2/+3
| | | | Signed-off-by: Metze
* ldb:tools/cmdline.c + tools/ldbtest.c - the connection flags are typed as ↵Matthias Dieter Wallnöfer2011-05-212-2/+2
| | | | | | "unsigned" Signed-off-by: Metze
* ldb:ldbtest.c - make more use of LDB constantsMatthias Dieter Wallnöfer2011-05-211-4/+4
| | | | Signed-off-by: Metze
* ldb:tdb backend - cache - remove unused "last_attribute" structure memberMatthias Dieter Wallnöfer2011-04-292-8/+0
| | | | | | | Reviewed-by: abartlet Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Apr 29 20:07:27 CEST 2011 on sn-devel-104
* ldb:tools/cmdline.c + tools/ldbtest.c - make use of LDB result constantsMatthias Dieter Wallnöfer2011-04-292-2/+2
| | | | Reviewed-by: abartlet
* ldb:ldb_controls.c - fix comment indentationMatthias Dieter Wallnöfer2011-04-291-4/+4
| | | | Reviewed-by: abartlet
* Support the 'PYTHON' environment variable.Jelmer Vernooij2011-04-231-0/+6
| | | | | Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Apr 23 04:19:05 CEST 2011 on sn-devel-104
* s4:ldb: change version to 1.1.0 after adding new functions:ldb-1.1.0Stefan Metzmacher2011-04-212-1/+254
| | | | | | | | | | | | | ldb_ldif_parse_modrdn() ldb_req_set_custom_flags() ldb_req_get_custom_flags() Signed-off-by: Simo Sorce <idra@samba.org> metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Apr 21 17:15:16 CEST 2011 on sn-devel-104
* ldb: add custom flags and functions for the application that wants to ↵Matthieu Patou2011-04-213-0/+54
| | | | | | | manipulate them Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4:ldb/tests: add tests for ldbmodify and 'modrdn'Stefan Metzmacher2011-04-212-1/+16
| | | | | | Signed-off-by: Simo Sorce <idra@samba.org> metze
* s4:ldb/tools: add support for "modrdn" to ldbmodifyStefan Metzmacher2011-04-211-1/+23
| | | | | | Signed-off-by: Simo Sorce <idra@samba.org> metze
* s4:ldb/ldif: add support for "modrdn"Stefan Metzmacher2011-04-212-1/+226
| | | | | | | | | This add a ldb_ldif_parse_modrdn() helper function to parse the information out of a ldb_message structure. Signed-off-by: Simo Sorce <idra@samba.org> metze
* ldb:ldb/common/ldb_modules.c - change the request counter type to be "unsigned"Matthias Dieter Wallnöfer2011-04-081-1/+1
| | | | | | | | | | Just for consistency since all other LDB counters are unsigned as well. And also the debug output specifier has been chosen to be "%u" - so it really should be unsigned. Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Apr 8 09:17:47 CEST 2011 on sn-devel-104
* ldb:ldb/common/ldb_modules.c - trivial - fix integer output specifiersMatthias Dieter Wallnöfer2011-04-081-2/+2
|
* ldb:ldb_msg.c - make "ldb_msg_find_attr_as_*" more robust against invalid valuesMatthias Dieter Wallnöfer2011-04-071-19/+106
| | | | | | | | | | | | | - Integer handling was modeled after validate code from "schema_syntax.c". - Double handling was modeled similar, but with a dynamic buffer. I don't know if there is a maximum literal length for double values but an allocation shouldn't a problem here since doubles are rare. - String handlind is enhanced with a terminating "0" test for safety. Reviewed-by: abartlet + metze Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Thu Apr 7 16:38:57 CEST 2011 on sn-devel-104
* ldb:ldb_msg_check_sanity - clean it up from unneeded stuffMatthias Dieter Wallnöfer2011-04-071-4/+0
|
* ldb:ldbadd/modify tool - return error code when at least one operation has ↵Matthias Dieter Wallnöfer2011-04-072-5/+8
| | | | | | | | | failed This is required to better detect failures and should raise the compatiblity to "ldapadd"/"ldapmodify". Reviewed-by: abartlet
* ldb:tests - "init.ldif" - deactivate empty "seeAlso" attributeMatthias Dieter Wallnöfer2011-04-071-1/+2
|
* ldb:ldb/common/ldb_modules.c - always use LDB error codes if possibleMatthias Dieter Wallnöfer2011-04-071-6/+7
| | | | | | | The callers do compare against LDB error codes - hence don't give back "-1". Reviewed-by: Tridge + abartlet
* ldb:common/*.c - check for some OOM conditionsMatthias Dieter Wallnöfer2011-04-072-0/+7
| | | | Reviewed-by: abartlet
* ldb: fixed --paged option in ldb toolsAndrew Tridgell2011-04-071-1/+1
| | | | | | we were sometimes using 'paged_result' and sometimes using 'paged_results'. The latter seemed to be more common, so I changed the two places that used the 'paged_result' string to 'paged_results'
* ldb: detect eof on ldif filesAndrew Tridgell2011-03-292-0/+20
| | | | | | | use feof() to detect parsing errors in ldif files Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Mar 29 08:24:04 CEST 2011 on sn-devel-104
* pyldb: minor fixup, fix a memory leakMatthieu Patou2011-03-201-2/+3
| | | | | Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Sun Mar 20 12:13:50 CET 2011 on sn-devel-104
* ldb:fix control parsing for dirsyncMatthieu Patou2011-03-201-2/+3
|
* s4:ldb: don't install .pc files when building a private libraryStefan Metzmacher2011-03-161-2/+6
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Mar 16 09:58:22 CET 2011 on sn-devel-104
* ldb: only install headers if we are not building as a private libAndrew Tridgell2011-03-151-1/+4
|
* ldb: use include <> form for public headersAndrew Tridgell2011-03-152-3/+3
|
* ldb:ldb_controls.c - "ldb_save_controls" - allow that "saver" can also be NULLMatthias Dieter Wallnöfer2011-03-101-8/+12
| | | | Suggested by Tridge
* ldb:ldb_controls.c - always allocate enough spaceMatthias Dieter Wallnöfer2011-03-101-13/+27
| | | | | | | | The size for an additional "struct ldb_control" shouldn't hurt and so the excluded control can also be NULL. Added an ending "talloc_realloc" to resize the chunk to the effective needed size (requested by tridge).
* ldb:ldb_msg.c - use LDB result constants for checking return valuesMatthias Dieter Wallnöfer2011-03-041-2/+5
| | | | | | | Reviewed by: Tridge Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Mar 4 22:51:57 CET 2011 on sn-devel-104