diff options
| author | Jan Cholasta <jcholast@redhat.com> | 2016-09-07 08:06:10 +0200 |
|---|---|---|
| committer | David Kupka <dkupka@redhat.com> | 2016-09-07 12:46:35 +0200 |
| commit | b7b6faf14aaa8ac677ab9ebc2bcbf87e6b2a1146 (patch) | |
| tree | cdbc056533e6a4dc734a9c872681bc57e3245a72 /ipaserver/plugins | |
| parent | c7e0dbc4e174d0bb7577de18cdb2f414f4199c57 (diff) | |
| download | freeipa-b7b6faf14aaa8ac677ab9ebc2bcbf87e6b2a1146.tar.gz freeipa-b7b6faf14aaa8ac677ab9ebc2bcbf87e6b2a1146.tar.xz freeipa-b7b6faf14aaa8ac677ab9ebc2bcbf87e6b2a1146.zip | |
cert: fix cert-find --certificate when the cert is not in LDAP
Always return the cert specified in --certificate in cert-find result, even
when the cert is not found in LDAP.
https://fedorahosted.org/freeipa/ticket/6304
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
| -rw-r--r-- | ipaserver/plugins/cert.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ipaserver/plugins/cert.py b/ipaserver/plugins/cert.py index 6195a6b1e..8da18697f 100644 --- a/ipaserver/plugins/cert.py +++ b/ipaserver/plugins/cert.py @@ -1266,17 +1266,15 @@ class cert_find(Search, CertMethod): rule) filters.append(filter) - cert = options.get('certificate') - if cert is not None: - filter = ldap.make_filter_from_attr('usercertificate', cert) - filters.append(filter) - result = collections.OrderedDict() complete = bool(filters) - if cert is None: + cert = options.get('certificate') + if cert is not None: + filter = ldap.make_filter_from_attr('usercertificate', cert) + else: filter = '(usercertificate=*)' - filters.append(filter) + filters.append(filter) filter = ldap.combine_filters(filters, ldap.MATCH_ALL) try: |
