]> git.madduck.net Git - code/molly-guard.git/blobdiff - run.d/30-query-hostname

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

fix sshd detection for ControlMaster connections
[code/molly-guard.git] / run.d / 30-query-hostname
index 634a4c91363987d797ab6551c96037320e4cd304..d04060334e42ea3084adf1781d94ecbab8da3f15 100755 (executable)
@@ -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