add trap to remove temp dir in list_primary_fingerprints function
authorJameson Rollins <jrollins@finestructure.net>
Fri, 15 Jan 2010 23:34:01 +0000 (18:34 -0500)
committerJameson Rollins <jrollins@finestructure.net>
Fri, 15 Jan 2010 23:34:01 +0000 (18:34 -0500)
src/share/common

index 7bacd4e7dca30d5f9dd29bd9b0f129c6c7ac73ba..914fffa5e9536d69365deab301aba75899812b71 100644 (file)
@@ -1177,9 +1177,11 @@ process_authorized_user_ids() {
 # fingerprints, one per line:
 list_primary_fingerprints() {
     local fake=$(msmktempdir)
+    trap "rm -rf $fake" EXIT
     GNUPGHOME="$fake" gpg --no-tty --quiet --import
     GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys | \
        awk -F: '/^fpr:/{ print $10 }'
+    trap - EXIT
     rm -rf "$fake"
 }