Don't assume that the Firefox autoconfig files exist.

These are created by an object-signing cert and needs to be done
after the fact if a server is created with user-supplied PKCS#12 files.

452402
This commit is contained in:
Rob Crittenden 2008-07-25 16:56:42 -04:00
parent 9f2ee29218
commit cf06dd9f84
2 changed files with 14 additions and 11 deletions

View File

@ -131,14 +131,15 @@ def install_http(config):
http.create_instance(config.realm_name, config.host_name, config.domain_name, False, pkcs12_info) http.create_instance(config.realm_name, config.host_name, config.domain_name, False, pkcs12_info)
# Now copy the autoconfiguration files # Now copy the autoconfiguration files
try: if ipautil.file_exists(config.dir + "/preferences.html"):
shutil.copy(config.dir + "/preferences.html", "/usr/share/ipa/html/preferences.html") try:
shutil.copy(config.dir + "/configure.jar", "/usr/share/ipa/html/configure.jar") shutil.copy(config.dir + "/preferences.html", "/usr/share/ipa/html/preferences.html")
shutil.copy(config.dir + "/ca.crt", "/usr/share/ipa/html/ca.crt") shutil.copy(config.dir + "/configure.jar", "/usr/share/ipa/html/configure.jar")
os.chmod("/usr/share/ipa/html/ca.crt", 0444) shutil.copy(config.dir + "/ca.crt", "/usr/share/ipa/html/ca.crt")
except Exception, e: os.chmod("/usr/share/ipa/html/ca.crt", 0444)
print "error copying files: " + str(e) except Exception, e:
sys.exit(1) print "error copying files: " + str(e)
sys.exit(1)
def check_dirsrv(): def check_dirsrv():
serverids = dsinstance.check_existing_installation() serverids = dsinstance.check_existing_installation()

View File

@ -150,12 +150,14 @@ def save_config(dir, realm_name, host_name, ds_user, domain_name):
def copy_files(realm_name, dir): def copy_files(realm_name, dir):
config_dir = dsinstance.config_dirname(dsinstance.realm_to_serverid(realm_name)) config_dir = dsinstance.config_dirname(dsinstance.realm_to_serverid(realm_name))
try: try:
shutil.copy("/var/kerberos/krb5kdc/ldappwd", dir + "/ldappwd") shutil.copy("/var/kerberos/krb5kdc/ldappwd", dir + "/ldappwd")
shutil.copy("/var/kerberos/krb5kdc/kpasswd.keytab", dir + "/kpasswd.keytab") shutil.copy("/var/kerberos/krb5kdc/kpasswd.keytab", dir + "/kpasswd.keytab")
shutil.copy("/usr/share/ipa/html/preferences.html", dir + "/preferences.html") if ipautil.file_exists("/usr/share/ipa/html/preferences.html"):
shutil.copy("/usr/share/ipa/html/configure.jar", dir + "/configure.jar") shutil.copy("/usr/share/ipa/html/preferences.html", dir + "/preferences.html")
shutil.copy(config_dir + "/cacert.asc", dir + "/ca.crt") shutil.copy("/usr/share/ipa/html/configure.jar", dir + "/configure.jar")
shutil.copy(config_dir + "/cacert.asc", dir + "/ca.crt")
except Exception, e: except Exception, e:
print "error copying files: " + str(e) print "error copying files: " + str(e)
sys.exit(1) sys.exit(1)