xref: /freebsd/contrib/pjdfstest/tests/chmod/06.t (revision e7437ae907c89bf85a99c5cbb7ddd194a1ff1354)
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