summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdb.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed crash bug when calling tdb_unlockkeys() with no locked keys.Tim Potter2003-03-131-0/+2
| | | | woot!
* Note about using Valgrind with tdbs.Martin Pool2003-03-111-0/+21
|
* When opening an existing DB, don't require the hash_size specified toMartin Pool2003-03-111-2/+1
| | | | | | | | the open call to be the same as that of the existing tdb. The specified hash_size is only used if the tdb needs to be (re)created. With this patch in place, tdbtool can open the printing tdbs, which are created with a hash_size of 5000. Before it would fail with EIO.
* Ensure tdb error code is set for corrupt and i/o errors before callingJeremy Allison2003-02-201-0/+19
| | | | | the log function. This allows the log function to take action. Jeremy.
* DocMartin Pool2003-02-141-1/+5
|
* Ensure we overwrite a tdb if the hash size changes.Jeremy Allison2003-02-041-1/+2
| | | | Jeremy.
* Added tdb_append() call. Efficiently adds to an entry. Used by new messagingJeremy Allison2003-01-111-12/+137
| | | | | code. Also added torture tests for it. Jeremy.
* Add chainlock_read functions to get a read lock. Used in *massively*Jeremy Allison2002-11-091-1/+11
| | | | | contended tdb's (and I've got one :-). Jeremy.
* Merge of scalable printing code fix... Needs testing.Jeremy Allison2002-11-071-1/+2
| | | | | | | Also tidied up some of Richard's code (I don't think he uses the compiler flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like I do :-) :-). Jeremy.
* Add a timeout to tdb_lock_bystring(). Ensure we never have more thanJeremy Allison2002-10-041-0/+4
| | | | | MAX_PRINT_JOBS in a queue. Jeremy.
* Make explicit the difference between a tdb key with no data attached, andJeremy Allison2002-09-261-2/+11
| | | | | a non existent entry. Stop a malloc(0) being called in the first case. Jeremy.
* Never, *ever* hold a mutex lock in the message database where there mayJeremy Allison2002-09-171-0/+15
| | | | | | | be traversals being attempted. Yes, this was from bitter experience (and an out of control server :-). Also allow callers to break out of a tdb_chainlock with sigalarm if desired. Jeremy.
* ensure that we unlock in case we hit a tdb errorAndrew Tridgell2002-08-301-0/+3
|
* don't report the faiilure of non-blocking locks. They are supposed toAndrew Tridgell2002-07-151-1/+1
| | | | fail sometimes, thats why they are non-blocking :)
* *Experimental* new large-scaling printer code. Splits printing.tdb intoJeremy Allison2002-07-111-1/+2
| | | | | | | a separate tdb per printer, but only keeps (currently one) tdb open at a time (although this is easily changed by changing a #define). Needs scalability testing with large numbers of printers now.... Jeremy.
* auto-recover from the fairly common case of a non-clean tdb shutdownAndrew Tridgell2002-05-221-0/+10
| | | | | while deleting a record. This leaves us with a non-free record on the free list.
* Merge Herb's idmap endian fix.Jeremy Allison2002-04-271-0/+6
| | | | Jeremy.
* We cannot set errno=0 in any of the wrapper calls as this breaks UNIX errorJeremy Allison2002-04-191-1/+0
| | | | | returns to the client. Jeremy.
* First cut at fix for the EINTR problem... More needs to be done I think.Jeremy Allison2002-04-191-1/+7
| | | | Jeremy.
* Added Shirish's client side caching policy change.Jeremy Allison2002-04-101-1/+2
| | | | Jeremy.
* better check of called function's returnSimo Sorce2002-04-071-57/+125
| | | | tdbtorture say it's ok
* Various comment fixes from Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>Andrew Bartlett2002-03-011-1/+1
|
* Memory leak on error condition fixed by Kian Win <codegrunt@rubbercookie.com>.Jeremy Allison2002-02-271-0/+1
| | | | Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Raise log level of warning produced when the open() of the tdb fails.Tim Potter2002-01-221-1/+1
| | | | Sometimes an open error is OK.
* Move SAFE_FREE into tdb.c to stop exporting it into tdb.h namespace.Jeremy Allison2002-01-091-0/+5
| | | | Jeremy.
* debug statement fixups.Jeremy Allison2002-01-021-31/+21
| | | | | Merge SAFE_FREE fix in tdb from 2.2, and IRIX fix. Jeremy.
* more irix -64 portability fixesAndrew Tridgell2001-12-311-1/+2
|
* Must check against -1 for fcntl error check.Jeremy Allison2001-12-131-4/+4
| | | | Jeremy
* Fix up warnings. Make tdb_openXX() names const.Jeremy Allison2001-12-111-2/+2
| | | | Jeremy.
* Doc.Martin Pool2001-12-101-1/+3
|
* Allow for internal databases which may have no name.Martin Pool2001-12-101-5/+5
|
* Log more error messages.Martin Pool2001-12-101-0/+1
|
* Log more error messages.Martin Pool2001-12-101-2/+12
|
* Allocate tdb name up front in case log functions want to use it.Martin Pool2001-12-101-6/+5
|
* tdb_open_ex: More cleanups: just dynamically allocate the TDB_CONTEXTMartin Pool2001-12-101-14/+27
| | | | up front, rather than working on the stack and then copying across.
* Refactor code to check whether already open into its own function.Martin Pool2001-12-101-8/+21
|
* tdb_open_ex should always "goto fail" in case of error, rather thanMartin Pool2001-12-101-1/+2
| | | | | just returning. I don't think this would leak at the moment, but it's an accident waiting to happen.
* Doc.Martin Pool2001-12-101-0/+4
|
* tdb_open_ex: Continue previous refactoring so that we consistentlyMartin Pool2001-12-101-12/+12
| | | | just say "tdb" not "&tdb".
* tdb_open_ex: Refactor to use a pointer to tdb, rather than an autoMartin Pool2001-12-101-57/+58
| | | | tdb, to be consistent with the rest of the code.
* Put back changes to set errno, which seem to do no harm.Martin Pool2001-12-041-12/+42
|
* undoMartin Pool2001-12-041-156/+69
|
* Implement suggestion from tridge to leave the old tdb_open interfaceMartin Pool2001-12-041-2/+9
| | | | | as it was, and add tdb_open_ex() which takes a log callback. I guess this makes more sense since it's a public interface.
* Better error handling:Martin Pool2001-12-041-66/+124
| | | | | | | | | | | | | - tdb_open api changed so that you now pass an error handling callback when opening the file, so that errors detected during opening have somewhere to go. (All calls from the body of Samba to this function go through a wrapper in tdbutil, which has been updated.) - Clean up logic for deciding how to open tdb. Emit log messages if something goes wrong (e.g. bad magic.) - tdbtool now logs errors to stderr.
* Set errno in tdb_open in cases where we detect an error in opening theMartin Pool2001-12-041-11/+33
| | | | | | | | database, but no underlying system call sets errno. The particular case I had was a mangled .tdb, but there are others. For this one, set EIO. It's a shame Unix messages aren't more detailed -- "bad data format" would be better.
* Removed #ifdef TDB_DEBUG around tdb_dump_all() and tdb_printfreelist()Tim Potter2001-11-091-5/+3
| | | | so that tdbtool can be compiled without having to make clean.
* Don't core dump when using spinlocks on a read-only tdb. Unfortunately thisJeremy Allison2001-10-161-4/+16
| | | | | | | | | | means that a read-write opener and a read-only opener are using different locking mechanisms - this needs to be addressed, but it's hard as the read-write opener using the spinlocks is usually first, so there's no way to force them to change down to the fcntl method. Read only access is less important anyway and can never corrupt the tdb anyway, so errors in read-only record reads are more tolerable. Jeremy
* Fix for tdb_oob() on TDB_INTERNAL databases.Jeremy Allison2001-10-121-2/+7
| | | | Jeremy.
* Ensure accessing NT member servers works with a Samba PDC. Don'tJeremy Allison2001-10-031-1/+2
| | | | | | change these timestamp settings without good reason. Remove CLEAR_IF_FIRST flag is tdb is read-only. Jeremy.