Revision 22570,
839 bytes
checked in by ghudson, 18 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r22569,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | # $OpenBSD: agent-getpeereid.sh,v 1.1 2002/12/09 16:05:02 markus Exp $ |
---|
2 | # Placed in the Public Domain. |
---|
3 | |
---|
4 | tid="disallow agent attach from other uid" |
---|
5 | |
---|
6 | UNPRIV=nobody |
---|
7 | ASOCK=${OBJ}/agent |
---|
8 | SSH_AUTH_SOCK=/nonexistant |
---|
9 | |
---|
10 | if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1 |
---|
11 | then |
---|
12 | echo "skipped (not supported on this platform)" |
---|
13 | exit 0 |
---|
14 | fi |
---|
15 | |
---|
16 | trace "start agent" |
---|
17 | eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null |
---|
18 | r=$? |
---|
19 | if [ $r -ne 0 ]; then |
---|
20 | fail "could not start ssh-agent: exit code $r" |
---|
21 | else |
---|
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 | |
---|
30 | < /dev/null sudo -S -u ${UNPRIV} ssh-add -l > /dev/null 2>&1 |
---|
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 |
---|
38 | fi |
---|
39 | |
---|
40 | rm -f ${OBJ}/agent |
---|
Note: See
TracBrowser
for help on using the repository browser.