summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie McClelland <jm@mayfirst.org>2008-08-05 15:03:44 -0400
committerJamie McClelland <jm@mayfirst.org>2008-08-05 15:03:44 -0400
commit1196cb0515aae9304a366e21ec9dd62ec2513d23 (patch)
tree6b0f5d2cd9d3cf1396aa6d520446927d85dc4110
parent1b4c351078262b3b35384545a72e5bfa815f7e04 (diff)
parenta7e520c59cf969192baf16147d570c9a9365c191 (diff)
Merge commit 'dkg/master'
-rwxr-xr-xsrc/seckey2sshagent7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/seckey2sshagent b/src/seckey2sshagent
index b7b7ec2..4b765dc 100755
--- a/src/seckey2sshagent
+++ b/src/seckey2sshagent
@@ -67,8 +67,13 @@ trap cleanup EXIT
GPGIDS="$1"
if [ -z "$GPGIDS" ]; then
+ # hack: we need to get the list of secret keys, because if you
+ # --list-secret-keys with no arguments, GPG fails to print the
+ # capability flags (i've just filed this as
+ # https://bugs.g10code.com/gnupg/issue945)
+ KEYIDS=$(gpg2 --with-colons --list-secret-keys | grep ^sec | cut -f5 -d:)
# default to using all fingerprints of authentication-enabled keys
- GPGIDS=$(gpg --with-colons --fingerprint --fingerprint --list-secret-keys | egrep -A1 '^(ssb|sec):.*:[^:]*a[^:]*:$' | grep ^fpr: | cut -d: -f10)
+ GPGIDS=$(gpg --with-colons --fingerprint --fingerprint --list-secret-keys $KEYIDS | egrep -A1 '^(ssb|sec):.*:[^:]*a[^:]*:$' | grep ^fpr: | cut -d: -f10)
fi
for GPGID in $GPGIDS; do