mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-12 16:32:01 -05:00
Create Firefox configuration extension on CA-less install
Create: * kerberosauth.xpi * krb.js even when --http_pkcs12 option is used. https://fedorahosted.org/freeipa/ticket/3747
This commit is contained in:
1 parent
736dd0fcd6
commit
f5bc155f56
4 files changed
+33
-26
No files matched your search
@@ -216,19 +216,21 @@ def install_http(config, auto_redirect):
|
|||||||
auto_redirect=auto_redirect, ca_file = config.dir + "/ca.crt")
|
auto_redirect=auto_redirect, ca_file = config.dir + "/ca.crt")
|
||||||
|
|
||||||
# Now copy the autoconfiguration files
|
# Now copy the autoconfiguration files
|
||||||
if ipautil.file_exists(config.dir + "/preferences.html"):
|
try:
|
||||||
try:
|
if ipautil.file_exists(config.dir + "/preferences.html"):
|
||||||
shutil.copy(config.dir + "/preferences.html", "/usr/share/ipa/html/preferences.html")
|
shutil.copy(config.dir + "/preferences.html",
|
||||||
shutil.copy(config.dir + "/configure.jar", "/usr/share/ipa/html/configure.jar")
|
"/usr/share/ipa/html/preferences.html")
|
||||||
if ipautil.file_exists(config.dir + "/krb.js"):
|
if ipautil.file_exists(config.dir + "/configure.jar"):
|
||||||
shutil.copy(
|
shutil.copy(config.dir + "/configure.jar",
|
||||||
config.dir + "/krb.js", "/usr/share/ipa/html/krb.js")
|
"/usr/share/ipa/html/configure.jar")
|
||||||
shutil.copy(
|
if ipautil.file_exists(config.dir + "/krb.js"):
|
||||||
config.dir + "/kerberosauth.xpi",
|
shutil.copy(config.dir + "/krb.js",
|
||||||
"/usr/share/ipa/html/kerberosauth.xpi")
|
"/usr/share/ipa/html/krb.js")
|
||||||
except Exception, e:
|
shutil.copy(config.dir + "/kerberosauth.xpi",
|
||||||
print "error copying files: " + str(e)
|
"/usr/share/ipa/html/kerberosauth.xpi")
|
||||||
sys.exit(1)
|
except Exception, e:
|
||||||
|
print "error copying files: " + str(e)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
http.setup_firefox_extension(config.realm_name, config.domain_name)
|
http.setup_firefox_extension(config.realm_name, config.domain_name)
|
||||||
|
|
||||||
|
|||||||
@@ -1103,12 +1103,12 @@ def main():
|
|||||||
http = httpinstance.HTTPInstance(fstore)
|
http = httpinstance.HTTPInstance(fstore)
|
||||||
if options.http_pkcs12:
|
if options.http_pkcs12:
|
||||||
http.create_instance(
|
http.create_instance(
|
||||||
realm_name, host_name, domain_name, dm_password, autoconfig=False,
|
realm_name, host_name, domain_name, dm_password,
|
||||||
pkcs12_info=http_pkcs12_info, subject_base=options.subject,
|
pkcs12_info=http_pkcs12_info, subject_base=options.subject,
|
||||||
auto_redirect=options.ui_redirect, ca_file=ca_file)
|
auto_redirect=options.ui_redirect, ca_file=ca_file)
|
||||||
else:
|
else:
|
||||||
http.create_instance(
|
http.create_instance(
|
||||||
realm_name, host_name, domain_name, dm_password, autoconfig=True,
|
realm_name, host_name, domain_name, dm_password,
|
||||||
subject_base=options.subject, auto_redirect=options.ui_redirect)
|
subject_base=options.subject, auto_redirect=options.ui_redirect)
|
||||||
ipaservices.restore_context("/var/cache/ipa/sessions")
|
ipaservices.restore_context("/var/cache/ipa/sessions")
|
||||||
|
|
||||||
|
|||||||
@@ -313,15 +313,19 @@ class HTTPInstance(service.Service):
|
|||||||
pwd = pwdfile.read()
|
pwd = pwdfile.read()
|
||||||
|
|
||||||
# Setup configure.jar
|
# Setup configure.jar
|
||||||
tmpdir = tempfile.mkdtemp(prefix="tmp-")
|
if db.has_nickname('Signing-Cert'):
|
||||||
target_fname = '/usr/share/ipa/html/configure.jar'
|
tmpdir = tempfile.mkdtemp(prefix="tmp-")
|
||||||
shutil.copy("/usr/share/ipa/html/preferences.html", tmpdir)
|
target_fname = '/usr/share/ipa/html/configure.jar'
|
||||||
db.run_signtool(["-k", "Signing-Cert",
|
shutil.copy("/usr/share/ipa/html/preferences.html", tmpdir)
|
||||||
"-Z", target_fname,
|
db.run_signtool(["-k", "Signing-Cert",
|
||||||
"-e", ".html", "-p", pwd,
|
"-Z", target_fname,
|
||||||
tmpdir])
|
"-e", ".html", "-p", pwd,
|
||||||
shutil.rmtree(tmpdir)
|
tmpdir])
|
||||||
os.chmod(target_fname, 0644)
|
shutil.rmtree(tmpdir)
|
||||||
|
os.chmod(target_fname, 0644)
|
||||||
|
else:
|
||||||
|
root_logger.warning('Object-signing certificate was not found; '
|
||||||
|
'therefore, configure.jar was not created.')
|
||||||
|
|
||||||
self.setup_firefox_extension(self.realm, self.domain, force=True)
|
self.setup_firefox_extension(self.realm, self.domain, force=True)
|
||||||
|
|
||||||
|
|||||||
@@ -338,8 +338,9 @@ class ReplicaPrepare(admintool.AdminTool):
|
|||||||
self.copy_info_file("/usr/share/ipa/html/krb.js", "krb.js")
|
self.copy_info_file("/usr/share/ipa/html/krb.js", "krb.js")
|
||||||
self.copy_info_file(
|
self.copy_info_file(
|
||||||
"/usr/share/ipa/html/kerberosauth.xpi", "kerberosauth.xpi")
|
"/usr/share/ipa/html/kerberosauth.xpi", "kerberosauth.xpi")
|
||||||
self.copy_info_file(
|
jar_filename = "/usr/share/ipa/html/configure.jar"
|
||||||
"/usr/share/ipa/html/configure.jar", "configure.jar")
|
if ipautil.file_exists(jar_filename):
|
||||||
|
self.copy_info_file(jar_filename, "configure.jar")
|
||||||
cacert_filename = "/var/kerberos/krb5kdc/cacert.pem"
|
cacert_filename = "/var/kerberos/krb5kdc/cacert.pem"
|
||||||
if ipautil.file_exists(cacert_filename):
|
if ipautil.file_exists(cacert_filename):
|
||||||
self.copy_info_file(cacert_filename, "cacert.pem")
|
self.copy_info_file(cacert_filename, "cacert.pem")
|
||||||
|
|||||||
Reference in new issue
Block a user