turns printfs back on
[freebsd-src/fkvm-freebsd.git] / tools / regression / fstest / tests / chmod / 08.t
blob110baceb7858c72ef876807f68676adacda9ece1
1 #!/bin/sh
2 # $FreeBSD$
4 desc="chmod returns EPERM if the named file has its immutable or append-only flag set"
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
9 require chflags
11 echo "1..40"
13 n0=`namegen`
15 expect 0 create ${n0} 0644
16 expect 0 chflags ${n0} SF_IMMUTABLE
17 expect EPERM chmod ${n0} 0600
18 expect 0644 stat ${n0} mode
19 expect 0 chflags ${n0} none
20 expect 0 chmod ${n0} 0600
21 expect 0 unlink ${n0}
23 expect 0 create ${n0} 0644
24 expect 0 chflags ${n0} UF_IMMUTABLE
25 expect EPERM chmod ${n0} 0600
26 expect 0644 stat ${n0} mode
27 expect 0 chflags ${n0} none
28 expect 0 chmod ${n0} 0600
29 expect 0 unlink ${n0}
31 expect 0 create ${n0} 0644
32 expect 0 chflags ${n0} SF_APPEND
33 expect EPERM chmod ${n0} 0600
34 expect 0644 stat ${n0} mode
35 expect 0 chflags ${n0} none
36 expect 0 chmod ${n0} 0600
37 expect 0 unlink ${n0}
39 expect 0 create ${n0} 0644
40 expect 0 chflags ${n0} UF_APPEND
41 expect EPERM chmod ${n0} 0600
42 expect 0644 stat ${n0} mode
43 expect 0 chflags ${n0} none
44 expect 0 chmod ${n0} 0600
45 expect 0 unlink ${n0}
47 expect 0 create ${n0} 0644
48 expect 0 chflags ${n0} SF_NOUNLINK
49 expect 0 chmod ${n0} 0600
50 expect 0600 stat ${n0} mode
51 expect 0 chflags ${n0} none
52 expect 0 unlink ${n0}
54 expect 0 create ${n0} 0644
55 expect 0 chflags ${n0} UF_NOUNLINK
56 expect 0 chmod ${n0} 0600
57 expect 0600 stat ${n0} mode
58 expect 0 chflags ${n0} none
59 expect 0 unlink ${n0}