|
|
403b09 |
From 95a8519afa82707c8d3b2e60f65cbc4d79d144e2 Mon Sep 17 00:00:00 2001
|
|
|
403b09 |
From: Jan Cholasta <jcholast@redhat.com>
|
|
|
403b09 |
Date: Wed, 7 Sep 2016 08:06:10 +0200
|
|
|
403b09 |
Subject: [PATCH] cert: fix cert-find --certificate when the cert is not in
|
|
|
403b09 |
LDAP
|
|
|
403b09 |
|
|
|
403b09 |
Always return the cert specified in --certificate in cert-find result, even
|
|
|
403b09 |
when the cert is not found in LDAP.
|
|
|
403b09 |
|
|
|
403b09 |
https://fedorahosted.org/freeipa/ticket/6304
|
|
|
403b09 |
|
|
|
403b09 |
Reviewed-By: David Kupka <dkupka@redhat.com>
|
|
|
403b09 |
---
|
|
|
403b09 |
ipaserver/plugins/cert.py | 12 +++++-------
|
|
|
403b09 |
1 file changed, 5 insertions(+), 7 deletions(-)
|
|
|
403b09 |
|
|
|
403b09 |
diff --git a/ipaserver/plugins/cert.py b/ipaserver/plugins/cert.py
|
|
|
403b09 |
index 6495bf1491f939a032fad03fe4ef86839c0575ef..00bae4560d601e28e0b983786bff9144bcc1b065 100644
|
|
|
403b09 |
--- a/ipaserver/plugins/cert.py
|
|
|
403b09 |
+++ b/ipaserver/plugins/cert.py
|
|
|
403b09 |
@@ -1142,17 +1142,15 @@ class cert_find(Search, CertMethod):
|
|
|
403b09 |
rule)
|
|
|
403b09 |
filters.append(filter)
|
|
|
403b09 |
|
|
|
403b09 |
- cert = options.get('certificate')
|
|
|
403b09 |
- if cert is not None:
|
|
|
403b09 |
- filter = ldap.make_filter_from_attr('usercertificate', cert)
|
|
|
403b09 |
- filters.append(filter)
|
|
|
403b09 |
-
|
|
|
403b09 |
result = collections.OrderedDict()
|
|
|
403b09 |
complete = bool(filters)
|
|
|
403b09 |
|
|
|
403b09 |
- if cert is None:
|
|
|
403b09 |
+ cert = options.get('certificate')
|
|
|
403b09 |
+ if cert is not None:
|
|
|
403b09 |
+ filter = ldap.make_filter_from_attr('usercertificate', cert)
|
|
|
403b09 |
+ else:
|
|
|
403b09 |
filter = '(usercertificate=*)'
|
|
|
403b09 |
- filters.append(filter)
|
|
|
403b09 |
+ filters.append(filter)
|
|
|
403b09 |
|
|
|
403b09 |
filter = ldap.combine_filters(filters, ldap.MATCH_ALL)
|
|
|
403b09 |
try:
|
|
|
403b09 |
--
|
|
|
403b09 |
2.7.4
|
|
|
403b09 |
|