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

54 Commits

Author SHA1 Message Date
Douglas Bagnall
2af06390c3 dsdb periodic: DNS: split aging from tombstone deletion
We have been conflating two things (under the term "scavenging"):

1. aging out stale DNS records into tombstones, which only happens if
   this feature is switched on in general and for the zone.

2. removing expired DNS tombstones, which should always happen
   (because we tombstone nodes in *other* ways).

With this patch, we un-conflate.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-06-20 23:26:32 +00:00
Ralph Boehme
4142bde7e5 s4: rename source4/smbd/ to source4/samba/
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 27 10:07:18 UTC 2020 on sn-devel-184
2020-11-27 10:07:18 +00:00
Volker Lendecke
f05f40316d Fix a comment typo copied around
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-17 19:35:38 +00:00
Aaron Haslett
86b61551b3 dns+kcc: adding dns scavenging to kcc periodic run
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Pair-Programmed-With: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-12 04:31:55 +02:00
Gary Lockyer
b841da04e2 dns: Reformat DNS with clang-format
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-12 04:31:52 +02:00
Garming Sam
e244ba4a8f repl: Set GET_ALL_GROUP_MEMBERSHIP flag in the drepl server
Although we do not currently support this in the server, this will cause
data loss against a Windows DC unless we set this flag as per the docs.
This flag is required for the RODC.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Jun 15 05:31:59 CEST 2017 on sn-devel-144
2017-06-15 05:31:59 +02:00
Andrew Bartlett
240038979d dsdb: Expose ldb error string to dsdb_garbage_collect_tombstones() callers
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-09-01 05:49:15 +02:00
Andrew Bartlett
1c63653287 dsdb: Expand garbage_collect_tombstones to expunge links also
This requires a significant rework, as we can no longer
do a one-level search and hope to find most of the deleted
objects.  Therefore we fall back to a full scan, but less often.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-09-01 05:49:15 +02:00
Andrew Bartlett
824220e9bd dsdb: move tombstone lifetime calculation out of dsdb_garbage_collect_tombstones()
This will allow it to be specified by the caller when we add python bindings

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-09-01 05:49:14 +02:00
Andrew Bartlett
d894f08ba9 dsdb: Rework more KCC service-specific details out of dsdb_garbage_collect_tombstones()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-09-01 05:49:14 +02:00
Andrew Bartlett
4e0ac09ef6 dsdb: Rework kcc_deleted() into dsdb_garbage_collect_tombstones()
This is so that in a future commit, we can wrap this in python and allow it to be called
from outside the samba server processs.

This requires that we rework the callers and internals to avoid reference to
private data structures of the KCC service.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-09-01 05:49:14 +02:00
Andrew Bartlett
86943313f2 kcc: Wait until the samba_kcc script runs to declare success to the caller
This allows us to tell if this script even executes, without looking in the logs.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-05-28 07:25:07 +02:00
Jelmer Vernooij
5ae9ada3a8 dsdb: Be less verbose when announcing kcc is being invoked.
Change-Id: I94ab7d92e7e4f4311f0b20b1072c3ad05155d068
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-09-27 19:42:36 +02:00
Volker Lendecke
7c2b5e77b0 Use GUID_equal in a few places
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-10 19:19:13 +02:00
Matthieu Patou
972417131d Fix warnings about set but unused variables
Signed-off-by: Matthieu Patou <mat@matws.net>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-20 21:54:06 +10:00
Andrew Bartlett
26bfe70def s4-kcc: Avoid use-after-free of dn and add tmp_ctx
By using a tmp_ctx we are clearer about allocating temporary memory.

Andrew Bartlett
2012-08-17 16:41:26 +02:00
Andrew Bartlett
9566786853 s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dn
As this value is calculated new each time, we need to give it a context to live on.

If the value is the forced value during provision, a reference is taken.

This was responsible for the memory leak in the replication process.  In the
example I was given, this DN appeared in memory 13596 times!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
2012-08-14 10:05:14 +02:00
Matthieu Patou
cf39ef3637 s4-kcc: avoid a false alarm with rodc
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Thu Apr 19 12:32:58 CEST 2012 on sn-devel-104
2012-04-19 12:32:58 +02:00
Dave Craft
0a4746a200 Invocation of samba_kcc from KCC task
Modification to periodic and explicit invocation
paths of the KCC topology generation code.  Managed
via samba_runcmd_send() API.  The samba_kcc script
is invoked if (kccsrv:samba_kcc = true) appears in smb.conf

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-12-08 11:48:17 +11:00
Andrew Tridgell
6356f4c255 s4-kcc: if we are a GC, auto-add partial replicas
when we are a global catalog server, the KCC needs to add partial
replicas for all domain partitions that we don't have copies of
2011-10-04 15:08:57 +11:00
Andrew Tridgell
484fb303ff s4-kcc: fixed _msdcs DNS name
we need to base this DNS name on the forest DNS name for multi-domain
support

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-25 07:39:38 +10:00
Simo Sorce
f364daed22 s4:dsdb: use tevent_ fn names instaed of legacy event_ ones 2011-08-13 09:54:15 -04:00
Dave Craft
c8413b3420 Add kccsrv_add_repsFrom() possibility of NULL res argument
We need the ability to utilize this function in a different
manner.  KCC intra-site topology has already vetted the
replica as being appropriate to produce a repsFrom from.
We do not want kccsrv_add_repsFrom() to produce further
checking as was the case for simple topology.   Thus if
we pass a NULL (res) parameter this extra check will
be skipped.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
4b19415f5b Remove static to allow availability to other KCC files
kccsrv_replica_flags() and
kccsrv_add_repsFrom() need to be available to functions
outside kcc_periodic.c

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10: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
Andrew Tridgell
5b3981acb1 s4-rodc: enable the DRS_GET_ALL_GROUP_MEMBERSHIP flag for RODC replication
see the description of this flag in [MS-DRSR]
2010-11-18 23:12:26 +01:00
Andrew Tridgell
ac0a92b5b3 s4-debug: lowered the debug level of some unimportant messages 2010-11-08 06:16:04 +00:00
Kai Blin
e7358e7582 s4 dsdb kcc: Prefer msDS-hasMasterNCs over hasMasterNCs when replicating 2010-10-23 10:17:05 +00:00
Andrew Tridgell
6e846ca1f3 s4-kcc: remove stale repsTo entries in the KCC
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-02 01:04:17 +00:00
Andrew Tridgell
4d551753d6 s4-kcc: fixed the replica_flags in repsFrom in the kcc
if our calculated replica_flags doesn't match the ones in our repsFrom
then update it

Pair-Programmed-With: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-09-29 22:12:57 -07:00
Andrew Tridgell
d2008fbbb9 s4-kcc: the kcc should not be setting the repsTo attribute
repsTo is set by other DCs, when they ask to be notified about changes
in a partition
2010-09-23 07:17:57 +00:00
Andrew Tridgell
d1cbd68bb1 s4-kcc: added service->am_rodc
use a rodc flag on the service instead of calling samdb_rodc each time
2010-09-23 07:17:57 +00:00
Andrew Tridgell
59951163be s4-kcc: a bit more debug info on repsFrom creation
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-20 15:27:45 -07:00
Kamen Mazdrashki
4f5dd3f93b s4-dreplsrv: Do allocations on long-living context so that callback gets called 2010-09-09 18:26:51 +03:00
Stefan Metzmacher
ff0362fc35 s4:dsdb/kcc: use irpc_binding_handle_by_name()
metze
2010-09-03 17:00:19 +02:00
Kamen Mazdrashki
b5ed9c2c4d s4-kcc: Notify dreplsrv that Topology has changed 2010-08-28 23:38:59 +03:00
Kamen Mazdrashki
a052497c74 s4-kcc: Assert when unexpected repsFromToBlob version is passed
At present we only support v1 structures (Win2k3 and earlier),
so it is good to make it obvious.
In case we start supporting v2 we will be able to notice this
function should be refactored right away
2010-08-28 23:38:58 +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
Matthias Dieter Wallnöfer
8219c4f69c s4:kcc_periodic.c - fix counter types
We are counting LDB objects here -> therefore "unsigned"
2010-04-27 08:19:10 +02:00
Andrew Tridgell
b0aa476948 s4-drs: add entries to repsTo based on calculated repsFrom
This is based on the documentation: "the KCC will automatically create
the Reps-To attributes on destination DSAs based on other DSAs
Reps-From entries."
2010-04-27 10:38:59 +10:00
Andrew Tridgell
3119296e42 s4-drepl: don't setup a repsFrom from a DC that isn't a master for a NC
use hasMasterNCs to see what NCs we should be pulling from each DC
2010-04-27 10:38:59 +10:00
Matthias Dieter Wallnöfer
559575fe40 s4:dsdb/kcc/*.c - fix up wrong typed counters 2010-03-16 08:49:22 +01:00
Matthias Dieter Wallnöfer
6f11818923 s4:kcc - Change some counter variables to be unsigned
The upper limits are unsigned variables therefore also the counter variables
need to be like that.
2010-03-05 13:38:01 +01:00
Andrew Tridgell
f461a72ec3 idl: switched to using the WSPP names for the 'neighbour' DRS options
The documentation shows that all these functions in fact use the same
flags variable type. To be consistent between functions, and to allow
easy reference to the WSPP docs, it is better for us to also use this
generic DrsOptions bitfield rather than one per operations.
2010-01-18 07:25:18 +11:00
Andrew Tridgell
cced567364 s4-kcc: added a preiodic task to remove deleted objects
we check for deleted objects in each partition every 10 minutes, using
onelevel searches
2010-01-02 08:16:56 +11:00
Crístian Deives
1cf48022af s4-drs: add deletion of old connections
the nTDSConnection objects that are not needed anymore will be deleted.
the function kccsrv_delete_connection wasn't tested yet.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 20:22:13 +11:00
Crístian Deives
7ca2ceb333 s4-drs: Create connection obejct (nTDSConnection)
create nTDSConnection objects to match the list of servers

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 20:22:13 +11:00
Erick Nascimento
a3632f22ec s4-drs: DsExecuteKCC() implementation
I implemented the DsExecuteKCC() handling code on kccsrv_execute_kcc().

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-14 12:11:02 +11:00
Matthias Dieter Wallnöfer
e9686985cb s4: Changes the old occurences of "lp_realm" in "lp_dnsdomain" where needed
For KERBEROS applications the realm should be upcase (function "lp_realm") but
for DNS ones it should be used lowcase (function "lp_dnsdomain"). This patch
implements the use of both in the right way.
2009-10-14 10:50:43 +02:00
Andrew Tridgell
4a230b5e6c s4-kcc: fixed corruption of repsFrom records by kcc
We were re-using a stack variable outside of the stack scope
2009-09-28 15:36:10 +10:00