URL: https://github.com/freeipa/freeipa/pull/321
Author: jcholast
 Title: #321: certdb: fix PKCS#12 import with empty password
Action: opened

PR body:
"""
Since commit f919ab4ee0ec26d77ee6978e75de5daba4073402, a temporary file is
used to give passwords to pk12util. When a password is empty, the temporary
will be empty as well, which pk12util does not like.

Add new line after the password in the temporary file to please pk12util.

https://fedorahosted.org/freeipa/ticket/6541
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/321/head:pr321
git checkout pr321
From 5fdd380fce3ad6527a5a980f723f6552f0a70a9d Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Thu, 8 Dec 2016 12:26:06 +0100
Subject: [PATCH] certdb: fix PKCS#12 import with empty password

Since commit f919ab4ee0ec26d77ee6978e75de5daba4073402, a temporary file is
used to give passwords to pk12util. When a password is empty, the temporary
will be empty as well, which pk12util does not like.

Add new line after the password in the temporary file to please pk12util.

https://fedorahosted.org/freeipa/ticket/6541
---
 ipapython/certdb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipapython/certdb.py b/ipapython/certdb.py
index af98a77..4e05b78 100644
--- a/ipapython/certdb.py
+++ b/ipapython/certdb.py
@@ -168,7 +168,7 @@ def import_pkcs12(self, pkcs12_filename, db_password_filename,
                 "-k", db_password_filename, '-v']
         pkcs12_password_file = None
         if pkcs12_passwd is not None:
-            pkcs12_password_file = ipautil.write_tmp_file(pkcs12_passwd)
+            pkcs12_password_file = ipautil.write_tmp_file(pkcs12_passwd + '\n')
             args = args + ["-w", pkcs12_password_file.name]
         try:
             ipautil.run(args)
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to