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

306 Commits

Author SHA1 Message Date
Jeremy Allison
bb4fb75b22 r19823: "log" is an internal define in older versions of gcc.
Rename to log_ctx.
Jeremy.
(This used to be commit dbf0e58a1e)
2007-10-10 12:16:00 -05:00
Volker Lendecke
3a1ada7635 r19685: Two changes inspired by problems with huge tdbs. tdbtool's list command now
prints the hash on every record for easier awk'ing, and tdbbackup allows a
different hash chain length on the backed up tdb.

Jeremy, Günther, this might be interesting for you huge domains. Not only
locking.tdb, also the winbind ones might grow huge.

In the installation I fixed with this winbind spent a huge amount of CPU
spinning through a degenerated winbindd_idmap.tdb with entries for more than
15.000 users. With a default number of hash chains of 131 on that tdb you can
imagine that the lists get large.

Not merging to 4, I don't get tdbbackup to compile there right now.

What about changing the global default hash chain number to be dramatically
larger? Disk is cheap these days.

Volker
(This used to be commit 577d0ff658)
2007-10-10 12:15:46 -05:00
Andrew Tridgell
aa3ca346d8 r19429: moved tdb/common/tdbutil.c into lib/util_tdb.c
see discussion on samba-technical
(This used to be commit 1ad563286f)
2007-10-10 12:15:35 -05:00
Andrew Tridgell
7d52581978 r19426: merge nearly all the differences between Samba3 tdb and Samba4
tdb. This includes:

 - the new tdb_lockall and tdb_lockall_read code, which will be needed
   for the ldb speedups

 - the tdb logging changes. This is an intermediate step to keep the
   differences between the two branches small. The plan is still to
   move to a tdb_init()/tdb_set_logging_function()/tdb_attach() style
   of open which will make things much cleaner.

 - the updated test suites and standalone tdb build code

 - use libreplace headers

There are still some small differences I haven't merged. I'll discuss
those on the list.
(This used to be commit 48903c75ed)
2007-10-10 12:15:35 -05:00
Jelmer Vernooij
4db7642caa r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db)
2007-10-10 12:00:54 -05:00
Stefan Metzmacher
ce95caf0df r18731: fix the build on aix
metze
(This used to be commit ff88592426)
2007-10-10 12:00:53 -05:00
Stefan Metzmacher
258a465e20 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
(This used to be commit 2f58645b70)
2007-10-10 11:51:59 -05:00
Volker Lendecke
c49961b785 r18030: When compiling with C++, nested structs lead to nested class definitions which
are not compatible. I am aware that this would be a huge change in Samba4, but
I would like to see it in the code that is shared.

Stefan, when you do merge work, can you get this across to Samba4?

Thanks,

Volker
(This used to be commit 959ea2c7dc)
2007-10-10 11:43:24 -05:00
Volker Lendecke
986461b6be r17607: Adapt the Samba4 directory structure for tdb. Makes it easier to diff.
Let's see what it breaks. For me it works :-)

Volker
(This used to be commit 337be14b43)
2007-10-10 11:38:42 -05:00
Volker Lendecke
03e3cd1d5a r17554: Cleanup
(This used to be commit 761cbd52f0)
2007-10-10 11:38:38 -05:00
Volker Lendecke
4d6d92400c r17460: First step at fixing the build breakage with the groupmapping test. On Linux,
F_RDLCK is defined to 0, for example NetBSD has it at 1.

Still does not work fully though. Still investigating.

This might also be interesting to Samba4.

Volker
(This used to be commit a1c3774e01)
2007-10-10 11:38:35 -05:00
Volker Lendecke
ac9628de48 r17425: Add the multi-key wrapper. If it's necessary to add general blobs as keys,
this can trivially be added later.

Volker
(This used to be commit 6915adb978)
2007-10-10 11:38:33 -05:00
Volker Lendecke
5a5deade6e r17315: Make talloc and tdb C++-warning-free. Would this also be interesting in talloc
and tdb "upstream"?

Volker
(This used to be commit 68c43191c8)
2007-10-10 11:38:25 -05:00
Jeremy Allison
2a2d67f5ad r17030: Partially fix standalone build of tdb directory
(tdbtool still fails).
Jeremy.
(This used to be commit 50dbb66d73)
2007-10-10 11:19:21 -05:00
Jeremy Allison
fbdcf2663b 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.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
James Peach
826614ed16 r15508: Use clock_gettime for profiling timstamps if it is available. Use
the fastest clock available on uniprocessors.
(This used to be commit d448629282)
2007-10-10 11:16:55 -05:00
James Peach
584ac985ec r15448: New autoconf macro to test for sysconf variables.
(This used to be commit a19d4f2bb4)
2007-10-10 11:16:46 -05:00
Volker Lendecke
30832e95dc r15104: Implement Samba4's tdb_name().
Volker
(This used to be commit d52002c1c9)
2007-10-10 11:16:23 -05:00
Volker Lendecke
e17302200c 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
(This used to be commit b9c6e3f556)
2007-10-10 11:16:23 -05:00
Jeremy Allison
4ee43dbd47 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.
(This used to be commit 3cd5c3df0d)
2007-10-10 11:15:55 -05:00
Jeremy Allison
8f0bdb9c4e r14030: Fix resource leak in error codepath. Coverity CID #64.
Jeremy.
(This used to be commit b51edde4d6)
2007-10-10 11:11:06 -05:00
Jeremy Allison
6b591819dd r14026: Fix resource leak on error exit. Coverity CID #65.
Jeremy.
(This used to be commit 3a1c4cb93d)
2007-10-10 11:11:06 -05:00
Jeremy Allison
894358a8f3 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.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Jeremy Allison
ac02620581 r13792: Merged Simo's fixes for tdbtraverse.
Jeremy.
(This used to be commit 9ed3bd431c)
2007-10-10 11:10:54 -05:00
Lars Müller
0f46bfdce6 r13197: Add -k switch to dump the data of a single key.
(This used to be commit 23503ff45f)
2007-10-10 11:06:17 -05:00
Volker Lendecke
92e85d325f r12760: Fix bug 3384
(This used to be commit 9d366da172)
2007-10-10 11:06:03 -05:00
Jeremy Allison
2b509f470d r12713: Remove use of uint8_t -> uint8.
Jeremy.
(This used to be commit 4473ac4ef9)
2007-10-10 11:06:01 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Gerald Carter
54abd2aa66 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)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Jeremy Allison
b3b2910f8f r10355: Merge back the clear-if-first fix from Samba4. Couldn't wait tridge, sorry :-).
Jeremy.
(This used to be commit b1722b7bd1)
2007-10-10 11:03:41 -05:00
Jeremy Allison
76a85f222f r9852: Add tridge's Samba4 tdb optimisations.
Jeremy.
(This used to be commit cfe5a7e5f8)
2007-10-10 11:03:26 -05:00
Volker Lendecke
77670a2ec3 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
(This used to be commit cbc66cc3ca)
2007-10-10 11:03:25 -05:00
Volker Lendecke
1a2316f644 r9095: Add crude chainlength statistics to the crude tdbtool.
Volker
(This used to be commit 5e6fef32b3)
2007-10-10 11:00:25 -05:00
Tim Potter
9808b5e394 r8595: Delete unused prototypes.
(This used to be commit c525c276c3)
2007-10-10 11:00:12 -05:00
Jeremy Allison
19ca97a70f 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
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Jeremy Allison
eb2280663f r7640: Fix based on work from "Shlomi Yaakobovich" <Shlomi@exanet.com> to catch
loops in corrupted tdb files.
Jeremy.
(This used to be commit b438cb0a85)
2007-10-10 10:57:18 -05:00
Gerald Carter
f24d88cf9d r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241)
2007-10-10 10:57:02 -05:00
Derrell Lipman
54aee75980 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
(This used to be commit 7b4d4f6109)
2007-10-10 10:57:00 -05:00
Herb Lewis
61ffe158f2 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.
(This used to be commit 94e5347266)
2007-10-10 10:56:47 -05:00
Jeremy Allison
e79e98a9f6 r6235: Partial fix for bugid #2581. Ensure if realloc fails on an internal
tdb we fail gracefully.
Jeremy.
(This used to be commit 28772dfca1)
2007-10-10 10:56:31 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Derrell Lipman
9840db418b 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.
(This used to be commit 994694f7f2)
2007-10-10 10:56:24 -05:00
Derrell Lipman
934d41d239 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.
(This used to be commit 5b19ede88e)
2007-10-10 10:56:24 -05:00
Volker Lendecke
8a427cb623 r5861: Apply some const
(This used to be commit d89b40e9b1)
2007-10-10 10:56:05 -05:00
Volker Lendecke
5ba3fb825b r5767: Get rid of some compiler warnings
(This used to be commit 66471de977)
2007-10-10 10:56:00 -05:00
Jeremy Allison
f7decc6b23 r5532: Patch to detect infinite loops when traversing a tdb from "Shlomi Yaakobovich" <Shlomi@exanet.com>
Jeremy.
(This used to be commit f997c28bb8)
2007-10-10 10:55:45 -05:00
Jeremy Allison
acf9d61421 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.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Gerald Carter
b5eeca9f70 r3772: BUG 2006: patch from Michel Gravey <michel.gravey@optogone.com>; fix build when using gcc 3.0
(This used to be commit 1bc79a2808)
2007-10-10 10:53:17 -05:00
Jeremy Allison
9e4b000b12 r2999: Remove lockedkeys code. Not used.
Jeremy.
(This used to be commit c3e87f9fa5)
2007-10-10 10:52:59 -05:00
Jeremy Allison
db2fa3bde8 r2979: Fix incorrect locks/unlocks in tdb_lockkeys()/tdb_unlockkeys().
Spotted by Taj Khattra <taj.khattra@gmail.com>.
Jeremy.
(This used to be commit 365b203164)
2007-10-10 10:52:58 -05:00