summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-13 10:31:15 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-13 12:51:05 +0200
commit182fd31be57907e252c86506b1c2dac5c40fe244 (patch)
tree3b2404640098956c2a1defe8491aacd3ab2e859c
parentafe4b77d35a95d2338094b8cbc96ca421a023413 (diff)
downloadsamba-182fd31be57907e252c86506b1c2dac5c40fe244.tar.gz
samba-182fd31be57907e252c86506b1c2dac5c40fe244.tar.xz
samba-182fd31be57907e252c86506b1c2dac5c40fe244.zip
s4-provision: fixed the GUIDs in the provision using dbcheck
some DNs are are not setup with GUIDs during the provision because of circular dependencies between objects. This adds a dbcheck pass to the provision to fix those DNs Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/scripting/python/samba/provision/__init__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 71979406b23..66dcf6a40bf 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -80,6 +80,8 @@ import samba.param
import samba.registry
from samba.schema import Schema
from samba.samdb import SamDB
+from samba.dbchecker import dbcheck
+
VALID_NETBIOS_CHARS = " !#$%&'()-.@^_{}~"
DEFAULT_POLICY_GUID = "31B2F340-016D-11D2-945F-00C04FB984F9"
@@ -1835,6 +1837,20 @@ def provision(logger, session_info, credentials, smbconf=None,
logger.info("Failed to chown %s to bind gid %u",
dns_keytab_path, paths.bind_gid)
+ # fix any dangling GUIDs from the provision
+ logger.info("Fixing provision GUIDs")
+ chk = dbcheck(samdb, samdb_schema=samdb, verbose=False, fix=True, yes=True, quiet=True)
+ samdb.transaction_start()
+ chk.check_database(DN=None, controls=["search_options:1:2", "show_deleted:1"],
+ attrs=['defaultObjectCategory',
+ 'objectCategory',
+ 'ipsecOwnersReference',
+ 'ipsecFilterReference',
+ 'ipsecISAKMPReference',
+ 'ipsecNegotiationPolicyReference',
+ 'ipsecNFAReference'])
+ samdb.transaction_commit()
+
logger.info("Please install the phpLDAPadmin configuration located at %s into /etc/phpldapadmin/config.php",
paths.phpldapadminconfig)