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