1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-07 01:58:28 +03:00

237 Commits

Author SHA1 Message Date
Tim Potter
d05c3cf0f4 Getting medieval with compiler warnings as Jeremy puts it. -
Jeremy Allison
d6889b1954 Fix for True64 treating readonly as a reserved word !
Jeremy.
-
Jeremy Allison
fc76681812 Merge of Andrew's changes in 2.2.
Jeremy.
-
Tim Potter
cda0f211b0 Fixed some compiler warnings. -
Jeremy Allison
e404e00199 Added HAVE_STDARG_H to tdbutil.c
Jeremy.
-
Andrew Tridgell
a500519544 optimise by default -
Jeremy Allison
408672d382 It compiles for me now :-). rpc_server/srv_lsa.c - added fix to allow w2k
clients to join a Samba domain - odd or even domain name length. Needs more testing.
Jeremy.
-
David O'Neill
025f7a092a 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.
-
Tim Potter
cef7f58ac5 Set the tdb->map_ptr to NULL if mmap() returns -1. -
Christopher R. Hertel
e651d1d642 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 -)-----
-
Jeremy Allison
506b5e34c3 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.
-
Jeremy Allison
dd959fa325 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.
-
Jeremy Allison
cfc62fecdf Added Tim's fix for read-only crashes.
Jeremy.
-
Jeremy Allison
f3b5e2a172 Fixed bug with tdb_next_lock failing when reaching then end of a hashchain
and the next hashchain is empty.
Jeremy
-
Tim Potter
2c9704c3db tdb_chainunlock() no longer returns a value. -
Jeremy Allison
9dea7b7c25 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.
-
Jeremy Allison
c9884e16fc Fixed one tdb_read -> rec_free_read call.
Jeremy.
-
Jeremy Allison
7ae54a93e7 Added sorted freelist neighbour merge code to stop tdb fragmentation.
This needs TESTING !!! (It passes tdbtest of course :-).
Jeremy.
-
Jeremy Allison
ee89ca9e68 Added print_freelist command.
Jeremy.
-
Andrew Tridgell
b64e1ae693 change the split threahold for the free list to prevent freelist
fragmentation
-
Andrew Tridgell
03453e2ae5 fixed a potential locking deadlock in tdb -
Jeremy Allison
98764c5df9 rpc_parse/parse_spoolss.c: Updated comment for old version of W2K.
tdb/tdbutil.c: With varargs uint16 is cast to (int).
Jeremy.
-
Andrew Tridgell
6e4a358552 got rid of tdb_writelock() and instead lock a chain. tdb_writelock()
is conceptually flawed
-
Andrew Tridgell
ca443210c8 added tdb_lock_bystring() and tdb_unlock_bystring() -
Jeremy Allison
623bfa6c93 Fixes from Damian at Cisco to tidy up some tdbtool issues.
Jeremy.
-
Jeremy Allison
7914e9351a Herb's fixes for profiling & compiler warnings.
Jeremy.
-
Jeremy Allison
c1de97f96b 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.
-
Jeremy Allison
902ada6379 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.
-
Andrew Tridgell
d0a1f96e0f support both read and write locks inside the tdb -
Andrew Tridgell
ee12b10d21 - use read locks when possible
- don't use as many locks on a store
-
Andrew Tridgell
a2f5977ac3 use the right MMAP flag -
Jeremy Allison
6c7adeab0f Moved tdb functions that access parse structs into parse_prs.c
to prevent builkd breaking.
Jeremy.
-
Jeremy Allison
8ef41f31c5 Fixing get/set of security descriptors.
Removed ugly hack for NT printing.
Fixed up tdb parse stuff memory leaks.
Jeremy.
-
Andrew Tridgell
ac9cdab33c added some debug code to track down pack/unpack problems -
Andrew Tridgell
9422719ab4 getting and setting security descriptors on printers now works
this needed some fixes in tdb_unpack(). Tim, you'll need to update
-
Andrew Tridgell
6c15495b30 added tdb_pack() and tdb_unpack() -
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 -