mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Ask the user before overwriting /etc/named.conf
This commit is contained in:
@@ -251,10 +251,8 @@ def check_dirsrv():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def check_bind():
|
def check_bind():
|
||||||
if not bindinstance.check_inst():
|
if not bindinstance.check_inst(unattended=True):
|
||||||
print "--setup-dns was specified but bind or the BIND LDAP plug-in"
|
print "Aborting installation"
|
||||||
print "is not installed on the system"
|
|
||||||
print "Please install bind and the LDAP plug-in and restart the setup program"
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@@ -541,10 +541,8 @@ def main():
|
|||||||
|
|
||||||
# check bind packages are installed
|
# check bind packages are installed
|
||||||
if options.setup_dns:
|
if options.setup_dns:
|
||||||
if not bindinstance.check_inst():
|
if not bindinstance.check_inst(options.unattended):
|
||||||
print "--setup-dns was specified but bind or the BIND LDAP plug-in"
|
print "Aborting installation"
|
||||||
print "is not installed on the system"
|
|
||||||
print "Please install bind and the LDAP plug-in and restart the setup program"
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if options.ca:
|
if options.ca:
|
||||||
|
@@ -30,17 +30,25 @@ from ipapython import sysrestore
|
|||||||
from ipapython import ipautil
|
from ipapython import ipautil
|
||||||
from ipalib import api, util
|
from ipalib import api, util
|
||||||
|
|
||||||
def check_inst():
|
def check_inst(unattended):
|
||||||
# So far this file is always present in both RHEL5 and Fedora if all the necessary
|
# So far this file is always present in both RHEL5 and Fedora if all the necessary
|
||||||
# bind packages are installed (RHEL5 requires also the pkg: caching-nameserver)
|
# bind packages are installed (RHEL5 requires also the pkg: caching-nameserver)
|
||||||
if not os.path.exists('/etc/named.rfc1912.zones'):
|
if not os.path.exists('/etc/named.rfc1912.zones'):
|
||||||
|
print "BIND was not found on this system"
|
||||||
|
print "Please install the bind package and start the installation again"
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Also check for the LDAP BIND plug-in
|
# Also check for the LDAP BIND plug-in
|
||||||
if not os.path.exists('/usr/lib/bind/ldap.so') and \
|
if not os.path.exists('/usr/lib/bind/ldap.so') and \
|
||||||
not os.path.exists('/usr/lib64/bind/ldap.so'):
|
not os.path.exists('/usr/lib64/bind/ldap.so'):
|
||||||
|
print "The BIND LDAP plug-in was not found on this system"
|
||||||
|
print "Please install the bind-dyndb-ldap package and start the installation again"
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if not unattended and os.path.exists('/etc/named.conf'):
|
||||||
|
msg = "Existing BIND configuration detected, overwrite?"
|
||||||
|
return ipautil.user_input(msg, False)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class BindInstance(service.Service):
|
class BindInstance(service.Service):
|
||||||
|
Reference in New Issue
Block a user