1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

51 Commits

Author SHA1 Message Date
Tim Potter
a423c7c5f2 While we're all making incompatible tdb changes, I changed the implementation
of tdb_{store,get}_int() to store the length of the string key + 1 so the
stored key contains the trailing NULL character.  This allows normal
string library routines to manipulate keys.

Also renamed tdb_get_int() to tdb_fetch_int() to keep the set of verbs
consistent.
-
Andrew Tridgell
e20ef3c082 use gcc not insure by default in tdb build -
Andrew Tridgell
491ab24189 an imcompatible tdb format change (sorry!)
this will give us a much nicer migration path for the proposed
semaphore code
-
Andrew Tridgell
a5ca60f62b when creating the database zero the reserved space -
Andrew Tridgell
5e04885b86 - add some reserved space to every tdb, this will be
used for semaphores and future expansion
- update tdb version number to 2
-
Herb Lewis
400906e642 Use a prime for default tdb hash size - this makes a difference !
Jeremy.
-
Tim Potter
d58146321b Added tdb_store_by_string() and tdb_fetch_by_string() functions to store
data with null terminated string keys.
-
Andrew Tridgell
5341597de6 fixed typo -
Andrew Tridgell
8ec815920d added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.
TDB_INTERNAL replaces the old method of passing a null filename
-
Andrew Tridgell
03e9cea004 - removed all our old wildcard matching code and replaced it with a
call to ms_fnmatch(). This also removes all the Win9X semantics stuff
and a bunch of other associated cruft.

- moved the stat cache code into statcache.c

- fixed the uint16 alignment requirements of ascii_to_unistr() and
  unistr_to_ascii()

- trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as
  unicode always (at least thats what NT4 does)

- fixed some errors in the in-memory tdb code. Still ugly, but doesn't
  crash as much
-
Andrew Tridgell
77009422a0 put tdb utility functions in a separate file -
Jeremy Allison
d69e4c6a48 Added tdb_get/set_int_byblob, which takes a size_t len and then implemented
the tdb_get/set_int string functions in terms of them. Will be useful in storing
POSIX pending close records (which are ints but indexed by dev/inode pairs).
Jeremy.
-
Andrew Tridgell
90b574296e added TDB_MODIFY flag - patch from from luke -
Andrew Tridgell
41af3232db dump in a binary format -
Andrew Tridgell
044af3cf97 use an size_t not a ssize_t when checking for out of bounds errors -
Jeremy Allison
204ca1195c locking/locking.c: Fixed placeholder code for POSIX locking.
printing/printing.c: Cast tdb_delete to (tdb_traverse_func) to stop warning.
                     tmpfile gives mirror warning.
smbd/groupname.c: Remember to file_lines_free() on exit.
tdb/tdb.h: Add tdb_traverse_func typedef.
Jeremy
-
Andrew Tridgell
cc65914cdc added tdb_get_int() and tdb_store_int()
they are very useful for database versioning
-
Tim Potter
829e645f62 Added standard shell command thing using '!' as first character. -
Tim Potter
bbacdb834f Check for null tdb context in tdb_exists() -
Tim Potter
60ae73c257 Makefile for tdb directory. -
Tim Potter
110ec9923b Oops - put back filename argument to tdb_open(). -
Tim Potter
d64456b588 Modifications to tdb_traverse() arguments to remove compile warnings. -
Tim Potter
b345c0a105 Allow tdb databases to be created "in memory" without having a file
associated with them.  tdb can then be used as a hash table data
structure.
-
Tim Potter
2892f6e534 Added tdbtool to .cvsignore list. -
Tim Potter
8cbc7dfa03 Updated docs for tdb_traverse. -
Tim Potter
7faa70d254 More checks for passing NULL tdb contexts to tdb functions. -
Tim Potter
2d3e2f8877 tdb_traverse() now takes three arguments. -
Tim Potter
ba9f24c096 Return "Invalid tdb context" instead of crashing when tdb_error called
with NULL tdb context.
-
Luke Leighton
49d7f0afbc 1) added void* state argument to tdb_traverse. guess what! there were
two places i found where it was appropriate to _use_ that third argument,
in locking.c and brlock.c!  there was a static traverse_function and
i removed the static variable, typecast it to a void*, passed it to
tdb_traverse and re-cast it back to the traverse_function inside the
tdb_traverse function.  this makes the use of tdb_traverse() reentrant,
which is never going to happen, i know, i just don't like to see
statics lying about when there's no need for them.

as i had to do in samba-tng, all uses of tdb_traverse modified to take
the new void* state argument.

2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient.
i don't know how the other samba team members would react if i deleted
rpcclient from cvs main.  damn, that code's so old, it's unreal.
20 rpcclient commands, instead of about 70 in SAMBA_TNG.
-
Jeremy Allison
82c99dc8d8 tdb record read error return check fix from Dave Airlie <airlied@samba.org>.
Jeremy.
-
Andrew Tridgell
77cf152c02 casts and defines to make solaris happy -
Andrew Tridgell
2a152998a1 improved the error checking -
Andrew Tridgell
bf9b1328c5 don't use strcpy -
Andrew Tridgell
2dbe70da8d don't require readline -
Andrew Tridgell
21d4882f64 - patch from Rusty to neaten up the code a bit
- fixed a race condition in tdb_open()
-
Andrew Tridgell
51ed6e8cec lower the default hash size a bit -
Andrew Tridgell
8767334d8a ignore a few files -
Andrew Tridgell
1fb293732e drop the alignment to 4 bytes - this makes tdb more space efficient
and doesn't seem to affect performance
-
Andrew Tridgell
c199ec9543 updated docs -
Andrew Tridgell
00e9da3ca5 - added tdb_flags option to tdb_open()
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the
  first attached process. Useful for non-persistent databases like our
  locking area (this will also make upgrades to new database layouts easier)
- use lock_path() in a couple of places
- leave connections database open while smbd running
- cleaned up some tdb code a little, using macros for constants
-
Andrew Tridgell
88a146ab04 show test result in ops/sec -
Andrew Tridgell
b35b5c6388 - optimise tdb_store() a little
- prevent a free of an unallocated pointer
-
Andrew Tridgell
3b3fdd8661 a useful locking tester - it uses lots of simultaneous writers -
Andrew Tridgell
584537961b fixed more locking bugs - all seems OK now -
Andrew Tridgell
1f5dc92404 fixed locking code -
Andrew Tridgell
ed7541668e fixed a bug in the handling of tdb version number upgrade -
Andrew Tridgell
c547ffa9e9 added some paranoia code -
Andrew Tridgell
efb4fbcca8 expanded the tdb documentation -
Andrew Tridgell
e48c2d9937 converted all our existing shared memory code to use a tdb database
instead of either sysv or mmap shared memory or lock files.

this means we can now completely remove
	locking_shm.c
	locking_slow.c
	shmem.c
	shmem_sysv.c
and lots of other things also got simpler

locking.c got a bit larger, but is much better compartmentalised now
-
Andrew Tridgell
4951755413 first cut at using the tdb code for the connections structure, the
SWAT status page and smbstatus. It made the code _much_ simpler, I
wish we'd done a database module a long time ago!
-