1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

124 Commits

Author SHA1 Message Date
Andrew Bartlett
6a648b727f s4-dsdb: Reduce calls to the ldb layer by reloading less often
We do not need to reload the partition list to get the global sequence
number, as that number is stored in the metadata.tdb, not the ldb files.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
Matthieu Patou
6f3a8b41f5 s4-dsdb: Add/Update SCHEMA_SEQ_NUM key in the metadata.tdb after schemaUpdateNow
The idea is to signal to other process accessing the database that the
schema was forced to be reloaded and so they should reload as well.
2012-06-22 23:22:04 -07:00
Amitay Isaacs
49926a2ac6 s4-dsdb: Added metadata to partition module for global sequence number
This adds support for global sequence number which is independent of
partition information.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Amitay Isaacs
349c54528b s4-dsdb: use dsdb_module_extended instead of duplicate code
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Amitay Isaacs
c199b35dd4 s4-dsdb: Remove LDB_SEQ_HIGHEST_TIMESTAMP sequence number support
This was a hack for LDAP backends to store a sequence number as a
timestamp. It is still supported in standalone ldb tdb backend.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Amitay Isaacs
3bb5af5244 s4-dsdb: Remove unsed variable 2011-11-17 03:49:07 +01:00
Matthias Dieter Wallnöfer
ec38098c29 s4:partition LDB module - fix handling regarding special DNs on searches
Normally they should always be passed to the main backend unless
something different has been specified.

Reviewed-by: abartlet

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Nov 15 22:43:06 CET 2011 on sn-devel-104
2011-11-15 22:43:06 +01:00
Andrew Tridgell
aba856c666 s4-dsdb: load the partialReplica attribute in the @PARTITION object
this modifies the partition module to honor a partialReplica attribute
on the @PARTITION module, marking partiations as partial replicas so
the NO_GLOBAL_CATALOG control can be honoured
2011-09-22 10:00:49 +10:00
Andrew Tridgell
9d98461150 s4-dsdb: cope with out of sync replication attributes in partition module
if the @ATTRIBUTES or other objects which are replicated between
partions become out of sync, then the ldb would fail to open. This
changes ensures that we can always fix those records, by running the
operation in the top level partition, and replicating the result to
the other partitions

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Mon Sep 19 04:31:48 CEST 2011 on sn-devel-104
2011-09-19 04:31:48 +02:00
Andrew Tridgell
1216649772 s4-dsdb: enforce NULL DN validity in partition module
windows does not allow a search on the empty DN except for rootDSE
searches or for phantom_root searches (ie. with --cross-ncs). By
enforcing this in Samba we make it more likely that our tests and
utilities will work against windows

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:38 +10:00
Matthias Dieter Wallnöfer
68fbfa2237 s4:partition LDB module - the current partition control should only be added if requested
That means if the informations before a request are unknown
("repl_meta_data" LDB module) then an empty control (no data) has to be sent.
2011-03-10 11:12:05 +01:00
Matthias Dieter Wallnöfer
78b46c533a s4:partition LDB module - extended operations - make the initialisation check consistent
To the other operations.
2011-03-10 11:12:05 +01:00
Matthias Dieter Wallnöfer
e52c900b63 s4:partition LDB module - move the "data" check a bit higher
It can be performed a bit earlier.
2011-03-10 11:12:05 +01:00
Matthias Dieter Wallnöfer
4e6b8e0a18 s4:partition LDB module - "partition_replicate" doesn't handle the search requests
That is done by "partition_search".
2011-03-10 11:12:05 +01:00
Matthias Dieter Wallnöfer
210cab9bf0 s4:partition LDB module - "partition_sequence_number" - remove meaningless "if"s
These current partition controls are always added for the two EXOP operations.
2011-03-10 11:12:05 +01:00
Matthias Dieter Wallnöfer
8872a62266 s4:partition LDB module - fill in parent requests for inheriting the flags
Probably it doesn't matter in this cases but just for consistency.
2011-03-10 11:12:04 +01:00
Matthias Dieter Wallnöfer
851396a627 s4:partition LDB module - add some comments 2011-03-10 11:12:04 +01:00
Matthias Dieter Wallnöfer
82067b1a61 s4:partition LDB module - fix typo 2011-03-10 11:12:04 +01:00
Andrew Tridgell
87f3151047 s4-dsdb: pass parent request to dsdb_module_*() functions
this preserves the request hierarchy for dsdb_module_*() calls inside
dsdb ldb modules

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-17 05:23:04 +01:00
Jelmer Vernooij
24faeab4c5 ldb: Rename last instance of save_controls -> ldb_save_controls. 2010-12-18 00:47:06 +01:00
Andrew Tridgell
4a08b2d172 s4-dsdb: removed the use of ldb_private.h from s4
this will allow s4 to use a system version of ldb
2010-11-03 07:43:57 +11:00
Andrew Tridgell
9103047782 s4-ldb: enable version checking in dsdb ldb modules 2010-11-01 13:05:04 +00:00
Andrew Tridgell
7eb2eed156 s4-dsdb: convert the rest of the ldb modules to the new module type 2010-11-01 18:55:19 +11:00
Andrew Tridgell
85ba79063f ldb: mark the location of a lot more ldb requests 2010-09-25 10:38:45 -07:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Andrew Tridgell
87df785a68 s4-dsdb: use ldb_operr() in the dsdb code
this replaces "return LDB_ERR_OPERATIONS_ERROR" with "return ldb_operr(ldb)"
in places in the dsdb code where we don't already explicitly set an
error string. This should make is much easier to track down dsdb
module bugs that result in an operations error.
2010-07-07 20:14:55 +10:00
Matthias Dieter Wallnöfer
0e21b4ffa0 Revert "s4/dsdb: Fixed partition_search() not to pass special DN's to LDAP backend."
This reverts commit ed4c107bc1.

See post "Endi's Bug 7530 patches (LDAP backend)" on samba-technical.
2010-06-29 15:14:32 +02:00
Endi S. Dewata
ed4c107bc1 s4/dsdb: Fixed partition_search() not to pass special DN's to LDAP backend.
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2010-06-28 19:33:45 +02:00
Anatoliy Atanasov
f84aeea739 s4/rodc: Support read-only database
Check on modify if we are RODC and return referral.
On the ldap backend side now we pass context and ldb_modify_default_callback
to propagate the referral error to the client.
2010-05-04 18:32:18 +02:00
Matthias Dieter Wallnöfer
d1dd0a560c s4:partition LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:10:00 +01:00
Matthias Dieter Wallnöfer
0be57c7478 s4:partition DSDB module - Generate basic referrals
This is a first, very basic implementation of the referrals (more informations
at MS-ADTS 3.1.1.4.6 and 3.1.1.3.4.1.12).

To have the full referral support (and to always point to the right host) the
full implementation using DNS will be needed (at the moment we always point to
the main DC which is referenceable through the DNS domainname).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:06 +11:00
Matthias Dieter Wallnöfer
cd5b542878 s4:partition DSDB module - change the search and domain scope control handling
The domain scope control is always removed, from the search one only the two
interesting flags (which are handled) and it is marked as non-critical.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:00 +11:00
Matthias Dieter Wallnöfer
c16d4fb76d s4:partition DSDB module - Cosmetic fixups 2010-02-21 21:44:24 +01:00
Andrew Tridgell
5d6032eb4b s4-partition: fixed selection of partitions on exact match
When a search is on the root of a partition on the global catalog,
don't search partitions above that one.
2010-01-08 13:03:06 +11:00
Andrew Tridgell
f7756c87bb s4-partition: don't ignore errors from other modules
if we get an error code from a lower module, we don't want to ignore
it just because something also succeeded
2010-01-08 13:03:03 +11:00
Andrew Tridgell
ab4d069094 s4-dsdb: always cancel transactions on all partitions
If we get an error ending a transaction on one partition we need to
continue on the other partitions.
2009-10-27 12:13:46 +11:00
Andrew Bartlett
5e920f2a23 s4:dsdb Rework partitions module for better tracing
This means we need to create a fake 'module' which only has a 'next'
pointer, so that we can now ldb_next_request() (which incorporates
tracing).  The remainaing stub of partition_request() is retained so
that we can indicate which partition an operation is destined for.

Similar tracing is added to the transaction handlers.

Andrew Bartlett
2009-10-27 11:32:18 +11:00
Andrew Bartlett
53b160e1b8 s4:dsdb Remove partition_extended_schema_update_now
The schema update now request is now handled above the partitions
module.

Andrew Bartlett
2009-10-27 11:32:08 +11:00
Andrew Tridgell
a4f86c07e5 s4-ldb: fixed request handling for schemaUpdateNow op 2009-10-26 08:38:03 +11:00
Andrew Tridgell
c34e45a8e2 s4-dsdb: ensure that new partitions inherit any transaction 2009-10-25 13:15:18 +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
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
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
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
Matthias Dieter Wallnöfer
8536e1b947 s4:various LDB modules - "build_request" functions - propagate result codes back
It's very useful to know the exact result code when something fails and not
only a generic (by the module) created one.
Sure, there are some exception cases with specific results (special message
constellations, attributes, values...) which shouldn't be changed at all
(examples of them are in the "ldap.py" test). Therefore I looked very
carefully to not change them.
2009-10-06 19:41:16 +02:00
Andrew Tridgell
f279b57f19 s4-dsdb: don't return the partition root objects
When searching across partitions, we want to avoid sending duplicate
records caused by the record appearing both as a mount point and as a
partition root in a nested partition. This patch works by intercepting
objects from searches and checking if they match a partition root. If
they do, and the partition is not the one in the partition control
request, then discard the object.
2009-09-28 13:11:21 +10:00
Andrew Tridgell
80c575923f s4-sam: allow a search to specify a partition
You can now attach a partition control to searches to search within a
specific partition. This is used to get at the per-partition
@REPLCHANGED object
2009-09-13 16:40:00 -07:00
Andrew Tridgell
5c0cf012a7 s4-samdb: make it possible to ask for the sequence number of a partition
The partition module normally makes the sequence number extended op
operate across all partitions. It will be useful in the repl task to
be able to ask for the sequence number of one partition
2009-09-12 15:24:31 +10:00