Skip to content
Commits on Source (2)
......@@ -38,6 +38,7 @@ log() {
local output
local alllevels
local found=
local written=
# don't include SILENT in alllevels: it's handled separately
# list in decreasing verbosity (all caps).
......@@ -50,6 +51,9 @@ log() {
# just go ahead and return if the log level is silent
if [ "$LOG_LEVEL" = 'SILENT' ] ; then
if [ ! "$2" ] ; then
cat >/dev/null
fi
return
fi
......@@ -81,8 +85,12 @@ log() {
else
cat
fi | sed 's/^/'"${LOG_PREFIX}"'/' >&2
written=true
fi
done
if [ "$written" != 'true' -a ! "$1" ]; then
cat >/dev/null
fi
}
# run command as monkeysphere user
......
......@@ -122,9 +122,9 @@ echo "Checking for Monkeysphere-enabled public-key authentication for users ..."
# Ensure that User ID authentication is enabled:
if echo "AuthorizedKeysFile foo bar" | /usr/sbin/sshd -t -f /dev/stdin; then
# OpenSSH >= 6.0, multiple authorized_keys file supported
if ! grep -q "^AuthorizedKeysFile[[:space:]]\+.*[[:space:]]\*${SYSDATADIR}/authorized_keys/%u$" "$sshd_config"; then
if ! grep -q "^AuthorizedKeysFile[[:space:]]\+.*[[:space:]]*${SYSDATADIR}/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 .ssh/authorized_keys .ssh/authorized_keys2 ${SYSDATADIR}/authorized_keys/%u'"
echo " - Recommendation: add a line to $sshd_config: 'AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys2 ${SYSDATADIR}/authorized_keys/%u'"
problemsfound=$(($problemsfound+1))
fi
if [ "$RAW_AUTHORIZED_KEYS" != none ]; then
......