1 # $OpenBSD: agent-ptrace.sh,v 1.1 2002/12/09 15:38:30 markus Exp $
2 # Placed in the Public Domain.
4 tid
="disallow agent ptrace attach"
6 if have_prog uname
; then
9 echo "skipped (not supported on this platform)"
15 if have_prog gdb
; then
18 echo "skipped (gdb not found)"
22 if test -z "$SUDO" ; then
23 echo "skipped (SUDO not set)"
26 $SUDO chown
0 ${SSHAGENT}
27 $SUDO chgrp
0 ${SSHAGENT}
28 $SUDO chmod 2755 ${SSHAGENT}
32 eval `${SSHAGENT} -s` > /dev
/null
35 fail
"could not start ssh-agent: exit code $r"
37 # ls -l ${SSH_AUTH_SOCK}
38 gdb
${SSHAGENT} ${SSH_AGENT_PID} > ${OBJ}/gdb.out
2>&1 << EOF
42 fail
"gdb failed: exit code $?"
44 egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace.*Permission denied.|procfs:.*: Invalid argument.' >/dev
/null
${OBJ}/gdb.out
48 fail
"ptrace succeeded?: exit code $r"
52 ${SSHAGENT} -k > /dev
/null