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

88 Commits

Author SHA1 Message Date
Garming Sam
317bbc4d05 drepl_out: Send the prefix map alongside the RODC partial attribute set
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-08-25 10:32:07 +02:00
Stefan Metzmacher
ab63866e25 s4:dsdb/repl: avoid recursion after fetching schema changes.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12115

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-11 00:49:14 +02:00
Jeremy Allison
1ddd01dd21 s4: repl: Ensure all error paths in dreplsrv_op_pull_source_get_changes_trigger() are protected with tevent returns.
Otherwise dreplsrv_op_pull_source_get_changes_trigger() could infinitely recurse.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug  6 01:24:05 CEST 2016 on sn-devel-144
2016-08-06 01:24:05 +02:00
Garming Sam
c11629b6ad drepl: Fix a typo
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-07-21 06:37:07 +02:00
Andrew Bartlett
6b458a1a8c drs: pass the forced-replication flag from DsReplicaSync to GetNCChanges
This ensures we and sync from a server with DISABLE_OUTBOUND_REPL set

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-07-19 13:41:11 +02:00
Andrew Bartlett
1a87c9b599 repl: Avoid use-after-free when working with the working_schema
The original schema must live as long as the working_schema
as the working_schema starts as a shallow-copy of schema.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11953

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jun  7 14:33:39 CEST 2016 on sn-devel-144
2016-06-07 14:33:38 +02:00
Andrew Bartlett
449271defc repl: Enforce that we have parent objects for all replicated objects
The creating of replicated objects without their parent object allows database corruption as they can end up under
the wrong object.  We need to re-try the replication with the DRSUAPI_DRS_GET_ANC flag
set to get the objects in tree order.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-06 16:36:22 +02:00
Andrew Bartlett
ee80da56b9 repl: Retry replication of the schema on WERR_DS_DRA_SCHEMA_MISMATCH
This makes us replicate the schema, and then go back to what we asked to replicate
originally, when the schema changes.  This should make the replication much more
robust after schema changes

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-06 08:50:09 +02:00
Andrew Bartlett
65a35acbf3 repl: Pass in the full partition DN to dsdb_replicated_objects_convert()
When we were processing an EXOP, we would pass in a DN specific to that
operation, but this stopped repl_meta_data from finding the parent object

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-06 08:50:09 +02:00
Andrew Bartlett
4b25650577 repl: Give an error if we get a secret when not expecting one
We should never get a secret from a server when we specify DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING

This asserts that this is the case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
288117507f dsdb-repl: Always set DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING when we are an RODC
Unless we are using DRSUAPI_EXOP_REPL_SECRET, always remove
DRSUAPI_DRS_WRIT_REP and always set
DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING

Otherwise, we will not work as an RODC, because replication will fail
with access denied errors.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-03-16 03:00:07 +01:00
Volker Lendecke
a99a5a34a5 Fix the developer O3 build
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Feb 25 16:32:29 CET 2015 on sn-devel-104
2015-02-25 16:32:29 +01:00
Samuel Cabrero
ee32bc2cfb Order switch statements
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jul  7 07:47:44 CEST 2014 on sn-devel-104
2014-07-07 07:47:44 +02:00
Samuel Cabrero
d747372d28 idl:drsuapi: Manage all possible lengths of drsuapi_DsBindInfo
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
2014-07-07 05:22:33 +02:00
Andrew Bartlett
8327321225 dsdb: Do not store a struct ldb_dn in struct schema_data
The issue is that the DN contains a pointer to the ldb it belongs to,
and if this is not kept around long enough, we might reference memory
after it is de-allocated.

Andrew Bartlett

Change-Id: I040a6c37a3164b3309f370e32e598dd56b1a1bbb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Stefan Metzmacher
0e902b83b4 s4:dsdb/repl: make use of dcerpc_binding_handle_is_connected()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Garming Sam
952bc3cad0 Remove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.
Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: I133eb5a699757ae57b87d3bd3ebbcf5b556b0268
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Matthieu Patou
fdca2f6ff4 dsdb-repl: do not ask to add ref when doing getncchange for an exop
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:27 +11:00
Stefan Metzmacher
2e9b06412b s4:dsdb/drepl: update the source_dsa_obj/invocation_id in repsFrom
The highwatermark is relative to the source_dsa_invocation_id.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-01 19:28:06 +01:00
Matthieu Patou
059523e203 s4-resolver: do not use all the A and AAAA records, those after a NS are not the one we want to use 2011-12-05 18:23:08 +01:00
Matthieu Patou
2f8a84bb7b s4-drs: mark WERR_DS_DRA_BUSY as a non error in DsReplicaUpdateRefs 2011-12-05 18:23:07 +01:00
Andrew Tridgell
8976e1d50d s4-rodc: use the rodc_replica flag on the partition
this sets DSDB_REPL_FLAG_PARTIAL_REPLICA when replicating a RODC
partition, which tells the replication code to map instanceType to
remove the INSTANCE_TYPE_WRITE bit

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:21 +11:00
Andrew Tridgell
f37e81bbc5 s4-repl: add FULL_SYNC and PARTIAL_REPLICA flags
this sets the appropriate flags for replication with FULL_SYNC and
partial replica replications
2011-10-04 15:08:56 +11:00
Andrew Tridgell
4efb4ebe63 s4-dsdb: added support for replicating with GC partial attribute set
if we are replicating a partial replica, then we need to supply the
partial attribute set we want to replicate to the server
2011-09-22 10:00:48 +10:00
Andrew Tridgell
5a9dc1d216 s4-repl: fixed _msdcs DNS name
another multi-domain fix
2011-08-25 07:39:38 +10:00
Andrew Bartlett
35b309fa0c gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()
This is slightly less efficient, because we no longer keep a cache on
the gensec structures, but much clearer in terms of memory ownership.
Both gensec_session_info() and gensec_session_key() now take a mem_ctx
and put the result only on that context.

Some duplication of memory in the callers (who were rightly uncertain
about who was the rightful owner of the returned memory) has been
removed to compensate for the internal copy.

Andrew Bartlett
2011-08-03 18:48:02 +10:00
Andrew Bartlett
e3821f2c40 s4-auth Move libcli/security/session.c to the top level
This code is now useful in common, as the elements of the
auth_session_info structure have now been defined in common IDL.

Andrew Bartlett
2011-02-22 16:20:11 +11:00
Andrew Tridgell
8dc92c8f71 ldb: use #include <ldb.h> for ldb
thi ensures we are using the header corresponding to the version of
ldb we're linking against. Otherwise we could use the system ldb for
link and the in-tree one for include

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-10 06:51:07 +01:00
Kamen Mazdrashki
b4476d5f7d s4-drepl: Fix log message to be shown on its own line 2010-12-17 23:47:25 +02:00
Kamen Mazdrashki
0a9f780d26 s4-drepl: We won't need a working schema for empty replicas sent.
Without this check, receiving empty replica leads to a situation
where we left with a working_schema attached to the ldb.

The problem here is that working_schema is not fully functional
schema cache and keeping it attached to the ldb may lead
to modules failing to accomplish their jobs
2010-12-15 00:51:19 +01:00
Kamen Mazdrashki
18744a9531 s4-drepl: User working schema for commiting objects when replicating Schema NC 2010-12-15 00:51:19 +01:00
Kamen Mazdrashki
c94e5d4438 s4-repl: Allow dsdb_replicated_objects_commit() to use different schema while committing objects
working_schema is to be used while committing a Schema replica.

When we replicate Schema, then we most probably won't be
able to convert all replicated objects using the current
Schema cache (as we don't know anything about those new objects).

Thus, during Schema replication, we make a temporary
working_schema that contains both our current Schema +
all objects we get on the wire.
When we commit those new objects, we should use our working_schema
(by setting it to the ldb), and after all changes are commited,
we can refresh the schema cache so we have a brand new,
full-featured Schema cache
2010-12-15 00:51:19 +01:00
Kamen Mazdrashki
cf8ffc37b4 s4-dreplsrv: Use working_schema when replicating from Schema NC
Schema is changed and it is quite possible we won't be able
to decode replicated objects using current Schema cache we have.

Thus, when replicating Schema, we will make a temporary Schema
cache, working_schema, so that we can fully decode objects
we recieve.
2010-12-01 13:01:17 +02:00
Kamen Mazdrashki
4041791d01 s4-repl: Let dsdb_replicated_objects_convert() to accept schema from caller
This allows us to use schema that is different than the one
set to 'ldb' to decode objects.
2010-12-01 13:01:16 +02:00
Matthias Dieter Wallnöfer
736d36a948 s4:dsdb/repl/drepl* - move "lib/messaging/irpc.h" include into "drepl_service.h"
This is needed to fix a Tru64 "cc" warning regarding "enum drepl_role_master".

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Nov 28 12:46:19 CET 2010 on sn-devel-104
2010-11-28 12:46:19 +01:00
Matthias Dieter Wallnöfer
a13bd32fa9 s4:dsdb/repl/drepl_out_helpers.c - print out the correct error message (werr)
Also detected by Tru64 "cc".
2010-11-27 21:50:42 +01:00
Kamen Mazdrashki
a8495d380e s4-repl: dsdb_extended_replicated_objects_convert -> dsdb_replicated_objects_convert/
It is part of dsdb_replicated_* family of functions
2010-11-11 18:54:20 +00:00
Kamen Mazdrashki
227e8dcfcf s4-repl: dsdb_extended_replicated_objects_commit -> dsdb_replicated_objects_commit
It is part of dsdb_replicated_* family of functions
2010-11-11 18:54:20 +00:00
Andrew Tridgell
c03d02d28e s4-rodc: don't set SPECIAL_SECRET_PROCESSING on EXOP_REPL_SECRET
otherwise we don't get the secrets!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-30 20:11:15 -07:00
Andrew Tridgell
1a9f5b45f8 s4-drepl: don't call UpdateRefs on a RODC
we use the ADD_REF bit in getncchanges instead

Pair-Programmed-With: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-09-29 22:12:57 -07:00
Andrew Tridgell
287e35f4cf s4-drepl: fixed the checking of replica_flags in the drepl server
we were incorrectly avoiding a getncchanges when WRIT_REP was not set

Pair-Programmed-With: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-09-29 22:12:57 -07:00
Matthias Dieter Wallnöfer
6c349d479f s4:drepl_out_helpers.c - fix a counter type
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-09-24 09:25:41 +10:00
Andrew Tridgell
7ffcf90bb9 s4-drepl: use the partition UDV and hwm for extended getncchanges ops
we find the NC root then load the uptodateness vector and highwater
mark, if available, from there
2010-09-20 21:51:08 -07:00
Andrew Tridgell
3b87e3e951 s4-repl: if we are an RODC don't set WRIT_REP in replication
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-16 07:24:01 +10:00
Andrew Tridgell
05ec123b3b s4-repl: add partial attribute set to getncchanges calls for RODCs
when we are a RODC we must supply a partial attribute set in the
getncchanges call

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-16 07:24:01 +10:00
Anatoliy Atanasov
ab01ce6e96 s4/drs: update repsFrom only when we are not in getncchanges extended op 2010-09-10 13:08:20 +03: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
Stefan Metzmacher
538bb9b3ec s4:dsdb/repl: expose drsuapi_DsExtendedError to the caller (e.g. the ridalloc client)
metze
2010-07-09 09:27:16 +02:00
Stefan Metzmacher
49deed5a77 s4:drepl_out_helpers: don't return NT_STATUS_OK, if an extended operation doesn't return success
metze
2010-07-09 09:27:16 +02:00
Andrew Tridgell
9b18b339c0 s4-repl: end repl request when not doing an UpdateRefs
otherwise the queue is stuck forever
2010-04-27 10:38:58 +10:00