summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/regress/agent-ptrace.sh
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-04-23 16:53:02 +0000
committerdes <des@FreeBSD.org>2003-04-23 16:53:02 +0000
commit6d34992e86f885f08b7df6e18a0b6af25ec2d664 (patch)
tree1a380064758bab3bc985ef1cc15a7b6633825c0f /crypto/openssh/regress/agent-ptrace.sh
parentdf96ff7f3774ba5a36cf1c6729762872945cc60a (diff)
parent85b37b9574631df0f7e774dda373514195c74b29 (diff)
downloadFreeBSD-src-6d34992e86f885f08b7df6e18a0b6af25ec2d664.zip
FreeBSD-src-6d34992e86f885f08b7df6e18a0b6af25ec2d664.tar.gz
This commit was generated by cvs2svn to compensate for changes in r113908,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/openssh/regress/agent-ptrace.sh')
-rw-r--r--crypto/openssh/regress/agent-ptrace.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/openssh/regress/agent-ptrace.sh b/crypto/openssh/regress/agent-ptrace.sh
new file mode 100644
index 0000000..9f9c999
--- /dev/null
+++ b/crypto/openssh/regress/agent-ptrace.sh
@@ -0,0 +1,28 @@
+# $OpenBSD: agent-ptrace.sh,v 1.1 2002/12/09 15:38:30 markus Exp $
+# Placed in the Public Domain.
+
+tid="disallow agent ptrace attach"
+
+trace "start agent"
+eval `${SSHAGENT} -s` > /dev/null
+r=$?
+if [ $r -ne 0 ]; then
+ fail "could not start ssh-agent: exit code $r"
+else
+ # ls -l ${SSH_AUTH_SOCK}
+ gdb ${SSHAGENT} ${SSH_AGENT_PID} > ${OBJ}/gdb.out 2>&1 << EOF
+ quit
+EOF
+ if [ $? -ne 0 ]; then
+ fail "gdb failed: exit code $?"
+ fi
+ grep -q 'ptrace: Operation not permitted.' ${OBJ}/gdb.out
+ r=$?
+ rm -f ${OBJ}/gdb.out
+ if [ $r -ne 0 ]; then
+ fail "ptrace succeeded?: exit code $r"
+ fi
+
+ trace "kill agent"
+ ${SSHAGENT} -k > /dev/null
+fi
OpenPOWER on IntegriCloud