samba_upgradedns: Print better hints after we migrated the config
authorAndreas Schneider <asn@samba.org>
Wed, 6 Sep 2017 05:25:40 +0000 (07:25 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 15 Sep 2017 22:57:25 +0000 (00:57 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12957

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/scripting/bin/samba_upgradedns

index db3ef5c6d6545889adf47c5fd5b732950437088e..3369bcfed930fe1c67d772924117e456cf5aa2be 100755 (executable)
@@ -442,6 +442,12 @@ if __name__ == '__main__':
 
     # Special stuff for DLZ backend
     if opts.dns_backend == "BIND9_DLZ":
+        config_migration = False
+
+        if (paths.private_dir != paths.binddns_dir and
+            os.path.isfile(os.path.join(paths.private_dir, "named.conf"))):
+            config_migration = True
+
         # Check if dns-HOSTNAME account exists and create it if required
         secrets_msgs = ldbs.secrets.search(expression='(samAccountName=dns-%s)' % hostname, attrs=['secret'])
         msg = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT,
@@ -537,9 +543,15 @@ if __name__ == '__main__':
 
         cleanup_obsolete_dns_files(paths)
 
-        logger.info("See %s for an example configuration include file for BIND", paths.namedconf)
-        logger.info("and %s for further documentation required for secure DNS "
-                    "updates", paths.namedtxt)
+        if config_migration:
+            logger.info("ATTENTION: The BIND configuration and keytab has been moved to: %s",
+                        paths.binddns_dir)
+            logger.info("           Please update your BIND configuration accordingly.")
+        else:
+            logger.info("See %s for an example configuration include file for BIND", paths.namedconf)
+            logger.info("and %s for further documentation required for secure DNS "
+                        "updates", paths.namedtxt)
+
     elif opts.dns_backend == "SAMBA_INTERNAL":
         # Check if dns-HOSTNAME account exists and delete it if required
         try: