2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/open/10.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="open returns EPERM when the named file has its immutable flag set and the file is to be modified"
25 expect 0 create ${n0} 0644
26 expect 0 chflags ${n0} SF_IMMUTABLE
27 expect EPERM open ${n0} O_WRONLY
28 expect EPERM open ${n0} O_RDWR
29 expect EPERM open ${n0} O_RDONLY,O_TRUNC
30 expect 0 chflags ${n0} none
33 expect 0 create ${n0} 0644
34 expect 0 chflags ${n0} SF_NOUNLINK
35 expect 0 open ${n0} O_WRONLY
36 expect 0 open ${n0} O_RDWR
37 expect 0 open ${n0} O_RDONLY,O_TRUNC
38 expect 0 chflags ${n0} none
43 expect 0 create ${n0} 0644
44 expect 0 chflags ${n0} UF_IMMUTABLE
45 expect EPERM open ${n0} O_WRONLY
46 expect EPERM open ${n0} O_RDWR
47 expect EPERM open ${n0} O_RDONLY,O_TRUNC
48 expect 0 chflags ${n0} none
51 expect 0 create ${n0} 0644
52 expect 0 chflags ${n0} UF_NOUNLINK
53 expect 0 open ${n0} O_WRONLY
54 expect 0 open ${n0} O_RDWR
55 expect 0 open ${n0} O_RDONLY,O_TRUNC
56 expect 0 chflags ${n0} none