Deleted Added
sdiff udiff text old ( 166065 ) new ( 210984 )
full compact
1#!/bin/sh
2# $FreeBSD: head/tools/regression/fstest/tests/open/11.t 166065 2007-01-17 01:42:12Z pjd $
3
4desc="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
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9require chflags
10
11echo "1..24"
12
13n0=`namegen`
14
15expect 0 create ${n0} 0644
16expect 0 chflags ${n0} SF_APPEND
17expect 0 open ${n0} O_WRONLY,O_APPEND
18expect 0 open ${n0} O_RDWR,O_APPEND
19expect EPERM open ${n0} O_WRONLY
20expect EPERM open ${n0} O_RDWR
21expect EPERM open ${n0} O_RDONLY,O_TRUNC
22expect EPERM open ${n0} O_RDONLY,O_APPEND,O_TRUNC
23expect EPERM open ${n0} O_WRONLY,O_APPEND,O_TRUNC
24expect EPERM open ${n0} O_RDWR,O_APPEND,O_TRUNC
25expect 0 chflags ${n0} none
26expect 0 unlink ${n0}
27
28expect 0 create ${n0} 0644
29expect 0 chflags ${n0} UF_APPEND
30expect 0 open ${n0} O_WRONLY,O_APPEND
31expect 0 open ${n0} O_RDWR,O_APPEND
32expect EPERM open ${n0} O_WRONLY
33expect EPERM open ${n0} O_RDWR
34expect EPERM open ${n0} O_RDONLY,O_TRUNC
35expect EPERM open ${n0} O_RDONLY,O_APPEND,O_TRUNC
36expect EPERM open ${n0} O_WRONLY,O_APPEND,O_TRUNC
37expect EPERM open ${n0} O_RDWR,O_APPEND,O_TRUNC
38expect 0 chflags ${n0} none
39expect 0 unlink ${n0}