From 82d758a25428509963ddb2a8f7db05c74348c628 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 14 Jul 2009 01:51:18 -0400 Subject: fixing find_host_userid -- did this ever work? --- src/monkeysphere-host | 6 +++--- src/share/mh/add_hostname | 2 +- src/share/mh/revoke_hostname | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index d498065..2bef23c 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -141,13 +141,13 @@ find_host_userid() { local tmpuidMatch local line - # match to only ultimately trusted user IDs - tmpuidMatch="u:$(echo $userID | gpg_escape)" + # match to only "unknown" user IDs (host has no need for ultimate trust) + tmpuidMatch="-:$(echo $userID | gpg_escape)" # find the index of the requsted user ID # NOTE: this is based on circumstantial evidence that the order of # this output is the appropriate index - line=$(gpg_host_list | egrep '^(uid|uat):' | cut -f2,10 -d: | \ + line=$(gpg_host_list | egrep '^uid:' | cut -f2,10 -d: | \ grep -n -x -F "$tmpuidMatch" 2>/dev/null) if [ "$line" ] ; then diff --git a/src/share/mh/add_hostname b/src/share/mh/add_hostname index 9df5eec..37cfd3c 100644 --- a/src/share/mh/add_hostname +++ b/src/share/mh/add_hostname @@ -28,7 +28,7 @@ fi userID="ssh://${1}" # test that the desired user ID does not already exist -find_host_userid > /dev/null && \ +find_host_userid "$userID" > /dev/null && \ failure "Host userID '$userID' already exists." if [ "$PROMPT" = "true" ] ; then diff --git a/src/share/mh/revoke_hostname b/src/share/mh/revoke_hostname index 7e4d573..b139cee 100644 --- a/src/share/mh/revoke_hostname +++ b/src/share/mh/revoke_hostname @@ -30,7 +30,7 @@ fi userID="ssh://${1}" # make sure the user ID to revoke -uidIndex=$(find_host_userid) || \ +uidIndex=$(find_host_userid "$userID") || \ failure "No non-revoked user ID found matching '$userID'." if [ "$PROMPT" = "true" ] ; then -- cgit v1.2.3