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

70 Commits

Author SHA1 Message Date
Jeremy Allison
c64cd552c4 Fixed a couple of nasty bugs only easily seen with no mmap. Firstly,
map_ptr not neccessarily set to NULL if no mmap, secondly, iterating
through a tdb was using SETLK, instead of SETLKW - would almost never
fail with mmap as the time holding the lock was so short, but was
easily seen with read/write. One finaly bug needs tracking down w.r.t.
traversal......
Jeremy.
(This used to be commit 313c2e8652)
2001-09-18 21:17:58 +00:00
Jeremy Allison
3538c8bea9 Added mmap fix to pass lock test from HP.
Ok - now we're no longer trying to reach a silly 1k loc target,
change the formatting to be *readable* - eg.
change if (x) y else z to be :
if (x)
    y
else
    z

and other compact sillyness. Oh look - when I did this I found
some areas where we *WEREN'T CHECKING SYSTEM CALL ERROR RETURNS !!!!*
CompSci 101 guys....... :-).
Jeremy.
(This used to be commit 38d2e6983a)
2001-08-02 20:17:40 +00:00
Jeremy Allison
953973c888 Fix for rare tdb pattern store failure. Found & fixed by Rusty.
Jeremy.
(This used to be commit aaa56bb3a3)
2001-07-31 00:03:24 +00:00
Jeremy Allison
ac26e23139 Always check fstat for error.
Jeremy.
(This used to be commit 34951876a1)
2001-07-25 18:59:56 +00:00
Jeremy Allison
3a40f80a94 Fix for enumerating large numbers of users.
Jeremy.
(This used to be commit c8c138c1fb)
2001-07-05 22:36:25 +00:00
Jeremy Allison
460c906190 Ok - I misspoke.... mmap returns MAP_FAILED, not neccessarily -1 :-).
Jeremy.
(This used to be commit 2d1c6d1f6b)
2001-06-21 19:56:25 +00:00
Jeremy Allison
99c506325f When mmap fails it returns -1 *NOT NULL*.
This got regressed somehow.....
Jeremy.
(This used to be commit b77c8b536d)
2001-06-21 19:50:21 +00:00
Jeremy Allison
f5197e0230 Fixed potential free of NULL found by SGI speedshop.
Jeremy.
(This used to be commit fc7830eec8)
2001-06-11 20:56:18 +00:00
Andrew Tridgell
9848c067c0 - fixed an off-by-1 bug in the delayed deletion code that I believe
was the initial cause of the connections database becoming corrupt.
  Note that this bug only happens when doing deletions within a
  traversal, which is why it has only showed up now
- added delete within traversal testing to tdbtorture
- added a lot more logging to tdb
(This used to be commit 6e1277df9d)
2001-05-30 05:40:52 +00:00
Andrew Tridgell
964d7a6625 added a tdb_open_log() function that opens a tdb and enables logging
of messages from the tdb code into the Samba DEBUG() system
just call tdb_open_log() instead of tdb_open() to enable this on
any tdb
(This used to be commit 3ab770484c)
2001-05-30 03:42:44 +00:00
Andrew Tridgell
40518cf9b4 more portable TDB_LOG macro
(This used to be commit ba106b9b07)
2001-05-29 15:01:23 +00:00
Andrew Tridgell
c0561ff58e try to make the tailer code much more robust. When a record
can't be merged don't fail the operation, instead just add
it to the free list anyway

added logging to tdb
(This used to be commit dda086fdf9)
2001-05-28 13:29:06 +00:00
Andrew Tridgell
e863446e79 make sure that when a tdb expands we fill the expanded area, otherwise ENOSPC could be very bad
(This used to be commit b94cfb6843)
2001-05-15 14:53:06 +00:00
Jeremy Allison
363e378dee Implemented max connections in a similar way to 2.0.x (scan of connection db).
This needs testing !
Tidied up tabs in tdb.c.
Jeremy.
(This used to be commit 0852465053)
2001-05-14 06:15:46 +00:00
Andrew Tridgell
cd2643f8be clearer tdb_mmap code
(This used to be commit ce6598c465)
2001-05-06 02:05:00 +00:00
Andrew Tridgell
906a512e0b merge from 2.2
(This used to be commit 13bf966cb8)
2001-05-06 01:28:17 +00:00
Jeremy Allison
887d796a28 Fix problem with OpenBSD mmap and write not being coherent.
Jeremy.
(This used to be commit 4c6a8273c6)
2001-05-04 22:23:37 +00:00
Jeremy Allison
a8410f20c1 Fix for True64 treating readonly as a reserved word !
Jeremy.
(This used to be commit d6889b1954)
2001-04-14 00:41:15 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
David O'Neill
2506c61ab3 Changes from APPLIANCE_HEAD:
source/include/proto.h
        - make proto

    source/printing/nt_printing.c
    source/rpc_server/srv_spoolss_nt.c
        - Fix for the overwriting of printerdata entries when WinNT and
          Win2k are modifying printer parameters on PCL printers. Turns out
          that Win2k creates a printer with a NULL devmode entry and then
          expects to set it on *OPEN* (yes this is insane). So we cannot
          return a "default" devmode for a printer - and we must allow an
          open to set it.

    source/tdb/tdb.c
        - Show freelist in an easier format. Show total free.
        - When storing a new record, allocate memory for the key + data
          before the tdb_allocate() as if the malloc fails a (sparse) hole
          is left in the tdb.

    source/tdb/tdbtool.c
        - Show freelist in an easier format. Show total free.

    source/tdb/Makefile
        - cleaned up Makefile dependancies

    source/smbd/lanman.c
        -  Fix for Win9x corrupting it's own parameter string.

    source/printing/printfsp.c
    source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
    source/smbd/close.c
        - Added normal close parameter into print_fsp_end() which treats an
          abnormal close as error condition and deletes the spool file.
(This used to be commit 025f7a092a)
2001-01-29 21:34:08 +00:00
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
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
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