2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/chflags/07.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="chflags returns EPERM when the effective user ID does not match the owner of the file and the effective user ID is not the super-user"
18 expect 0 mkdir ${n0} 0755
22 for type in regular dir fifo block char socket symlink; do
23 if [ "${type}" != "symlink" ]; then
24 create_file ${type} ${n1}
25 expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
26 expect none stat ${n1} flags
27 expect 0 chown ${n1} 65534 65534
28 expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
29 expect none stat ${n1} flags
30 if [ "${type}" = "dir" ]; then
37 create_file ${type} ${n1}
38 expect EPERM -u 65534 -g 65534 lchflags ${n1} UF_NODUMP
39 expect none lstat ${n1} flags
40 expect 0 lchown ${n1} 65534 65534
41 expect EPERM -u 65533 -g 65533 lchflags ${n1} UF_NODUMP
42 expect none lstat ${n1} flags
43 if [ "${type}" = "dir" ]; then