From 9c7c8ab4858f69298ff9da3a080a61996564150b Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 1 Jun 2008 23:18:44 +0200 Subject: [PATCH] fix sshd detection for ControlMaster connections --- run.d/30-query-hostname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2