]> andersk Git - gssapi-openssh.git/blame - openssh/regress/agent-ptrace.sh
Re-import of OpenSSH 3.7.1p2 (Chase\!)
[gssapi-openssh.git] / openssh / regress / agent-ptrace.sh
CommitLineData
6a9b3198 1# $OpenBSD: agent-ptrace.sh,v 1.1 2002/12/09 15:38:30 markus Exp $
2# Placed in the Public Domain.
3
4tid="disallow agent ptrace attach"
5
0fff78ff 6if have_prog uname ; then
7 case `uname` in
9cb1827b 8 Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*)
0fff78ff 9 echo "skipped (not supported on this platform)"
10 exit 0
11 ;;
12 esac
13fi
14
15if have_prog gdb ; then
16 : ok
17else
18 echo "skipped (gdb not found)"
19 exit 0
20fi
21
6a9b3198 22trace "start agent"
23eval `${SSHAGENT} -s` > /dev/null
24r=$?
25if [ $r -ne 0 ]; then
26 fail "could not start ssh-agent: exit code $r"
27else
28 # ls -l ${SSH_AUTH_SOCK}
29 gdb ${SSHAGENT} ${SSH_AGENT_PID} > ${OBJ}/gdb.out 2>&1 << EOF
30 quit
31EOF
32 if [ $? -ne 0 ]; then
33 fail "gdb failed: exit code $?"
34 fi
9cb1827b 35 grep 'ptrace: Operation not permitted.' >/dev/null ${OBJ}/gdb.out
6a9b3198 36 r=$?
37 rm -f ${OBJ}/gdb.out
38 if [ $r -ne 0 ]; then
39 fail "ptrace succeeded?: exit code $r"
40 fi
41
42 trace "kill agent"
43 ${SSHAGENT} -k > /dev/null
44fi
This page took 0.086884 seconds and 5 git commands to generate.