From 6980b073035cdd43b30b58aba3ce7f84f16a14ad Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 11 Jul 2008 11:34:29 -0400 Subject: Rework the way SSL certificates are imported from PKCS#12 files. Add the ability to provide PKCS#12 files during initial installation Add the ability to provide PKCS#12 files when preparing a replica Correct some issues with ipa-server-certinstall 452402 --- ipa-server/ipaserver/installutils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ipa-server/ipaserver/installutils.py') diff --git a/ipa-server/ipaserver/installutils.py b/ipa-server/ipaserver/installutils.py index ee3c1c77..674cf7d0 100644 --- a/ipa-server/ipaserver/installutils.py +++ b/ipa-server/ipaserver/installutils.py @@ -200,6 +200,24 @@ def update_file(filename, orig, subst): print "File %s doesn't exist." % filename return 1 +def set_directive(filename, directive, value): + """Set a name/value pair directive in a configuration file. + + This has only been tested with nss.conf + """ + fd = open(filename) + file = [] + for line in fd: + if directive in line: + file.append('%s "%s"\n' % (directive, value)) + else: + file.append(line) + fd.close() + + fd = open(filename, "w") + fd.write("".join(file)) + fd.close() + def kadmin(command): ipautil.run(["/usr/kerberos/sbin/kadmin.local", "-q", command]) -- cgit