1
# $OpenBSD: agent-getpeereid.sh,v 1.1 2002/12/09 16:05:02 markus Exp $
2
# Placed in the Public Domain.
4
tid="disallow agent attach from other uid"
8
SSH_AUTH_SOCK=/nonexistant
10
if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1
12
echo "skipped (not supported on this platform)"
17
eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null
20
fail "could not start ssh-agent: exit code $r"
22
chmod 644 ${SSH_AUTH_SOCK}
24
ssh-add -l > /dev/null 2>&1
27
fail "ssh-add failed with $r != 1"
30
< /dev/null sudo -S -u ${UNPRIV} ssh-add -l > /dev/null 2>&1
33
fail "ssh-add did not fail for ${UNPRIV}: $r < 2"
37
${SSHAGENT} -k > /dev/null