]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - tools/regression/fstest/tests/open/10.t
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / tools / regression / fstest / tests / open / 10.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 desc="open returns EPERM when the named file has its immutable flag set and the file is to be modified"
5
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
8
9 require chflags
10
11 echo "1..28"
12
13 n0=`namegen`
14
15 expect 0 create ${n0} 0644
16 expect 0 chflags ${n0} SF_IMMUTABLE
17 expect EPERM open ${n0} O_WRONLY
18 expect EPERM open ${n0} O_RDWR
19 expect EPERM open ${n0} O_RDONLY,O_TRUNC
20 expect 0 chflags ${n0} none
21 expect 0 unlink ${n0}
22
23 expect 0 create ${n0} 0644
24 expect 0 chflags ${n0} UF_IMMUTABLE
25 expect EPERM open ${n0} O_WRONLY
26 expect EPERM open ${n0} O_RDWR
27 expect EPERM open ${n0} O_RDONLY,O_TRUNC
28 expect 0 chflags ${n0} none
29 expect 0 unlink ${n0}
30
31 expect 0 create ${n0} 0644
32 expect 0 chflags ${n0} SF_NOUNLINK
33 expect 0 open ${n0} O_WRONLY
34 expect 0 open ${n0} O_RDWR
35 expect 0 open ${n0} O_RDONLY,O_TRUNC
36 expect 0 chflags ${n0} none
37 expect 0 unlink ${n0}
38
39 expect 0 create ${n0} 0644
40 expect 0 chflags ${n0} UF_NOUNLINK
41 expect 0 open ${n0} O_WRONLY
42 expect 0 open ${n0} O_RDWR
43 expect 0 open ${n0} O_RDONLY,O_TRUNC
44 expect 0 chflags ${n0} none
45 expect 0 unlink ${n0}