xref: /freebsd/contrib/pjdfstest/tests/chmod/06.t (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/chmod/06.t 211474 2010-08-18 22:06:43Z pjd $
4
5desc="chmod returns ELOOP if too many symbolic links were encountered in translating the pathname"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10if supported lchmod; then
11	echo "1..10"
12else
13	echo "1..8"
14fi
15
16n0=`namegen`
17n1=`namegen`
18
19expect 0 symlink ${n0} ${n1}
20expect 0 symlink ${n1} ${n0}
21expect ELOOP chmod ${n0} 0644
22expect ELOOP chmod ${n1} 0644
23expect ELOOP chmod ${n0}/test 0644
24expect ELOOP chmod ${n1}/test 0644
25if supported lchmod; then
26	expect ELOOP lchmod ${n0}/test 0644
27	expect ELOOP lchmod ${n1}/test 0644
28fi
29expect 0 unlink ${n0}
30expect 0 unlink ${n1}
31