09.t revision 1.2
1#!/bin/sh
2# $FreeBSD: src/tools/regression/fstest/tests/unlink/09.t,v 1.1 2007/01/17 01:42:12 pjd Exp $
3
4desc="unlink returns EPERM if the named file has its immutable, undeletable or append-only flag set"
5
6n0=`namegen`
7
8expect 0 create ${n0} 0644
9expect 0 chflags ${n0} SF_IMMUTABLE
10expect EPERM unlink ${n0}
11expect 0 chflags ${n0} none
12expect 0 unlink ${n0}
13
14expect 0 create ${n0} 0644
15expect 0 chflags ${n0} UF_IMMUTABLE
16expect EPERM unlink ${n0}
17expect 0 chflags ${n0} none
18expect 0 unlink ${n0}
19
20expect 0 create ${n0} 0644
21expect 0 chflags ${n0} SF_APPEND
22expect EPERM unlink ${n0}
23expect 0 chflags ${n0} none
24expect 0 unlink ${n0}
25
26expect 0 create ${n0} 0644
27expect 0 chflags ${n0} UF_APPEND
28expect EPERM unlink ${n0}
29expect 0 chflags ${n0} none
30expect 0 unlink ${n0}
31