Hi,
in my fix for <https://fedorahosted.org/freeipa/ticket/2932> I have
accidentally changed the behavior of user and host commands to always
show full SSH public keys in their output. The attached patch fixes this.
Honza
--
Jan Cholasta
>From 9753731152c47fb82f83106dfe16a2b710957291 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Thu, 11 Oct 2012 04:26:56 -0400
Subject: [PATCH] Do not show full SSH public keys in command output by
default.
---
ipalib/util.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ipalib/util.py b/ipalib/util.py
index ca14aee..3fe5c9f 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -296,7 +296,7 @@ def validate_sshpubkey_no_options(ugettext, value):
def convert_sshpubkey_post(ldap, dn, entry_attrs):
if 'ipasshpubkey' in entry_attrs:
- pubkeys = entry_attrs.pop('ipasshpubkey')
+ pubkeys = entry_attrs['ipasshpubkey']
else:
old_entry_attrs = ldap.get_entry(dn, ['ipasshpubkey'])
pubkeys = old_entry_attrs[1].get('ipasshpubkey')
@@ -320,8 +320,8 @@ def convert_sshpubkey_post(ldap, dn, entry_attrs):
newpubkeys.append(pubkey.openssh())
fingerprints.append(fp)
- if newpubkeys:
- entry_attrs['ipasshpubkey'] = newpubkeys
+ if 'ipasshpubkey' in entry_attrs:
+ entry_attrs['ipasshpubkey'] = newpubkeys or None
if fingerprints:
entry_attrs['sshpubkeyfp'] = fingerprints
--
1.7.11.4
_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel