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