2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/unlink/10.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="unlink returns EPERM if the parent directory of the named file has its immutable or append-only flag set"
26 expect 0 mkdir ${n0} 0755
28 expect 0 create ${n0}/${n1} 0644
29 expect 0 chflags ${n0} SF_IMMUTABLE
30 expect EPERM unlink ${n0}/${n1}
31 expect 0 chflags ${n0} none
32 expect 0 unlink ${n0}/${n1}
34 expect 0 create ${n0}/${n1} 0644
35 expect 0 chflags ${n0} SF_NOUNLINK
36 expect 0 unlink ${n0}/${n1}
37 expect 0 chflags ${n0} none
39 expect 0 create ${n0}/${n1} 0644
40 expect 0 chflags ${n0} SF_APPEND
41 todo FreeBSD:ZFS "Removing a file from a directory protected by SF_APPEND should return EPERM."
42 expect EPERM unlink ${n0}/${n1}
43 expect 0 chflags ${n0} none
44 todo FreeBSD:ZFS "Removing a file from a directory protected by SF_APPEND should return EPERM."
45 expect 0 unlink ${n0}/${n1}
49 expect 0 create ${n0}/${n1} 0644
50 expect 0 chflags ${n0} UF_IMMUTABLE
51 expect EPERM unlink ${n0}/${n1}
52 expect 0 chflags ${n0} none
53 expect 0 unlink ${n0}/${n1}
55 expect 0 create ${n0}/${n1} 0644
56 expect 0 chflags ${n0} UF_NOUNLINK
57 expect 0 unlink ${n0}/${n1}
58 expect 0 chflags ${n0} none
60 expect 0 create ${n0}/${n1} 0644
61 expect 0 chflags ${n0} UF_APPEND
62 expect EPERM unlink ${n0}/${n1}
63 expect 0 chflags ${n0} none
64 expect 0 unlink ${n0}/${n1}