1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

39 Commits

Author SHA1 Message Date
Andrew Tridgell
fb3daf3653 fixed a potential locking deadlock in tdb
(This used to be commit 03453e2ae5)
2000-11-27 06:35:12 +00:00
Andrew Tridgell
2d33e87424 got rid of tdb_writelock() and instead lock a chain. tdb_writelock()
is conceptually flawed
(This used to be commit 6e4a358552)
2000-10-10 06:45:09 +00:00
Jeremy Allison
bbd7f7bf0f Herb's fixes for profiling & compiler warnings.
Jeremy.
(This used to be commit 7914e9351a)
2000-10-05 18:50:18 +00:00
Jeremy Allison
e26d09685c Added debug so if zero length messages get sent we successfully remove
them (this can happen if smbd processes are shut down at the wrong time).
Jeremy.
(This used to be commit c1de97f96b)
2000-10-02 19:28:26 +00:00
Andrew Tridgell
28be43dc81 - use read locks when possible
- don't use as many locks on a store
(This used to be commit ee12b10d21)
2000-06-15 15:29:39 +00:00
Andrew Tridgell
afab0b2ca0 an imcompatible tdb format change (sorry!)
this will give us a much nicer migration path for the proposed
semaphore code
(This used to be commit 491ab24189)
2000-05-12 02:57:24 +00:00
Andrew Tridgell
b3d4c0c9f5 when creating the database zero the reserved space
(This used to be commit a5ca60f62b)
2000-05-10 12:58:20 +00:00
Andrew Tridgell
6cf96ff431 - add some reserved space to every tdb, this will be
used for semaphores and future expansion
- update tdb version number to 2
(This used to be commit 5e04885b86)
2000-05-10 06:02:37 +00:00
Herb Lewis
21b85b2dba Use a prime for default tdb hash size - this makes a difference !
Jeremy.
(This used to be commit 400906e642)
2000-05-10 01:32:51 +00:00
Andrew Tridgell
3cc5f0dd15 fixed typo
(This used to be commit 5341597de6)
2000-05-01 00:48:41 +00:00
Andrew Tridgell
99fbf5c4bc added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.
TDB_INTERNAL replaces the old method of passing a null filename
(This used to be commit 8ec815920d)
2000-05-01 00:41:47 +00:00
Andrew Tridgell
700f72453e - 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
(This used to be commit 03e9cea004)
2000-04-30 11:04:28 +00:00
Andrew Tridgell
c0e1c65053 put tdb utility functions in a separate file
(This used to be commit 77009422a0)
2000-04-29 04:05:38 +00:00
Jeremy Allison
ea9b2ed326 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.
(This used to be commit d69e4c6a48)
2000-04-28 02:06:19 +00:00
Andrew Tridgell
dce954d275 added TDB_MODIFY flag - patch from from luke
(This used to be commit 90b574296e)
2000-04-25 01:17:45 +00:00
Andrew Tridgell
e4f8301edf use an size_t not a ssize_t when checking for out of bounds errors
(This used to be commit 044af3cf97)
2000-04-24 14:36:25 +00:00
Andrew Tridgell
4367a3edfb added tdb_get_int() and tdb_store_int()
they are very useful for database versioning
(This used to be commit cc65914cdc)
2000-04-16 06:23:11 +00:00
Tim Potter
9fd3d3963e Check for null tdb context in tdb_exists()
(This used to be commit bbacdb834f)
2000-03-01 01:10:25 +00:00
Tim Potter
676df39cc7 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.
(This used to be commit b345c0a105)
2000-02-28 00:25:37 +00:00
Tim Potter
590d92c77a More checks for passing NULL tdb contexts to tdb functions.
(This used to be commit 7faa70d254)
2000-02-16 22:57:57 +00:00
Tim Potter
13ac8fd847 Return "Invalid tdb context" instead of crashing when tdb_error called
with NULL tdb context.
(This used to be commit ba9f24c096)
2000-02-15 06:13:38 +00:00
Luke Leighton
bbe275e95b 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.
(This used to be commit 49d7f0afbc)
2000-02-04 04:59:31 +00:00
Jeremy Allison
014bdf941f tdb record read error return check fix from Dave Airlie <airlied@samba.org>.
Jeremy.
(This used to be commit 82c99dc8d8)
2000-01-24 23:12:02 +00:00
Andrew Tridgell
1359195c50 casts and defines to make solaris happy
(This used to be commit 77cf152c02)
2000-01-14 08:33:20 +00:00
Andrew Tridgell
5b7f0c733c improved the error checking
(This used to be commit 2a152998a1)
2000-01-08 08:16:02 +00:00
Andrew Tridgell
102e44e446 don't use strcpy
(This used to be commit bf9b1328c5)
2000-01-07 06:14:43 +00:00
Andrew Tridgell
e91ceacb6c - patch from Rusty to neaten up the code a bit
- fixed a race condition in tdb_open()
(This used to be commit 21d4882f64)
2000-01-07 03:01:55 +00:00
Andrew Tridgell
1f438ffb7e lower the default hash size a bit
(This used to be commit 51ed6e8cec)
2000-01-05 01:50:06 +00:00
Andrew Tridgell
c0ad729de6 drop the alignment to 4 bytes - this makes tdb more space efficient
and doesn't seem to affect performance
(This used to be commit 1fb293732e)
2000-01-03 00:52:14 +00:00
Andrew Tridgell
8b1229c3fe updated docs
(This used to be commit c199ec9543)
2000-01-02 23:03:32 +00:00
Andrew Tridgell
9a781a8c6d - 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
(This used to be commit 00e9da3ca5)
2000-01-02 23:00:27 +00:00
Andrew Tridgell
7a0bc53221 - optimise tdb_store() a little
- prevent a free of an unallocated pointer
(This used to be commit b35b5c6388)
2000-01-02 01:40:35 +00:00
Andrew Tridgell
d6a5878c76 fixed more locking bugs - all seems OK now
(This used to be commit 584537961b)
1999-12-24 08:45:02 +00:00
Andrew Tridgell
c23a552c58 fixed locking code
(This used to be commit 1f5dc92404)
1999-12-23 01:14:20 +00:00
Andrew Tridgell
ecfee3f170 fixed a bug in the handling of tdb version number upgrade
(This used to be commit ed7541668e)
1999-12-22 01:31:09 +00:00
Andrew Tridgell
30cecd8d2c added some paranoia code
(This used to be commit c547ffa9e9)
1999-12-22 01:22:14 +00:00
Andrew Tridgell
4e1291a83f 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
(This used to be commit e48c2d9937)
1999-12-21 09:25:59 +00:00
Andrew Tridgell
69d24d869b 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!
(This used to be commit 4951755413)
1999-12-21 04:54:30 +00:00
Andrew Tridgell
c2c42b8694 first pass at the database code for Samba. This also includes a test
suite and a very simple tool for manuipulating the databases.

the main code is in tdb/tdb.c and includes both mmap and file based
IO. All databases auto-expand and allow multiple simultaneous writers.

the next step is using this new capability in lots of places in Samba
where we have existing ad-hoc databases
(This used to be commit c89d29cc5e)
1999-12-21 03:04:37 +00:00