From 8cf936aa9d62f6e8655904375a2d8217f559947a Mon Sep 17 00:00:00 2001
From: Jameson Graef Rollins <jrollins@phys.columbia.edu>
Date: Fri, 15 Aug 2008 13:02:05 -0700
Subject: more work on hostname add/revoke

---
 src/common | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'src/common')

diff --git a/src/common b/src/common
index 17955a7..34c86cb 100644
--- a/src/common
+++ b/src/common
@@ -69,11 +69,12 @@ file_hash() {
     md5sum "$1" 2> /dev/null
 }
 
-# convert escaped characters from gpg output back into original
-# character
-# FIXME: undo all escape character translation in with-colons gpg output
-unescape() {
-    echo "$1" | sed 's/\\x3a/:/g'
+# convert escaped characters in pipeline from gpg output back into
+# original character
+# FIXME: undo all escape character translation in with-colons gpg
+# output
+gpg_unescape() {
+    sed 's/\\x3a/:/g'
 }
 
 # remove all lines with specified string from specified file
@@ -398,7 +399,7 @@ process_user_id() {
 		    continue
 		fi
 		# if the user ID does not match, skip
-		if [ "$(unescape "$uidfpr")" != "$userID" ] ; then
+		if [ "$(echo "$uidfpr" | gpg_unescape)" != "$userID" ] ; then
 		    continue
 		fi
 		# if the user ID validity is not ok, skip
-- 
cgit v1.2.3