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