X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fcommon;h=bb988f785e983ad5bcb90492f3390b618ce2c737;hb=1d0c202737a733f958ba0b5c8851f3a3d3de62ca;hp=17955a7a1723e0d861563fcbc79dba73885a981d;hpb=2f89210eb11ccb0a7289f89a545697029b2bb9d7;p=monkeysphere.git diff --git a/src/common b/src/common index 17955a7..bb988f7 100644 --- a/src/common +++ b/src/common @@ -69,11 +69,18 @@ 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' +} + +# convert nasty chars into gpg-friendly form in pipeline +# FIXME: escape everything, not just colons! +gpg_escape() { + sed 's/:/\\x3a/g' } # remove all lines with specified string from specified file @@ -398,7 +405,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