Martin^3 Babinsky
From 61b206d62f4dcfc36682724ab6569f8f7fa87b64 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <>
Date: Fri, 15 Apr 2016 17:05:11 +0200
Subject: [PATCH] replica-prepare: do not add PTR records if there is no IPA
 managed reverse zone

ipa-replica-prepare could crash during addition of replica's PTR records if
there was no reverse zone managed by IPA and 'bindinstance.find_reverse_zone'
returns an unhandled None. The code will now issue a warning and skip the PTR
record addition in this case.
 ipaserver/install/ | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ipaserver/install/ b/ipaserver/install/
index 17d20322063fbb6f9d65a2528f9db0b07f486ede..fdd32f0c8437a0d8c3947d57089662ea09bb2304 100644
--- a/ipaserver/install/
+++ b/ipaserver/install/
@@ -520,6 +520,11 @@ class ReplicaPrepare(admintool.AdminTool):
             if not options.no_reverse:
                 reverse_zone = bindinstance.find_reverse_zone(ip)
+                if reverse_zone is None:
+                    self.log.warning(
+                        "Could not find any IPA managed reverse zone. "
+                        "Not creating PTR records")
+                    return
                     add_ptr_rr(reverse_zone, ip_address, self.replica_fqdn)
                 except errors.PublicError as e:

Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA:

Reply via email to