summaryrefslogtreecommitdiffstats
path: root/source3/lib/dbwrap_util.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam2011-07-291-569/+0
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
* tdb_compat: Higher level API fixes.Rusty Russell2011-06-201-1/+1
| | | | | | | | | | | | My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell2011-06-201-2/+2
| | | | | | | | | | | 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>
* s3-build Create dbwrap_util subsystemAndrew Bartlett2011-05-311-1/+64
| | | | | | | | This contains the functions from dbwrap that don't require lp_ functions, and can therefore be put into a library (without dependency loops). Andrew Bartlett
* s3: only include tdb headers where needed.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* s3: add function dbwrap_traverseGregor Beck2011-04-041-0/+8
|
* s3: add function dbwrap_trans_traverseGregor Beck2011-04-041-0/+30
|
* Fix up some buildfarm warnings.Jeremy Allison2011-02-091-1/+1
|
* s3-build: use dbwrap.h only where needed.Günther Deschner2010-08-261-0/+1
| | | | Guenther
* s3:fix endianness bug in dbwrap_change_int32_atomic() (bug #6901)Michael Adam2009-11-211-4/+6
| | | | Michael
* s3:fix endianness bug in dbwrap_change_uint32_atomic() (bug #6901)Michael Adam2009-11-211-4/+6
| | | | Michael
* s3:dbwrap: add dbwrap_trans_change_int32_atomic()Michael Adam2009-07-291-0/+17
| | | | | | A transaction wrapper for dbwrap_change_int32_atomic(). Michael
* s3:dbwrap: export logic of dbwrap_change_int32_atomic into an action functionMichael Adam2009-07-291-6/+31
| | | | | | to prepare for adding a transaction wrapper to dbwrap_change_int32_atomic() Michael
* s3:dbwrap: change dbwrap_change_int32_atomic() to take int32_t, not int32Michael Adam2009-07-291-2/+2
| | | | Michael
* s3:dbwrap: add dbwrap_trans_change_uint32_atomic()Michael Adam2009-07-291-0/+17
| | | | | | A transaction wrapper for dbwrap_change_uint32_atomic(). Michael
* s3:dbwrap: export logic of dbwrap_change_uint32_atomic into an action functionMichael Adam2009-07-291-6/+31
| | | | | | to prepare for adding a transaction wrapper to dbwrap_change_uint32_atomic() Michael
* s3:dbwrap: untangle assignment and check in dbwrap_change_int32_atomic()Michael Adam2009-07-291-2/+2
| | | | Michael
* s3:dbwrap: untangle assignemend and check in dbwrap_change_uint32_atomic()Michael Adam2009-07-291-2/+2
| | | | Michael
* s3:dbwrap: don't leak in dbwrap_change_int32_atomic().Michael Adam2009-07-291-2/+3
| | | | Michael
* s3:dbwrap: don't leak in dbwrap_change_uint32_atomic()Michael Adam2009-07-291-2/+3
| | | | Michael
* s3:dbwrap: change dbwrap_change_int32_atomic() to return NTSTATUS not int32.Michael Adam2009-07-291-6/+7
| | | | Michael
* s3:dbwrap: change dbwrap_change_uint32_atomic() to return NTSTATUS not uint32_t.Michael Adam2009-07-291-5/+6
| | | | Michael
* s3:dbwrap: use the transaction wrapper in dbwrap_trans_store().Michael Adam2009-07-211-26/+23
| | | | | | | Now dbwrap_util.c contains only one call to each of transaction_start, transaction_commit and transaction_cancel. Michael
* s3:dbwrap: use the transaction wrapper in dbwrap_trans_delete().Michael Adam2009-07-211-28/+12
| | | | Michael
* s3:dbwrap: fix embarrassing typo :-)Michael Adam2009-07-151-1/+1
| | | | Michael
* s3:dbwrap_util: add my CMichael Adam2009-07-151-0/+1
| | | | Michael
* s3:dbwrap: add dbwrap_fetch_bystring_upper().Michael Adam2009-07-151-0/+17
| | | | | | To fetch a key whose name is stored but not given in upper case. Michael
* s3:dbwrap: add dbwrap_store_bystring_upper().Michael Adam2009-07-151-0/+17
| | | | | | This stores a key under the uppercase version of the given keyname. Michael
* s3:dbwrap: add dbwrap_delete_bystring_upper()Michael Adam2009-07-151-0/+16
| | | | | | To delete a key whose name is not given in but stored in uppercase. Michael
* s3:dbwrap: add a wrapper dbwrap_trans_do()Michael Adam2009-07-151-0/+33
| | | | | | | | | This function wraps the action() callback into a db transaction and the transaction is either committed or cancelled, depending on the return value of the action function. Michael
* s3:dbwrap: fix dbwrap_store_uint32() to match dbwrap_store_int32()Stefan Metzmacher2008-12-291-2/+2
| | | | | | All callers expect 0 an success and -1 on error. metze
* don't leave a dangling transaction on retry errorAndrew Tridgell2008-08-131-2/+4
| | | | (This used to be commit ddf3022595fe8ca378c5f52107f42e296f852685)
* dbwrap: add comment describing behaviour of dbwrap_change_int32_atomic().Michael Adam2008-08-051-0/+7
| | | | | Michael (This used to be commit f8f21c8e3922806230e240cb54205fc2db7a3619)
* secrets: fix replacemend random seed generator (security issue).Michael Adam2008-08-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | This is a regression introduced by the change to dbwrap. The replacement dbwrap_change_int32_atomic() does not correctly mimic the behaviour of tdb_change_int32_atomic(): The intended behaviour is to use *oldval as an initial value when the entry does not yet exist in the db and to return the old value in *oldval. The effect was that: 1. get_rand_seed() always returns sys_getpid() in *new_seed instead of the incremented seed from the secrets.tdb. 2. the seed stored in the tdb is always starting at 0 instead of sys_getpid() + 1 and incremented in subsequent calls. In principle this is a security issue, but i think the danger is low, since this is only used as a fallback when there is no useable /dev/urandom, and this is at most called on startup or via reinit_after_fork. Michael (This used to be commit bfc5d34a196f667276ce1e173821db478d01258b)
* dbwrap: add comment describing behaviour of dbwrap_change_uint32_atomic().Michael Adam2008-08-051-0/+7
| | | | | Michael (This used to be commit 7edfb54c865ddcfd5cdcc8c2184b96aaac2d2ec0)
* idmap_tdb2: fix a race condition in idmap_tdb2_allocate_id().Michael Adam2008-08-051-2/+6
| | | | | | | | | | | | | | | | | The race is a regression introduced by the change to dbwrap. It might have led to two concurrent processes returning the same id. This fix is achieved by changing dbwrap_change_uint32_atomic() to match the original behaviour of tdb_change_uint32_atomic(), which is the following: *oldval is used as initial value when the value does not yet exist and that the old value should be returned in *oldval. dbwrap_change_uint32_atomic() is used (only) in idmap_tdb2.c, to get new ids. Michael (This used to be commit 72bd83fea7572a6202027b200d192c05023aa633)
* dbwrap: fix more "tdb_chainunlock failed" messagesMichael Adam2008-04-071-1/+3
| | | | | | | TALLOC_FREE(rec) before transaction_cancel also in dbwrap_trans_delete(). Michael (This used to be commit 04cd914a1f12691d27ddc67887a757cd813848a7)
* dbwrap: fix a confusing "tdb_chainunlock failed" messageStefan Metzmacher2008-04-011-1/+3
| | | | | | | Unlock before we cancel the transaction... metze (This used to be commit d70a8e9c413a7d3993e0d11db5ae9cbc7fdb12c7)
* dbwrap: add dbwrap_trans_store_uint32()Stefan Metzmacher2008-04-011-0/+13
| | | | | metze (This used to be commit 9e739b4c99a9aba5c5bb58f3b6a9fb949e24c581)
* Add dbwrap_trans_*_bystringVolker Lendecke2008-04-011-0/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit 2cf2684a11027431e6a93992413a5a5a697a4ba0)
* Convert dbwrap_trans_delete to NTSTATUSVolker Lendecke2008-04-011-4/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit dead193f46c2b19955ab3e5ac5ba343694f4858a)
* Convert dbwrap_trans_store to NTSTATUSVolker Lendecke2008-04-011-12/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit 5f4de856af1abe63b13059bbe1615cb5877770d0)
* Add dbwrap_[fetch|store]_uint32Volker Lendecke2008-04-011-0/+39
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit f1dd915ce802645166e0c8fc79d18d5ad41cfe7a)
* dbwrap: fix dbwrap_trans_[delete|store]() to stop when transaction_start() ↵Michael Adam2008-03-271-0/+2
| | | | | | | failed. Michael (This used to be commit ab0aaed907fef233998ff0841d30eabef3263ee8)
* dbwrap: add dbwrap_trans_store_int32()Stefan Metzmacher2008-03-271-0/+15
| | | | | | | metze Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit f05e889bc05a816aef5b9ce4f22267e977dade01)
* Add dbwrap_trans_store and dbwrap_trans_deleteVolker Lendecke2008-03-101-0/+79
| | | | (This used to be commit e66e502bee65fe44944d325ebeeaa3bf56169eb8)
* add dbwrap_change_int32_atomicVolker Lendecke2008-03-101-0/+28
| | | | (This used to be commit 4ee21a98bc3d1c41a6d8868e98118c58372b2d1a)
* Merge CTDB-related fixes from samba-ctdb 3.0 branch ↵Alexander Bokovoy2008-01-161-0/+90
(http://samba.org/~tridge/3_0-ctdb) Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbbb2d081fc23908bafcad04650bfacea)