From: martin f. krafft Date: Sun, 1 Jun 2008 21:18:44 +0000 (+0200) Subject: fix sshd detection for ControlMaster connections X-Git-Tag: 0.4.3^0 X-Git-Url: https://git.madduck.net/code/molly-guard.git/commitdiff_plain/9c7c8ab4858f69298ff9da3a080a61996564150b fix sshd detection for ControlMaster connections --- diff --git a/run.d/30-query-hostname b/run.d/30-query-hostname index 634a4c9..d040603 100755 --- a/run.d/30-query-hostname +++ b/run.d/30-query-hostname @@ -27,7 +27,7 @@ case "${ALWAYS_QUERY_HOSTNAME:-0}" in # only run if we are being called over SSH, that is if the current terminal # was created by sshd. PTS=$(readlink /proc/$$/fd/0) - if ! pgrep -f "^sshd.+${PTS#/dev/}[[:space:]]*$" >/dev/null \ + if ! pgrep -f "^sshd.+${PTS#/dev/}\>" >/dev/null \ && [ -z "${SSH_CONNECTION:-}" ]; then if [ $PRETEND_SSH -eq 1 ]; then echo "I: $ME: this is not an SSH session, but --pretend-ssh was given..." >&2