1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

20021 Commits

Author SHA1 Message Date
Matthias Dieter Wallnöfer
9f170bc7ea heimdal - hdb/ext.c - fix a "shadows variable" warning
Renamed the variable "str" in the nested block to "str2" to prevent the collision
with "str" in the main function block.
2009-10-21 17:35:51 +02:00
Torgeir Lerkerød
95ce7dff20 S4: ldb_map modules uses defines that are reserved
On OpenSolaris MAP_RENAME and friends are defined in <sys/mman.h> e.g. mmap and friends. So on these systems MAP_* have a meaning. Cleaned up LDB name space by adding LDB_ in front of MAP_* e.g. MAP_RENAME => LDB_MAP_RENAME

Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-21 15:46:38 +02:00
Torgeir Lerkerød
6e5dad49d9 S4: Building on a system with libintl
Heimdal's internal buildsystem uses a different define for checking for libintl than what samba uses. LIBINTL vs HAVE_LIBINTL_H. Since changing heimdals defineswould brake dropin merges of heimdal. This is a simple workaround in line with others in heimdal_build catalog.

Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-21 15:46:38 +02:00
Rusty Russell
0944931159 lib/tdb: make tdbtool use tdb_check() for "check" command
Also, set logging function so we get more informative messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:11:34 +10:30
Andrew Tridgell
1467e5eaab s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_val
The strlen() could go past the end of a non-null terminated value
2009-10-21 22:43:58 +11:00
Andrew Bartlett
16a80f1742 s4:dsdb Add note explaining about the partition format upgrade 2009-10-21 22:43:58 +11:00
Andrew Bartlett
d7cf71d9b6 s4:dsdb Allow loading of old-style partition records
This should make upgrades easier
2009-10-21 22:43:57 +11:00
Andrew Bartlett
4209cf9860 s4:dsdb Make the 'relative path' code in partitions handle tdb://
The previous code would fail if the caller used tdb:// in the URL for the
top-level database.

Andrew Bartlett
2009-10-21 22:43:57 +11:00
Andrew Bartlett
fa2e04b640 s4:ldb_map Fix use-after-free of memory in ldb_map
We need to keep the old 'ares' from the remote server around so we can forward
it back to the caller.  We can't send the same controls (from the last search
entry) twice (and it makes no sense anyway).

Andrew Bartlett
2009-10-21 22:43:57 +11:00
Andrew Bartlett
96ec45309a s4:dsdb talloc_steal the backend module to under the partition 2009-10-21 22:43:57 +11:00
Andrew Bartlett
937140bf10 s4:ldb Put ltdb_private under the 'module'
This helps track the memory better, as we can then place it under the partition
hirarchy.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
a0a787ad78 s4:rpc_server Ensure we talloc_free handles when we delete objects
If we don't talloc_free the handle, we leak the memory onto the long-term
context.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
398188fb9b s4:dsdb Remove potentially confusing 'partition' control from result
This ensures that the partition control, needed here for repl_meta_data's
internal work, is not pushed up to other callers.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
bd53628c7a s4:ldb Add new function to create a cut down list of controls
This I hope will be useful for removing controls from the ldb_reply

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
fcbe6163f6 s4:samr Don't leak the whole user onto the long-term handle
The user entry is only required for this function, so use
mem_ctx to hold it.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
47daa272c0 s4:epmapper Create a proper talloc tree of endpoint floors
Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
154747759e s4:dsdb Allow creation of new partitions
This is a collection of fixes to allow the creation of new partitions,
as well as adding debugging that may be useful in chasing down future
failures.

Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
4c36cac5ad s4:provision Use schema to casefold partitions on 'upgrade'.
This helps us upgrade from sam.ldb files before the dynamic partitions
work, and ensures we use the right casefolding functions.

Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
da7c778741 s4:dsdb Remove default instanceType from repl_meta_data
This is no longer required, as the instancetype module is now above
repl_meta_data.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
c106017f9a s4:dsdb Remove workaround for two partition head records
The problem here has been avoided in repl_meta_data, and so this is no
longer required.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
96c9bc18d5 s4:dsdb Use 'partition modified' information to update @REPLCHANGED
This major rework of repl_meta_data changes it from using a static
list of partitions to a dynamic list created from the controls placed
on returned ldb results.

To process these in one place, the similar but distinct callbacks are
combined into a single replmd_op_callback(), which handles both the
'normal operation' and 'inbound replication' case.

This allows new partitions to be created, and replication events for
these new partitions to be scheduled immediately.

Also in this commit: We no longer specify the target partition for new
or modified objects - instead we allow the partitions module to use
the DN as normal.  THis avoids the issue where we would create two
partition head records.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
d3a5037f2a s4:repl Pass schema as argument to replmd_update_rpmd() 2009-10-21 22:43:53 +11:00
Andrew Bartlett
f545d5fa43 s4:dsdb In partitions module, tell the caller what partition was used.
This means we don't return any control for modifications to the
control records in sam.ldb, but do if they modified one of the actual
data LDB files.

Andrew Bartlett
2009-10-21 22:43:53 +11:00
Andrew Bartlett
17237f18f0 s4:ldb Add function to add controls to an LDB reply 2009-10-21 22:43:53 +11:00
Andrew Bartlett
be5f0818ea s4:dsdb Load new partitions in a running LDB if metadata changes
This allows one instance of LDB to add a partition, and another to use
it without first closing the database.

Andrew Bartlett
2009-10-21 22:43:53 +11:00
Andrew Bartlett
6a77165c8a s4:dsdb Only reload partition metadata on search and transaction start
I see no reason to reload it when in a transaction - it can't change
on us anyway (we possibly need to watch for our own changes to
@PARTITION however)

Andrew Bartlett
2009-10-21 22:43:53 +11:00
Andrew Bartlett
e62200e253 s4:dsdb Reload partition metadata if the main db updates
This uses the fact that the primary DB does not change often.  Before
each operation, we see if the sequence number has changed.

Andrew Bartlett
2009-10-21 22:43:52 +11:00
Andrew Bartlett
18035251ad s4:provision Test ability to set GUIDs from provision command line 2009-10-21 22:43:52 +11:00
Andrew Bartlett
d3b50ec33f s4:provison Allow the NTDS guid on the command line (for testing)
This allows a blackbox test to confirm this can be set.

Andrew Bartlett
2009-10-21 22:43:52 +11:00
Andrew Bartlett
fa5ebaa686 s4:dsdb Split 'set per-partition metadata' into it's own function
This helps us ensure we always set the metadata, even when we are
'adding' a partition that is already in our list.  (We *really* don't
want these getting out of sync, and the extra writes are harmless)

Andrew Bartlett
2009-10-21 22:43:52 +11:00
Andrew Bartlett
27c28d34a7 s4:Handle reprovision with existing partitions
The issue here is that if we don't put the partitions metadata in the
database before we wipe it, we won't wipe the partitions contents, and
so the provision will later fail (entry already exists)

Andrew Bartlett
2009-10-21 22:43:51 +11:00
Andrew Bartlett
ff3b60d154 s4:dsdb Don't try and casefold DNs during startup for partition load
The issue here is that before we load the schema partition, we may not
have the correct casefolding rules.  As such, keep things simple and
use the DN exactly as found in the @PARTITIONS record to find the
database.

Andrew Bartlett
2009-10-21 22:43:51 +11:00
Andrew Bartlett
129bda51f1 s4:dsdb Fix partition_create not to return early 2009-10-21 22:43:51 +11:00
Andrew Bartlett
b73d584a89 s4:dsdb Fix tests for samba3sam to pass after partitions module changes
This is needed because the new format of the partitions record is a
casefolded DN, not a DN and file combination.

Andrew Bartlett
2009-10-21 22:43:51 +11:00
Andrew Bartlett
b04bdee800 s4:dsdb Be strict in selecting on-disk names for partitions
I really don't want a cn=foo/../bar in my ldb file name.

Andrew Bartlett
2009-10-21 22:43:50 +11:00
Andrew Bartlett
8ea2a8b785 s4:dsdb Set 'notification' after the success of a change.
This allows the partition to be created before we try and set a
notification on it.  (perhaps extra work required here for partition
heads).

Andrew Bartlett
2009-10-21 22:43:50 +11:00
Andrew Bartlett
d4048b2e17 s4:provision Set @OPTIONS in the provision_init.ldif
The new partitions code knows to copy these items in when creating a
new parition, so we can set it from the start.

Andrew Bartlett
2009-10-21 22:43:50 +11:00
Andrew Bartlett
c59f00805c s4:dsdb Rework modules create new partitions at runtime
This is done by passing an extended operation to the partitions module
to extend the @PARTITION record and to extend the in-memory list of
partitions.

This also splits things up into module parts that belong above and below
repl_meta_data

Also slit the partitions module into two files due to the complexity
of the code

Andrew Barltett
2009-10-21 22:43:50 +11:00
Kamen Mazdrashki
9393d94ad4 s4/drs: prefixMap main interface implementation
Currenly implemented functions are:
dsdb_schema_pfm_new(), dsdb_schema_pfm_make_attid()
and dsdb_schema_pfm_oid_from_attid()
2009-10-21 11:49:51 +03:00
Kamen Mazdrashki
4dc90c0851 s4/drs(tort): Unit test for prefixMap implementation.
Currenly those tests cover only the main part of the interface,
i.e. dsdb_schema_pfm_new(), dsdb_schema_pfm_make_attid()
and dsdb_schema_pfm_oid_from_attid()
2009-10-21 11:49:50 +03:00
Kamen Mazdrashki
31168f1fac s4/drs(tort): Comment typos fixed in drs_util.c 2009-10-21 11:49:50 +03:00
Kamen Mazdrashki
1ecca31caa s4/drs(tort): fixed '==' to '>='
ATTID is marked as partial by adding 32768.
Thus the check should be '>= 32768'
2009-10-21 11:49:50 +03:00
Günther Deschner
4b6cfbb6d2 s4-lsa: Fix dcesrv_lsa_EnumTrustDom() and avoid infite windows client loop.
Found by RPC-LSA-TRUSTED-DOMAIN torture test.

Guenther
2009-10-21 03:14:00 +02:00
Günther Deschner
48520b2274 s4-smbtorture: test whether an lsa_EnumTrustDom implementation would hang up a client.
Guenther
2009-10-21 03:13:24 +02:00
Günther Deschner
a4d5487576 s4-smbtorture: fix RPC-LSA-LSALOOKUP test against w2k3 and w2k8.
Make sure to split out lsa_LookupName NULL name test so that we can better track
results from bogus names and NULL names.

Guenther
2009-10-20 23:57:58 +02:00
Günther Deschner
9ee5d84665 s4-smbtorture: Make it simpler to specify number of trusted domains to create in
RPC-LSA-TRUSTED-DOMAINS.

Guenther
2009-10-20 21:49:38 +02:00
Günther Deschner
7e180101d3 s4-smbtorture: Fix wrong comment in RPC-LSA-TRUSTED-DOMAIN test.
Guenther
2009-10-20 15:30:19 +02:00
Günther Deschner
bf2746b537 s4-smbtorture: split out EnumTrustedDomainsEx test in RPC-LSA-TRUSTED-DOMAINS.
Guenther
2009-10-20 15:30:12 +02:00
Günther Deschner
d76e77ce9a s4-smbtorture: add stricter tests for LSA-LOOKUPNAMES replies.
Guenther
2009-10-20 15:28:30 +02:00
Günther Deschner
80b512fe03 s4-smbtorture: move all LookupNames tests into RPC-LSA-LOOKUPNAMES.
Guenther
2009-10-20 15:28:30 +02:00