more replacement of read -p with printf; read (re #446)
[monkeysphere.git] / src / share / mh / publish_key
index 05faa0be25e55b9a7e1ea7ce9c2bdda00370a09e..f6e1c0f9b322cfaf3f623767189691d053c6d4a8 100644 (file)
@@ -18,7 +18,8 @@ publish_key() {
 local GNUPGHOME
 
 if [ "$PROMPT" = "true" ] ; then
-    read -p "Really publish host key to $KEYSERVER? (Y/n) " OK; OK=${OK:=Y}
+    printf "Really publish host key to $KEYSERVER? (Y/n) " >&2
+    read OK; OK=${OK:=Y}
     if [ "${OK/y/Y}" != 'Y' ] ; then
        failure "key not published."
     fi
@@ -28,6 +29,8 @@ fi
 
 # create a temporary gnupg directory from which to publish the key
 export GNUPGHOME=$(msmktempdir)
+chmod 0700 "$GNUPGHOME"
+chown "$MONKEYSPHERE_USER":"$MONKEYSPHERE_USER" "$GNUPGHOME"
 
 # trap to remove tmp dir if break
 trap "rm -rf $GNUPGHOME" EXIT