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

133 Commits

Author SHA1 Message Date
Volker Lendecke
8686da231d dsdb: Fix a crash in an error return
In an error return we have

/* Back it out, if it fails on one */
for (i--; i >= 0; i--) {
	ldb_next_del_trans(data->partitions[i]->module);
}

With unsigned int i this will spin and del_trans somewhere far off :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-11 22:02:04 +02:00
Stefan Metzmacher
cd103d84e6 s4:dsdb/ldb_modules: avoid str_list related const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:44 +02:00
Volker Lendecke
0c8d5df5ca dsdb: Fix Coverity ID 1034907 Dereference before null check
"module" has already been dereferenced by ldb_module_get_private(module)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:08 +01:00
Matthieu Patou
77f7a46e18 s4:dsdb: Fix warnings about not set / set but unused / shadowed variables
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Apr 19 13:15:40 CEST 2013 on sn-devel-104
2013-04-19 13:15:40 +02:00
Andrew Bartlett
329e374938 s4-dsdb: Remove support for per-partition sequence numbers
These sequence numbers were only used for telling if the schema was
changed, and are no longer directly related to the replication USN.

The per-partition replication USN can be obtained from the
@REPLCHANGED record on the per-partition database, and this is done
with an ldb_search().

Andrew Bartlett
2012-08-11 12:53:42 +10:00
Andrew Bartlett
8dd09ef46d s4-dsdb: Do not reload partition metadata except on transaction start
This ensures that we do not add objects that should go into a partition, but we
simply return that an object is not present if the connection was created
before the partition was loaded.  It is rare to create a new partition.

Andrew Bartlett
2012-08-09 10:01:04 +02:00
Andrew Bartlett
1a1f01ee7a s4-dsdb: Change talloc parent
This matches the rest of the function.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 06:26:36 CEST 2012 on sn-devel-104
2012-08-09 06:26:36 +02:00
Andrew Bartlett
17275561a0 s4-dsdb: Remove ldb_sequence_type argument from partition_primary_sequence_number
We always want LDB_SEQ_HIGHEST_SEQ here.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
Andrew Bartlett
6ec963eef7 s4-dsdb: simplify migration of old-style seqence numbers to metadata.tdb
This simple operation does not need to be encased in generic ldb extended operations.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
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