2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/unlink/09.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="unlink returns EPERM if the named file has its immutable, undeletable or append-only flag set"
25 expect 0 create ${n0} 0644
26 expect 0 chflags ${n0} SF_IMMUTABLE
27 expect EPERM unlink ${n0}
28 expect 0 chflags ${n0} none
31 expect 0 create ${n0} 0644
32 expect 0 chflags ${n0} SF_NOUNLINK
33 expect EPERM unlink ${n0}
34 expect 0 chflags ${n0} none
37 expect 0 create ${n0} 0644
38 expect 0 chflags ${n0} SF_APPEND
39 todo FreeBSD:ZFS "Removing a file protected by SF_APPEND should return EPERM."
40 expect EPERM unlink ${n0}
41 todo FreeBSD:ZFS "Removing a file protected by SF_APPEND should return EPERM."
42 expect 0 chflags ${n0} none
43 todo FreeBSD:ZFS "Removing a file protected by SF_APPEND should return EPERM."
48 expect 0 create ${n0} 0644
49 expect 0 chflags ${n0} UF_IMMUTABLE
50 expect EPERM unlink ${n0}
51 expect 0 chflags ${n0} none
54 expect 0 create ${n0} 0644
55 expect 0 chflags ${n0} UF_NOUNLINK
56 expect EPERM unlink ${n0}
57 expect 0 chflags ${n0} none
60 expect 0 create ${n0} 0644
61 expect 0 chflags ${n0} UF_APPEND
62 expect EPERM unlink ${n0}
63 expect 0 chflags ${n0} none