xref: /freebsd/contrib/pjdfstest/tests/chflags/03.t (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/chflags/03.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="chflags returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10require chflags
11
12echo "1..12"
13
14nx=`dirgen_max`
15nxx="${nx}x"
16
17mkdir -p "${nx%/*}"
18
19expect 0 create ${nx} 0644
20expect 0 chflags ${nx} SF_IMMUTABLE
21expect SF_IMMUTABLE stat ${nx} flags
22expect 0 chflags ${nx} none
23expect 0 unlink ${nx}
24expect ENAMETOOLONG chflags ${nxx} SF_IMMUTABLE
25
26expect 0 create ${nx} 0644
27expect 0 lchflags ${nx} SF_IMMUTABLE
28expect SF_IMMUTABLE stat ${nx} flags
29expect 0 lchflags ${nx} none
30expect 0 unlink ${nx}
31expect ENAMETOOLONG lchflags ${nxx} SF_IMMUTABLE
32
33rm -rf "${nx%%/*}"
34