xref: /freebsd/contrib/pjdfstest/tests/chown/02.t (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/chown/02.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="chown returns ENAMETOOLONG if a component of a pathname exceeded ${NAME_MAX} characters"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10echo "1..10"
11
12nx=`namegen_max`
13nxx="${nx}x"
14
15expect 0 create ${nx} 0644
16expect 0 chown ${nx} 65534 65534
17expect 65534,65534 stat ${nx} uid,gid
18expect 0 unlink ${nx}
19expect ENAMETOOLONG chown ${nxx} 65534 65534
20
21expect 0 create ${nx} 0644
22expect 0 lchown ${nx} 65534 65534
23expect 65534,65534 stat ${nx} uid,gid
24expect 0 unlink ${nx}
25expect ENAMETOOLONG lchown ${nxx} 65534 65534
26