summaryrefslogtreecommitdiff
path: root/lib/dbwrap
AgeCommit message (Collapse)AuthorFilesLines
2013-06-06Revert "dbwrap: dbwrap_fetch_locked_timeout()."Volker Lendecke5-160/+0
This reverts commit f6eb187fdab6b8088bb065e418fe604c4eba7751. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jun 6 14:26:26 CEST 2013 on sn-devel-104
2013-05-12dbwrap: Fix CID 1002092 Uninitialized scalar variableVolker Lendecke1-1/+3
We don't set saved_errno in the ret==0 case. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2013-04-13ntdb: remove --disable-ntdb.Rusty Russell1-8/+0
Remove DISABLE_NTDB option, and --disable-ntdb from waf build. This just means that it will always get built: it isn't used by default yet. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 13 02:01:02 CEST 2013 on sn-devel-104
2013-03-27dbwrap: Add a comment explaining a restrictionVolker Lendecke1-0/+11
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Mar 27 13:40:15 CET 2013 on sn-devel-104
2013-02-20dbwrap_local_open: never open the .tdb if there is an .ntdbRusty Russell1-0/+5
This provides an extra safety check that everyone is using one or the other: you can't create a tdb file if there's an ntdb file. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-20dbwrap_local_open: open NTDB if extension is .ntdbRusty Russell1-5/+157
This switches dbwrap_local_open() based on the extension of the database name, so it handles both TDB and NTDB files. Moreover, if asked to open a .ntdb, and there's no ntdb file but there's a .tdb file, it converts that then moves it to .tdb.bak before opening, and turn the .tdb file into a dangling symlink to make sure it's never accidentally re-created or used: $ ls -l secrets.tdb lrwxrwxrwx 1 rusty rusty 23 Feb 11 11:31 secrets.tdb -> This is now in an NTDB This provides transparent upgrade if people decide to use NTDB on a database. Downgrade would be manual, eg: ntdbdump foo.ntdb | tdbrestore foo.tdb && mv foo.ntdb foo.ntdb.bak Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-20dbwrap: dbwrap_ntdb.cRusty Russell3-10/+734
This is a dbwrap backend for ntdb. It's a fairly straight conversion from the tdb version. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08dbwrap: Prevent transactions on non-persistent dbsVolker Lendecke1-0/+5
dbwrap_ctdb does not allow this anyway. This patch will avoid suprises when going non-clustered to clustered. Not everybody is developing against a clustered environment :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04lib/dbwrap: talloc_strdup() name in db_open_file()Stefan Metzmacher1-1/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-15dbwrap: add dbwrap_is_persistent()Michael Adam2-0/+6
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2012-11-29dbwrap: Remove an unnecessary if-statementVolker Lendecke1-3/+1
TALLOC_FREE can live with a NULL pointer Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29dbwrap: No need to NULL out a talloc_zero'ed structure elementVolker Lendecke1-1/+0
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29dbwrap: Use talloc_zero in db_open_rbtVolker Lendecke1-5/+1
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29dbwrap: Use talloc_zero in db_open_cacheVolker Lendecke1-6/+1
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29dbwrap: Use dbwrap_parse_record in dbwrap_fetch_uint32_bystringVolker Lendecke1-13/+27
Reviewed-by: Michael Adam <obnox@samba.org>
2012-10-25dbwrap: use talloc_stackframe() in db_tdb_log_key()Andrew Bartlett1-3/+4
We can not be sure that there is already a talloc_stackframe() in place so we must create one. Andrew Bartlett
2012-09-21s3:dbwrap: remove unused args from db_open_file()Gregor Beck2-6/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-21s3:dbwrap: let dbwrap_fetch_uint32 distinguish between "not found" and ↵Gregor Beck1-2/+5
"wrong format" Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-03lib/dbwrap: rewrite lock order check to ease debuggingGregor Beck2-30/+56
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Aug 3 12:52:38 CEST 2012 on sn-devel-104
2012-07-04ntdb: make --disable-ntdb work properly.Rusty Russell1-0/+2
As per bug #9024, make --disable-ntdb work again. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Jul 4 08:11:33 CEST 2012 on sn-devel-104
2012-06-22dbwrap: don't ignore the result of dbwrap_parse_record in dbwrap_fetch_int32()Stefan Metzmacher1-1/+5
metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jun 22 17:10:52 CEST 2012 on sn-devel-104
2012-06-22dbwrap: intialize state.status in dbwrap_fetch_int32()Stefan Metzmacher1-0/+2
This might not be needed, but it makes it more clear that we won't use uninitialized memory, it the callback was not triggered. metze
2012-06-22dbwrap: Convert fetch_int32 to dbwrap_parse_recordVolker Lendecke1-13/+24
Now dbwrap_fetch_int32 is used in smbd/locking/posix.c is used a lot more often than before. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22dbwrap: Add dbwrap_fetch_int32Volker Lendecke2-3/+11
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22dbwrap: Add dbwrap_change_int32_atomicVolker Lendecke2-9/+21
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22dbwrap: dbwrap_hash_size().Rusty Russell7-0/+12
Implemented for ntdb and tdb; falls back to 0 for others. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22dbwrap: dbwrap_name().Rusty Russell7-1/+11
Useful for debug messages: particularly once we start switching between .tdb and .ntdb files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22dbwrap: dbwrap_transaction_start_nonblock().Rusty Russell4-0/+26
Implemented for ntdb and tdb; falls back to the blocking variant for others. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22dbwrap: dbwrap_fetch_locked_timeout().Rusty Russell4-0/+52
Implemented for ntdb and tdb; falls back to the non-timeout variant for others. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22dbwrap: add dbwrap_check() function.Rusty Russell4-0/+31
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22dbwrap: dbwrap_local_open()Rusty Russell4-0/+92
This simply opens a tdb: it will eventually switch depending on the extension. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22dbwrap: remove get_flags().Rusty Russell5-24/+0
The flags returned were TDB-specific: this was only used for detecting the endianness of obsolete databases (the conversion code was put in in 2003, with reference to Samba 2.3). It's easier to remove it than to translate the NTDB flags to TDB flags, and it's a really weird thing to ask for anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19lib/dbwrap: depend directly on tdb, not tdb_compat.Rusty Russell1-1/+1
Simple change, as we get rid of tdb_compat in favour of either ntdb directly or dbwrap. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-15dbwrap: Remove an unnecessary ZERO_STRUCTVolker Lendecke1-1/+0
We assign the only struct member one line down Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15dbwrap: dbwrap_trans_store_uint32->dbwrap_trans_store_uint32_bystringVolker Lendecke2-4/+6
Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Jun 15 14:20:04 CEST 2012 on sn-devel-104
2012-06-15dbwrap: dbwrap_trans_store_int32->dbwrap_trans_store_int32_bystringVolker Lendecke2-4/+6
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: ↵Volker Lendecke2-8/+8
dbwrap_trans_change_int32_atomic->dbwrap_trans_change_int32_atomic_bystring Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: dbwrap_change_int32_atomic->dbwrap_change_int32_atomic_bystringVolker Lendecke2-4/+8
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: ↵Volker Lendecke2-8/+8
dbwrap_trans_change_uint32_atomic->dbwrap_trans_change_uint32_atomic_bystring Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: dbwrap_change_uint32_atomic->dbwrap_change_uint32_atomic_bystringVolker Lendecke2-4/+8
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: dbwrap_store_uint32->dbwrap_store_uint32_bystringVolker Lendecke2-4/+4
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: dbwrap_fetch_uint32->dbwrap_fetch_uint32_bystringVolker Lendecke2-4/+4
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystringVolker Lendecke2-4/+4
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15dbwrap: dbwrap_fetch_int32->dbwrap_fetch_int32_bystringVolker Lendecke2-4/+4
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-12s3: Use talloc_tos() in more places in dbwrap_utilVolker Lendecke1-6/+10
Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Jun 12 15:37:16 CEST 2012 on sn-devel-104
2012-05-31lib/dbwrap: make it possible to delete/store the current record during traverseStefan Metzmacher1-9/+71
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu May 31 02:50:09 CEST 2012 on sn-devel-104
2012-05-31lib/dbwrap: don't alter the record on failure in db_rbt_store()Stefan Metzmacher1-9/+10
metze
2012-05-31lib/dbwrap: fix db_rbt_store and update the per record node pointerStefan Metzmacher1-0/+1
metze
2012-05-31lib/dbwrap: remove unused per db_record pointer in dbwrap_rbtStefan Metzmacher1-10/+9
metze
2012-05-15dbwrap: Fix Coverity ID 242750 Incorrect sizeof expressionVolker Lendecke1-1/+1
Taking the size of "db" is correct, but a bit fishy. Silence Coverity.