xref: /freebsd/contrib/pjdfstest/tests/chmod/06.t (revision 531c2d7af3cd2e64eec94aa1b19c4b2f16fce515)
140a8ac8fSEnji Cooper#!/bin/sh
2*3416500aSEnji Cooper# vim: filetype=sh noexpandtab ts=8 sw=8
340a8ac8fSEnji Cooper# $FreeBSD: head/tools/regression/pjdfstest/tests/chmod/06.t 211474 2010-08-18 22:06:43Z pjd $
440a8ac8fSEnji Cooper
540a8ac8fSEnji Cooperdesc="chmod returns ELOOP if too many symbolic links were encountered in translating the pathname"
640a8ac8fSEnji Cooper
740a8ac8fSEnji Cooperdir=`dirname $0`
840a8ac8fSEnji Cooper. ${dir}/../misc.sh
940a8ac8fSEnji Cooper
1040a8ac8fSEnji Cooperif supported lchmod; then
1140a8ac8fSEnji Cooper	echo "1..10"
1240a8ac8fSEnji Cooperelse
1340a8ac8fSEnji Cooper	echo "1..8"
1440a8ac8fSEnji Cooperfi
1540a8ac8fSEnji Cooper
1640a8ac8fSEnji Coopern0=`namegen`
1740a8ac8fSEnji Coopern1=`namegen`
1840a8ac8fSEnji Cooper
1940a8ac8fSEnji Cooperexpect 0 symlink ${n0} ${n1}
2040a8ac8fSEnji Cooperexpect 0 symlink ${n1} ${n0}
2140a8ac8fSEnji Cooperexpect ELOOP chmod ${n0} 0644
2240a8ac8fSEnji Cooperexpect ELOOP chmod ${n1} 0644
2340a8ac8fSEnji Cooperexpect ELOOP chmod ${n0}/test 0644
2440a8ac8fSEnji Cooperexpect ELOOP chmod ${n1}/test 0644
2540a8ac8fSEnji Cooperif supported lchmod; then
2640a8ac8fSEnji Cooper	expect ELOOP lchmod ${n0}/test 0644
2740a8ac8fSEnji Cooper	expect ELOOP lchmod ${n1}/test 0644
2840a8ac8fSEnji Cooperfi
2940a8ac8fSEnji Cooperexpect 0 unlink ${n0}
3040a8ac8fSEnji Cooperexpect 0 unlink ${n1}
31