]> andersk Git - gssapi-openssh.git/blame - openssh/regress/agent-getpeereid.sh
Import of OpenSSH 4.3p1
[gssapi-openssh.git] / openssh / regress / agent-getpeereid.sh
CommitLineData
2c06c99b 1# $OpenBSD: agent-getpeereid.sh,v 1.2 2005/11/14 21:25:56 grunk Exp $
6a9b3198 2# Placed in the Public Domain.
3
4tid="disallow agent attach from other uid"
5
6UNPRIV=nobody
7ASOCK=${OBJ}/agent
8SSH_AUTH_SOCK=/nonexistant
9
0fff78ff 10if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1
11then
12 echo "skipped (not supported on this platform)"
13 exit 0
14fi
15
6a9b3198 16trace "start agent"
17eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null
18r=$?
19if [ $r -ne 0 ]; then
20 fail "could not start ssh-agent: exit code $r"
21else
22 chmod 644 ${SSH_AUTH_SOCK}
23
24 ssh-add -l > /dev/null 2>&1
25 r=$?
26 if [ $r -ne 1 ]; then
27 fail "ssh-add failed with $r != 1"
28 fi
29
2c06c99b 30 < /dev/null ${SUDO} -S -u ${UNPRIV} ssh-add -l > /dev/null 2>&1
6a9b3198 31 r=$?
32 if [ $r -lt 2 ]; then
33 fail "ssh-add did not fail for ${UNPRIV}: $r < 2"
34 fi
35
36 trace "kill agent"
37 ${SSHAGENT} -k > /dev/null
38fi
39
40rm -f ${OBJ}/agent
This page took 0.243572 seconds and 5 git commands to generate.