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