1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-05 21:57:51 +03:00

293 Commits

Author SHA1 Message Date
Jeremy Allison
50dbb66d73 r17030: Partially fix standalone build of tdb directory
(tdbtool still fails).
Jeremy.
2007-10-10 11:19:21 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
James Peach
d448629282 r15508: Use clock_gettime for profiling timstamps if it is available. Use
the fastest clock available on uniprocessors.
2007-10-10 11:16:55 -05:00
James Peach
a19d4f2bb4 r15448: New autoconf macro to test for sysconf variables. 2007-10-10 11:16:46 -05:00
Volker Lendecke
d52002c1c9 r15104: Implement Samba4's tdb_name().
Volker
2007-10-10 11:16:23 -05:00
Volker Lendecke
b9c6e3f556 r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring does not
have the timeout argument in Samba4. Add a new routine
tdb_lock_bystring_with_timeout.

Volker
2007-10-10 11:16:23 -05:00
Jeremy Allison
3cd5c3df0d r14954: Fix #3569 based on William Jojo's work. AIX also
has the linear posix locking issue which causes
CLEAR_IF_FIRST to cause performance problems.
As we know we're in a daemon architecture with
long-lived parent we can avoid this in the Samba
case. Add a comment explaining this.
Jeremy.
2007-10-10 11:15:55 -05:00
Jeremy Allison
b51edde4d6 r14030: Fix resource leak in error codepath. Coverity CID #64.
Jeremy.
2007-10-10 11:11:06 -05:00
Jeremy Allison
3a1c4cb93d r14026: Fix resource leak on error exit. Coverity CID #65.
Jeremy.
2007-10-10 11:11:06 -05:00
Jeremy Allison
1d710d06a2 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
2007-10-10 11:10:59 -05:00
Jeremy Allison
9ed3bd431c r13792: Merged Simo's fixes for tdbtraverse.
Jeremy.
2007-10-10 11:10:54 -05:00
Lars Müller
23503ff45f r13197: Add -k switch to dump the data of a single key. 2007-10-10 11:06:17 -05:00
Volker Lendecke
9d366da172 r12760: Fix bug 3384 2007-10-10 11:06:03 -05:00
Jeremy Allison
4473ac4ef9 r12713: Remove use of uint8_t -> uint8.
Jeremy.
2007-10-10 11:06:01 -05:00
Jeremy Allison
d720867a78 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
2007-10-10 11:05:02 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Jeremy Allison
b1722b7bd1 r10355: Merge back the clear-if-first fix from Samba4. Couldn't wait tridge, sorry :-).
Jeremy.
2007-10-10 11:03:41 -05:00
Jeremy Allison
cfe5a7e5f8 r9852: Add tridge's Samba4 tdb optimisations.
Jeremy.
2007-10-10 11:03:26 -05:00
Volker Lendecke
cbc66cc3ca r9738: Adapt tdb_torture to the new CLEAR_IF_FIRST semantics. We need one parent
process holding the active if two cluster nodes access the same tdb.

Volker
2007-10-10 11:03:25 -05:00
Volker Lendecke
5e6fef32b3 r9095: Add crude chainlength statistics to the crude tdbtool.
Volker
2007-10-10 11:00:25 -05:00
Tim Potter
c525c276c3 r8595: Delete unused prototypes. 2007-10-10 11:00:12 -05:00
Jeremy Allison
9506b8e145 r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
2007-10-10 10:58:00 -05:00
Jeremy Allison
b438cb0a85 r7640: Fix based on work from "Shlomi Yaakobovich" <Shlomi@exanet.com> to catch
loops in corrupted tdb files.
Jeremy.
2007-10-10 10:57:18 -05:00
Gerald Carter
9727d05241 r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1 2007-10-10 10:57:02 -05:00
Derrell Lipman
7b4d4f6109 r7025: 1 if not all data is available at the time we go to read a packet, retry
the read using a timeout to ensure that all data for the packet is received.
2 some minor changes to meet coding standards
3 eliminate some compiler warnings
2007-10-10 10:57:00 -05:00
Herb Lewis
94e5347266 r6623: This change fixes a few broken commands plus adds some
new commands. It also restructures it so you can execute
a single command from the command line. Input strings are
parsed to allow input of arbitrary characters using the
\xx syntax for hex values.
2007-10-10 10:56:47 -05:00
Jeremy Allison
28772dfca1 r6235: Partial fix for bugid #2581. Ensure if realloc fails on an internal
tdb we fail gracefully.
Jeremy.
2007-10-10 10:56:31 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Derrell Lipman
994694f7f2 r6149: Fixes bugs #2498 and 2484.
1. using smbc_getxattr() et al, one may now request all access control
   entities in the ACL without getting all other NT attributes.
2. added the ability to exclude specified attributes from the result set
   provided by smbc_getxattr() et al, when requesting all attributes,
   all NT attributes, or all DOS attributes.
3. eliminated all compiler warnings, including when --enable-developer
   compiler flags are in use.  removed -Wcast-qual flag from list, as that
   is specifically to force warnings in the case of casting away qualifiers.

Note: In the process of eliminating compiler warnings, a few nasties were
      discovered.  In the file libads/sasl.c, PRIVATE kerberos interfaces
      are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED
      kerberos interfaces are being used.  Someone who knows kerberos
      should look at these and determine if there is an alternate method
      of accomplishing the task.
2007-10-10 10:56:24 -05:00
Derrell Lipman
5b19ede88e r6127: Eliminated all compiler warnings pertaining to mismatched "qualifiers". The
whole of samba comiles warning-free with the default compiler flags.

Temporarily defined -Wall to locate other potential problems.  Found an
unused static function (#ifdefed out rather than deleted, in case it's
needed for something in progress).

There are also a number of uses of undeclared functions, mostly krb5_*.
Files with these problems need to have appropriate header files included,
but they are not fixed in this update.

oplock_linux.c.c has undefined functions capget() and capset(), which need
to have "#undef _POSIX_SOURCE" specified before including <sys/capability.h>,
but that could potentially have other side effects, so that remains uncorrected
as well.

The flag -Wall should be added permanently to CFLAGS, and all warnings then
generated should be eliminated.
2007-10-10 10:56:24 -05:00
Volker Lendecke
d89b40e9b1 r5861: Apply some const 2007-10-10 10:56:05 -05:00
Volker Lendecke
66471de977 r5767: Get rid of some compiler warnings 2007-10-10 10:56:00 -05:00
Jeremy Allison
f997c28bb8 r5532: Patch to detect infinite loops when traversing a tdb from "Shlomi Yaakobovich" <Shlomi@exanet.com>
Jeremy.
2007-10-10 10:55:45 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Gerald Carter
1bc79a2808 r3772: BUG 2006: patch from Michel Gravey <michel.gravey@optogone.com>; fix build when using gcc 3.0 2007-10-10 10:53:17 -05:00
Jeremy Allison
c3e87f9fa5 r2999: Remove lockedkeys code. Not used.
Jeremy.
2007-10-10 10:52:59 -05:00
Jeremy Allison
365b203164 r2979: Fix incorrect locks/unlocks in tdb_lockkeys()/tdb_unlockkeys().
Spotted by Taj Khattra <taj.khattra@gmail.com>.
Jeremy.
2007-10-10 10:52:58 -05:00
Tim Potter
b6193f6d52 r2924: Another #if that should be an #ifdef. 2007-10-10 10:52:56 -05:00
Tim Potter
53bfb76608 r2248: Merge of tridge's PRINTF_ATTRIBUTE fixes from samba4. 2007-10-10 10:52:37 -05:00
Jim McDonough
67c737118f r2239: Fixup formatting errors in TDB_LOG calls. Add printf attribute support to
tdb log functions.
2007-10-10 10:52:37 -05:00
Jim McDonough
30da4e7771 r2131: Fixup format string. The magic value format specifier was missing, so
the logged offset was really the magic value, and the true offset was
never displayed.
2007-10-10 10:52:32 -05:00
Jeremy Allison
d7ea1ea8fb r2032: If you're selecting a hash algorithm for tdb, you need to do it at open time,
it doesn't make sense anywhere else.
Jeremy.
2007-10-10 10:52:29 -05:00
Jeremy Allison
3fbadac85b r2026: Simplify statcache to use an in-memory tdb. Modify tdb to use
a customer hash function for this tdb (yes it does make a difference
on benchmarks). Remove the no longer used hash.c code.
Jeremy.
2007-10-10 10:52:29 -05:00
John Terpstra
c5dc3da340 r923: Fixes so tdbtool and tdbtest can be built. Added build specs for tdbdump and tdbbackup. 2007-10-10 10:51:49 -05:00
Gerald Carter
a7e2730ec4 r39: * importing .cvsignore files
* updateing WHATSNEW with vl's change
2007-10-10 10:51:05 -05:00
Andrew Tridgell
9d1a08d65c merge tdb changes from samba4 - this means tdb is now under the LGPL, as discussed and agreed previously -
Tim Potter
1bba071126 Merge from HEAD. -
Rafal Szczesniak
33d1e2dd63 Added copyrights I forgot about looong ago...
rafal
-
Jeremy Allison
14dee03801 Fix the "too many fcntl locks" scalability problem raised by tridge.
I've now tested this in daemon mode and also on xinetd and I'm pretty
sure it's working.
Jeremy.
-
Tim Potter
2423a45947 Don't log an error in tdb_brlock() if a non-blocking lock returns EAGAIN -
it's supposed to do that.
-