Re: [Freeipa-devel] [PATCH] 312 Fix parsing of long nicknames in certutil -L output

2014-08-07 Thread Petr Viktorin

On 08/04/2014 11:30 AM, Jan Cholasta wrote:

Hi,

the attached patch fixes .

Honza


This fixes the issue for me, ACK, pushed to:
master: 6bb240fa2cf6ce257376241d0a779ca5cc96078e
ipa-4-1: 6bb240fa2cf6ce257376241d0a779ca5cc96078e


It would be nice if you could also add a test.

--
PetrĀ³

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 312 Fix parsing of long nicknames in certutil -L output

2014-08-04 Thread Jan Cholasta

Hi,

the attached patch fixes .

Honza

--
Jan Cholasta
>From 672f0003190ffbbce9987b033959c63b4ea3b629 Mon Sep 17 00:00:00 2001
From: Jan Cholasta 
Date: Mon, 4 Aug 2014 11:13:25 +0200
Subject: [PATCH] Fix parsing of long nicknames in certutil -L output.

https://fedorahosted.org/freeipa/ticket/4453
---
 ipaserver/install/certs.py | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py
index f958e36..6569f51 100644
--- a/ipaserver/install/certs.py
+++ b/ipaserver/install/certs.py
@@ -137,10 +137,9 @@ class NSSDatabase(object):
 # FIXME, this relies on NSS never changing the formatting of certutil
 certlist = []
 for cert in certs:
-nickname = cert[0:61]
-trust = cert[61:]
-if re.match(r'\w*,\w*,\w*', trust):
-certlist.append((nickname.strip(), trust.strip()))
+match = re.match(r'^(.+?)\s+(\w*,\w*,\w*)\s*$', cert)
+if match:
+certlist.append(match.groups())
 
 return tuple(certlist)
 
-- 
1.9.3

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel