summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/installutils.py
diff options
context:
space:
mode:
authorRob Crittenden <rcrit@ipa.greyoak.com>2008-07-11 11:34:29 -0400
committerRob Crittenden <rcrit@ipa.greyoak.com>2008-07-14 09:06:52 -0400
commit6980b073035cdd43b30b58aba3ce7f84f16a14ad (patch)
tree2e291b420d42ad02df9221fb4036bb22698463df /ipa-server/ipaserver/installutils.py
parentb95c05f5c6a9977e6bb02d091a601efb3bcf360e (diff)
downloadfreeipa-6980b073035cdd43b30b58aba3ce7f84f16a14ad.tar.gz
freeipa-6980b073035cdd43b30b58aba3ce7f84f16a14ad.tar.xz
freeipa-6980b073035cdd43b30b58aba3ce7f84f16a14ad.zip
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
Diffstat (limited to 'ipa-server/ipaserver/installutils.py')
-rw-r--r--ipa-server/ipaserver/installutils.py18
1 files changed, 18 insertions, 0 deletions
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])