4 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"
17 expect 0 mkdir ${n0} 0755
21 for type in regular dir fifo block char socket symlink; do
22 if [ "${type}" != "symlink" ]; then
23 create_file ${type} ${n1}
24 expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
25 expect none stat ${n1} flags
26 expect 0 chown ${n1} 65534 65534
27 expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
28 expect none stat ${n1} flags
29 if [ "${type}" = "dir" ]; then
36 create_file ${type} ${n1}
37 expect EPERM -u 65534 -g 65534 lchflags ${n1} UF_NODUMP
38 expect none lstat ${n1} flags
39 expect 0 lchown ${n1} 65534 65534
40 expect EPERM -u 65533 -g 65533 lchflags ${n1} UF_NODUMP
41 expect none lstat ${n1} flags
42 if [ "${type}" = "dir" ]; then