fixing bugs in monkeysphere-server diagnostics.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sat, 13 Sep 2008 20:12:25 +0000 (16:12 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sat, 13 Sep 2008 20:12:25 +0000 (16:12 -0400)
packaging/freebsd/distinfo
src/monkeysphere-server

index 1a3b6c592d0e10e6351fbb02a318520350d50d79..63bc25ed5264858033784f093a65ddc9b9b7141a 100644 (file)
@@ -1,3 +1,3 @@
-MD5 (monkeysphere_0.16~pre.orig.tar.gz) = 7ec79824cf814c618b39e9bf33ff65b1
-SHA256 (monkeysphere_0.16~pre.orig.tar.gz) = bce97a2b2f90bc85b81af374cc0d32dfb23c6b2c1f1b2145f8a4d4a5bb00645b
-SIZE (monkeysphere_0.16~pre.orig.tar.gz) = 58595
+MD5 (monkeysphere_0.16~pre.orig.tar.gz) = 23be1e51f2046652985ff102018549db
+SHA256 (monkeysphere_0.16~pre.orig.tar.gz) = 2caeb5ce39572400f09b66cf5df8d9f6fb7b84b3d0371c532337a29632018340
+SIZE (monkeysphere_0.16~pre.orig.tar.gz) = 58689
index a0dc33f2925fd2b94a47cedc6c6c06d36f59e6a4..7401bf5d7a9cdff6252141ad61667c704651149d 100755 (executable)
@@ -665,7 +665,7 @@ diagnostics() {
                echo " - Recommendation: add a line to $sshd_config: 'HostKey ${VARLIB}/ssh_host_rsa_key'"
                problemsfound=$(($problemsfound+1))
            fi
-           if badhostkeys=$(grep -i '^HostKey' "$sshd_config" | grep -q -v "^HostKey[[:space:]]\+${VARLIB}/ssh_host_rsa_key$") ; then
+           if badhostkeys=$(grep -i '^HostKey' "$sshd_config" | grep -v "^HostKey[[:space:]]\+${VARLIB}/ssh_host_rsa_key$") ; then
                echo "! $sshd_config refers to some non-monkeysphere host keys:"
                echo "$badhostkeys"
                echo " - Recommendation: remove the above HostKey lines from $sshd_config"
@@ -689,8 +689,9 @@ diagnostics() {
     if ! grep -q "^AuthorizedKeysFile[[:space:]]\+${VARLIB}/authorized_keys/%u$" "$sshd_config"; then
        echo "! $sshd_config does not point to monkeysphere authorized keys."
        echo " - Recommendation: add a line to $sshd_config: 'AuthorizedKeysFile ${VARLIB}/authorized_keys/%u'"
+       problemsfound=$(($problemsfound+1))
     fi
-    if badauthorizedkeys=$(grep -i '^AuthorizedKeysFile' "$sshd_config" | grep -q -v "^AuthorizedKeysFile[[:space:]]\+${VARLIB}/authorized_keys/%u$") ; then
+    if badauthorizedkeys=$(grep -i '^AuthorizedKeysFile' "$sshd_config" | grep -v "^AuthorizedKeysFile[[:space:]]\+${VARLIB}/authorized_keys/%u$") ; then
        echo "! $sshd_config refers to non-monkeysphere authorized_keys files:"
        echo "$badauthorizedkeys"
        echo " - Recommendation: remove the above AuthorizedKeysFile lines from $sshd_config"
@@ -698,7 +699,7 @@ diagnostics() {
     fi
 
     if [ "$problemsfound" -gt 0 ]; then
-       echo "When the above $problemsfound problem"$([ "$problemsfound" -eq 1 ] || echo "s")" are resolved, please re-run:"
+       echo "When the above $problemsfound issue"$(if [ "$problemsfound" -eq 1 ] ; then echo " is" ; else echo "s are" ; fi)" resolved, please re-run:"
        echo "  monkeysphere-server diagnostics"
     fi
 }