1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-01 21:18:10 +03:00
Commit Graph

79 Commits

Author SHA1 Message Date
Tim Potter
73ba07b362 Set the tdb->map_ptr to NULL if mmap() returns -1.
(This used to be commit cef7f58ac5)
2001-01-16 18:33:05 +00:00
Christopher R. Hertel
8f5d55eb36 The line was:
struct tdb_traverse_lock tl = { tdb->travlocks.next, 0, 0 };

The IRIX compiler complained that the first initialization value was not a
constant and errored out.  Here's what it looks like now:

        struct tdb_traverse_lock tl = { NULL, 0, 0 };
        int ret, count = 0;

        /* This was in the initializaton, above, but the IRIX compiler
         * did not like it.  crh
         */
        tl.next = tdb->travlocks.next;

That worked.

Chris -)-----
(This used to be commit e651d1d642)
2000-12-30 23:17:30 +00:00
Jeremy Allison
99c2693c62 Added lock backouts on fail.
When chaining together long lines of bloody "if" statements, which should
logically be separated, and one of them allocates memory, remember to
*free* it *WHETHER OR NOT THE IF STATEMENTS SUCCEEDED* !!!!
Yes I do consider this a bug in the coding style of Tridge, Rusty, Tim et al. :-).
I'm just pissed 'cos this took 4 hours to track down even with an insure error report
stating me in the face and also Ben Woodward looking over the code with me :-).
Jeremy.
(This used to be commit 506b5e34c3)
2000-12-15 21:29:06 +00:00
Jeremy Allison
0835c7091c Two tdb bugfixes. First one - ensure that traverse lock is moved before deleting
dead records, else the record is just marked for deletion, not actually deleted.
Second, ensure allocated record is marked as "in use" before free list lock is
released, else other processes in the freelist merge code may try and merge it.
Jeremy.
(This used to be commit dd959fa325)
2000-12-13 06:33:53 +00:00
Jeremy Allison
9e9961d2db Added Tim's fix for read-only crashes.
Jeremy.
(This used to be commit cfc62fecdf)
2000-12-11 06:10:32 +00:00
Jeremy Allison
0d658c35eb Fixed bug with tdb_next_lock failing when reaching then end of a hashchain
and the next hashchain is empty.
Jeremy
(This used to be commit f3b5e2a172)
2000-12-07 17:46:11 +00:00
Tim Potter
6e9eb6a316 tdb_chainunlock() no longer returns a value.
(This used to be commit 2c9704c3db)
2000-12-06 02:53:36 +00:00
Jeremy Allison
7e4c4721b4 Changed to sourceforge tdb code. This includes spinlocks (so we now have
a --with-spinlocks option to configure, this does mean the on-disk tdb
format has changed, so 2.2alphaX sites will need to re-create their
tdb's. The upside is no more tdb fragmentation and a +5% on netbench.
Swings and roundabouts....
Jeremy.
(This used to be commit 9dea7b7c25)
2000-12-06 00:05:15 +00:00
Jeremy Allison
1cd8538b7a Fixed one tdb_read -> rec_free_read call.
Jeremy.
(This used to be commit c9884e16fc)
2000-12-05 03:44:30 +00:00
Jeremy Allison
1218b41474 Added sorted freelist neighbour merge code to stop tdb fragmentation.
This needs TESTING !!! (It passes tdbtest of course :-).
Jeremy.
(This used to be commit 7ae54a93e7)
2000-12-05 03:12:57 +00:00
Jeremy Allison
040de369b2 Added print_freelist command.
Jeremy.
(This used to be commit ee89ca9e68)
2000-12-02 01:04:11 +00:00
Andrew Tridgell
e23067ad65 change the split threahold for the free list to prevent freelist
fragmentation
(This used to be commit b64e1ae693)
2000-12-02 00:53:03 +00:00
Andrew Tridgell
fb3daf3653 fixed a potential locking deadlock in tdb
(This used to be commit 03453e2ae5)
2000-11-27 06:35:12 +00:00
Jeremy Allison
6cc6a4f3f3 rpc_parse/parse_spoolss.c: Updated comment for old version of W2K.
tdb/tdbutil.c: With varargs uint16 is cast to (int).
Jeremy.
(This used to be commit 98764c5df9)
2000-11-10 21:24:09 +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
Andrew Tridgell
2a9ce69f3b added tdb_lock_bystring() and tdb_unlock_bystring()
(This used to be commit ca443210c8)
2000-10-10 06:43:26 +00:00
Jeremy Allison
a6f31d6877 Fixes from Damian at Cisco to tidy up some tdbtool issues.
Jeremy.
(This used to be commit 623bfa6c93)
2000-10-05 22:19:34 +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
Jeremy Allison
49fcb300de Added John Reilly's enumports/addprinter/delprinter scripting code plus the
fix for the Win9x printer drivers.
Changed command names to add "command" string on the end for some consistancy
with the other scripting commands.
Added '%P' option to tdbpack/unpack to store long comment string.
Made port name be "Samba Printer Port" if no enum port script given.
Fixed prs_uint32_pre code to cope with null args.
Jeremy.
(This used to be commit 902ada6379)
2000-07-31 20:41:51 +00:00
Andrew Tridgell
fac26f073b support both read and write locks inside the tdb
(This used to be commit d0a1f96e0f)
2000-06-15 15:30:37 +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
9857703a53 use the right MMAP flag
(This used to be commit a2f5977ac3)
2000-06-15 15:28:56 +00:00
Jeremy Allison
6d38ba721c Moved tdb functions that access parse structs into parse_prs.c
to prevent builkd breaking.
Jeremy.
(This used to be commit 6c7adeab0f)
2000-06-08 01:16:42 +00:00
Jeremy Allison
0164047afb Fixing get/set of security descriptors.
Removed ugly hack for NT printing.
Fixed up tdb parse stuff memory leaks.
Jeremy.
(This used to be commit 8ef41f31c5)
2000-06-07 01:49:23 +00:00
Andrew Tridgell
0090b4ee11 added some debug code to track down pack/unpack problems
(This used to be commit ac9cdab33c)
2000-06-04 02:29:45 +00:00
Andrew Tridgell
5f7c40f6d0 getting and setting security descriptors on printers now works
this needed some fixes in tdb_unpack(). Tim, you'll need to update
(This used to be commit 9422719ab4)
2000-05-27 09:53:11 +00:00
Andrew Tridgell
9eee36f61d added tdb_pack() and tdb_unpack()
(This used to be commit 6c15495b30)
2000-05-24 06:36:58 +00:00
Tim Potter
4cdc54ba24 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.
(This used to be commit a423c7c5f2)
2000-05-12 06:27:35 +00:00
Andrew Tridgell
dd8c8b0c35 use gcc not insure by default in tdb build
(This used to be commit e20ef3c082)
2000-05-12 05:08:47 +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
Tim Potter
d4cd46557b Added tdb_store_by_string() and tdb_fetch_by_string() functions to store
data with null terminated string keys.
(This used to be commit d58146321b)
2000-05-09 06:22:12 +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
b76e942639 dump in a binary format
(This used to be commit 41af3232db)
2000-04-24 14:36:44 +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
Jeremy Allison
4217c939ec 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
(This used to be commit 204ca1195c)
2000-04-18 20:41:04 +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
3848759a5e Added standard shell command thing using '!' as first character.
(This used to be commit 829e645f62)
2000-03-13 01:35:09 +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
1f6f8c2241 Makefile for tdb directory.
(This used to be commit 60ae73c257)
2000-02-28 00:51:53 +00:00
Tim Potter
0a77ae3f14 Oops - put back filename argument to tdb_open().
(This used to be commit 110ec9923b)
2000-02-28 00:38:45 +00:00
Tim Potter
79691801f4 Modifications to tdb_traverse() arguments to remove compile warnings.
(This used to be commit d64456b588)
2000-02-28 00:37:13 +00:00