tag 469951 patch confirmed
thanks

also sprach Michel Meyers <[EMAIL PROTECTED]> [2008.03.08.0943 +0100]:
> When logged in remotely to a machine and opening up a screen (ie the
> utility screen), molly guard doesn't intercept the reboot command
> (probably others too). Maybe there's a way to have it detect 'screen'
> (optionally?).

The reason is simply that screen creates a new PTY, and we cannot
really figure out that it's a child of sshd. But there is the
environment, and we can just try both.

Please try to see if this patch against
/usr/share/molly-guard/shutdown fixes your issue.

Index: shutdown
===================================================================
--- shutdown    (revision 8497)
+++ shutdown    (working copy)
@@ -90,12 +90,13 @@
 # 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; then
-  if [ $PRETEND_SSH -eq 1 ]; then
-    echo "I: this is not an SSH session, but --pretend-ssh was given..."
-  else
-    do_real_cmd
-  fi
+if ! pgrep -f "^sshd.+${PTS#/dev/}[[:space:]]*$" >/dev/null \
+  && [ -z "$SSH_CONNECTION" ]; then
+    if [ $PRETEND_SSH -eq 1 ]; then
+      echo "I: this is not an SSH session, but --pretend-ssh was given..."
+    else
+      do_real_cmd
+    fi
 else
   echo "W: $ME: SSH session detected!"
 fi

-- 
 .''`.   martin f. krafft <[EMAIL PROTECTED]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

Reply via email to