xref: /freebsd/contrib/pjdfstest/tests/symlink/05.t (revision 98e0ffaefb0f241cda3a72395d3be04192ae0d47)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/symlink/05.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="symlink returns EACCES when a component of the name2 path prefix denies search permission"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9echo "1..12"
10
11n0=`namegen`
12n1=`namegen`
13n2=`namegen`
14
15expect 0 mkdir ${n0} 0755
16cdir=`pwd`
17cd ${n0}
18
19expect 0 mkdir ${n1} 0755
20expect 0 chown ${n1} 65534 65534
21
22expect 0 -u 65534 -g 65534 symlink test ${n1}/${n2}
23expect 0 -u 65534 -g 65534 unlink ${n1}/${n2}
24
25expect 0 chmod ${n1} 0644
26expect EACCES -u 65534 -g 65534 symlink test ${n1}/${n2}
27expect 0 chmod ${n1} 0755
28expect 0 -u 65534 -g 65534 symlink test ${n1}/${n2}
29expect 0 -u 65534 -g 65534 unlink ${n1}/${n2}
30
31expect 0 rmdir ${n1}
32
33cd ${cdir}
34expect 0 rmdir ${n0}
35