summaryrefslogtreecommitdiff
path: root/source4/dsdb/kcc
Commit message (Collapse)AuthorAgeFilesLines
* source4/smbd: refactor the process model for preforkGary Lockyer2017-10-191-1/+5
| | | | | | | | | | | | | | | | | | Refactor the process model code to allow the addition of a prefork process model. - Add a process context to contain process model specific state - Add a service details structure to allow service to indicate which process model options they can support. In the new code the services advertise the features they support to the process model. The process model context is plumbed through to allow the process model to keep track of the supported options, and any state the process model may require. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* kcc: Remove unused, untested KCC codeGarming Sam2017-09-202-3565/+0
| | | | | | | | | | | | | | | | This code tries to implement the full KCC algorithm, but never actually worked correctly. Removing this doesn't affect the full-mesh KCC. This code only attempted to calculate a graph using the "proper" algorithm, though it neglected to write its results back into the database. The full-mesh calculation occurs elsewhere. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Sep 20 06:28:07 CEST 2017 on sn-devel-144
* s4:kcc: Add a NULL check before qsort()Andreas Schneider2017-07-241-0/+4
| | | | | | | | | This fixes building with GCC 7.1.1 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12930 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* repl: Set GET_ALL_GROUP_MEMBERSHIP flag in the drepl serverGarming Sam2017-06-151-1/+0
| | | | | | | | | | | | 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
* s4: Add TALLOC_CTX * to register_server_service().Jeremy Allison2017-05-111-1/+1
| | | | | | | | Use the passed in context from callers. Remove one talloc_autofree_context(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison2017-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
* s4-kcc: Do not dereference a NULL pointerAndreas Schneider2017-02-231-1/+3
| | | | | | | | | Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* collect_tombstones: Allow links to recycled objects to be deletedGarming Sam2016-11-031-2/+3
| | | | | | | | | | | | | | | | The reason we choose to provide the string DN is because extended_dn_in will try to correct the <GUID=...> by searching on it (despite the fact it does not exist and then failing on a ldb_dn_validate in objectclass_attrs). We can now also remove the dangling link test from the knownfail. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12385 Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Nov 3 01:46:43 CET 2016 on sn-devel-144
* werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source4/dsdb/Günther Deschner2016-09-281-1/+1
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* copyright: Add the missing notices for garbage collect tombstonesBob Campbell2016-09-051-0/+2
| | | | | | | | | | Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz> 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): Mon Sep 5 08:14:26 CEST 2016 on sn-devel-144
* dsdb: refactor part of garbage_collect_tombstones into new functionBob Campbell2016-09-051-169/+216
| | | | | | | | | Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* kcc: Fix a -Werror,-Wformat-security errorVolker Lendecke2016-09-021-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Sep 2 13:54:45 CEST 2016 on sn-devel-144
* gc_tombstones: Typo fixGarming Sam2016-09-011-1/+1
| | | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglasbagnall@catalyst.net.nz> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Thu Sep 1 09:38:47 CEST 2016 on sn-devel-144
* dsdb: Do not check isDeleted as a possible linkAndrew Bartlett2016-09-011-0/+5
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Add comments to dsdb_garbage_collect_tombstones()Andrew Bartlett2016-09-011-1/+29
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Use a date comparison in the search to avoid returning all deleted objectsAndrew Bartlett2016-09-011-24/+20
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Expose ldb error string to dsdb_garbage_collect_tombstones() callersAndrew Bartlett2016-09-013-7/+12
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Expand garbage_collect_tombstones to expunge links alsoAndrew Bartlett2016-09-013-58/+214
| | | | | | | | | 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>
* dsdb: move tombstone lifetime calculation out of ↵Andrew Bartlett2016-09-013-10/+14
| | | | | | | | | 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>
* dsdb: Rework more KCC service-specific details out of ↵Andrew Bartlett2016-09-013-32/+32
| | | | | | | dsdb_garbage_collect_tombstones() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Rework kcc_deleted() into dsdb_garbage_collect_tombstones()Andrew Bartlett2016-09-015-52/+79
| | | | | | | | | | | 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>
* kcc: Move kcc/kcc_deleted.c into kcc/garbage_collect_tombstones.cAndrew Bartlett2016-09-012-1/+3
| | | | | | | This is in preperation for a python binding for this function Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* AddressSanitizer: Initialize for kcc_topology.cGarming Sam2016-07-251-2/+2
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
* samba_kcc: Enable the python samba_kccGarming Sam2016-07-211-1/+1
| | | | | | | | For any reasonably large domain, the old KCC is impractical as the dense mesh topology causes replication pulses. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-kcc: Fix compiler errors when building with --address-sanitizerAndrew Bartlett2016-06-161-2/+5
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dlist: remove unneeded type argument from DLIST_ADD_END()Michael Adam2016-02-061-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Avoid including libds/common/roles.h in public loadparm.h header.Jelmer Vernooij2016-01-131-0/+1
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-By: Andrew Bartlett <abartlet@samba.org> Reviewed-By: Stefan Metzmacher <metze@samba.org>
* kcc: Wait until the samba_kcc script runs to declare success to the callerAndrew Bartlett2015-05-282-10/+100
| | | | | | | 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>
* Fix the O3 developer buildVolker Lendecke2015-03-031-4/+5
| | | | | | | | | | Different gcc versions complain at different places Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Mar 3 13:14:53 CET 2015 on sn-devel-104
* Fix the developer O3 buildVolker Lendecke2015-02-251-1/+1
| | | | | | | | 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
* dsdb: Be less verbose when announcing kcc is being invoked.Jelmer Vernooij2014-09-271-1/+1
| | | | | | Change-Id: I94ab7d92e7e4f4311f0b20b1072c3ad05155d068 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/kcc: use SHOW_RECYCLED instead of SHOW_DELETED in when deleting ↵Stefan Metzmacher2014-07-091-1/+1
| | | | | | | | | | | tombstone/deleted objects SHOW_RECYCLED implies SHOW_DELETED. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10694 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Use GUID_equal in a few placesVolker Lendecke2014-06-102-5/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb: Make it harder to corrupt the database by requiring DBCHECK or RELAX ↵Andrew Bartlett2014-05-031-1/+1
| | | | | | | | | | | | | | | for final object deletion This kind of deletion can cause us to then replicate back a partial object. We allow dbcheck to directly remove totally corrupt objects (missing an objectclass) by specifying both DBCHECK and RELAX, and the tombstone sweep after 180 days is done with the RELAX control. Andrew Bartlett Change-Id: Ic21f68e507ba9b65e035ca568430e35e2d001c7d Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Remove the remaining uses of the macro NT_STATUS_HAVE_NO_MEMORY_AND_FREE in ↵Garming Sam2014-03-051-6/+12
| | | | | | | | | | | | | 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: Id1b540cde127395a7b27385a7c0fe79f3a145c73 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>
* Remove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.Garming Sam2014-03-051-25/+100
| | | | | | | | | | | 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>
* dsdb: Allow dsdb_find_dn_by_guid to show deleted DNsAndrew Bartlett2013-06-122-4/+10
| | | | | | | | | This helps us in the KCC as we need to return the deleted DN for the GUID in DsReplicaGetInfo calls (tested for deleted servers against Windows 2008R2). Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Fix warnings about set but unused variablesMatthieu Patou2013-05-202-10/+1
| | | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* drs-replica-info: level_not_supported is wrong when we do support (partialy ↵Matthieu Patou2012-10-071-9/+13
| | | | the level)
* s4-dsdb: Use tmp_ctx in kccsrv_check_deleted to avoid leaking memory onto ↵Andrew Bartlett2012-08-171-6/+11
| | | | | | | | | | | | | | | | | | | part->dn The confusing use of do_dn as a memory context while legitimate created a bug when it was copied and modified to search on a DN from long-term state. By always using a temporary memory context it is clear what paramter is the memory context. This was found based on a log provided by Ricky Nance <ricky.nance@weaubleau.k12.mo.us>. Thanks Ricky! Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Aug 17 18:24:10 CEST 2012 on sn-devel-104
* s4-kcc: Avoid use-after-free of dn and add tmp_ctxAndrew Bartlett2012-08-171-2/+9
| | | | | | By using a tmp_ctx we are clearer about allocating temporary memory. Andrew Bartlett
* s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dnAndrew Bartlett2012-08-143-4/+4
| | | | | | | | | | | | | | 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
* s4-dsdb: Improve memory handling in kccsrv_add_connection()Andrew Bartlett2012-08-141-0/+5
|
* s4-dsdb: Improve memory handling in kccsrv_find_connections() by adding a ↵Andrew Bartlett2012-08-141-4/+15
| | | | tmp_ctx
* lib/param: Create a seperate server role for "active directory domain ↵Andrew Bartlett2012-06-151-1/+1
| | | | | | | | | | | | | | | controller" This will allow us to detect from the smb.conf if this is a Samba4 AD DC which will allow smarter handling of (for example) accidentially starting smbd rather than samba. To cope with upgrades from existing Samba4 installs, 'domain controller' is a synonym of 'active directory domain controller' and new parameters 'classic primary domain controller' and 'classic backup domain controller' are added. Andrew Bartlett
* s4-kcc: avoid a false alarm with rodcMatthieu Patou2012-04-191-0/+7
| | | | | Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Thu Apr 19 12:32:58 CEST 2012 on sn-devel-104
* s4-dsdb: Fix the case for attribute name msDS-hasMasterNCsAmitay Isaacs2012-03-141-2/+2
| | | | | Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Wed Mar 14 11:59:02 CET 2012 on sn-devel-104
* s4-kcc: Remove also deleted objects that are not in the Deleted Object containerMatthieu Patou2011-12-232-2/+38
| | | | | | | | For the configuration container we do a full scan at every run of the kcc-delete service. For the base DN we introduce a new parameter that avoid the full scan to kick just when samba starts. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Invocation of samba_kcc from KCC taskDave Craft2011-12-082-20/+88
| | | | | | | | | 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>
* Add subreq and status to kcc_service structDave Craft2011-12-081-2/+9
| | | | | | | | The subreq and status fields in the kcc_service struct are added for execution management of the external samba_kcc python script. Signed-off-by: Andrew Tridgell <tridge@samba.org>