diff options
Diffstat (limited to 'regress/sys/ffs/tests/chown/08.t')
-rw-r--r-- | regress/sys/ffs/tests/chown/08.t | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/regress/sys/ffs/tests/chown/08.t b/regress/sys/ffs/tests/chown/08.t new file mode 100644 index 00000000000..da83e6ac58c --- /dev/null +++ b/regress/sys/ffs/tests/chown/08.t @@ -0,0 +1,46 @@ +#!/bin/sh +# $FreeBSD: src/tools/regression/fstest/tests/chown/08.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ + +desc="chown returns EPERM if the named file has its immutable or append-only flag set" + +n0=`namegen` + +expect 0 create ${n0} 0644 +expect 0 chflags ${n0} SF_IMMUTABLE +expect EPERM chown ${n0} 65534 65534 +expect 0 chflags ${n0} none +expect 0 chown ${n0} 65534 65534 +expect 0 unlink ${n0} + +expect 0 create ${n0} 0644 +expect 0 chflags ${n0} UF_IMMUTABLE +expect EPERM chown ${n0} 65534 65534 +expect 0 chflags ${n0} none +expect 0 chown ${n0} 65534 65534 +expect 0 unlink ${n0} + +expect 0 create ${n0} 0644 +expect 0 chflags ${n0} SF_APPEND +expect EPERM chown ${n0} 65534 65534 +expect 0 chflags ${n0} none +expect 0 chown ${n0} 65534 65534 +expect 0 unlink ${n0} + +expect 0 create ${n0} 0644 +expect 0 chflags ${n0} UF_APPEND +expect EPERM chown ${n0} 65534 65534 +expect 0 chflags ${n0} none +expect 0 chown ${n0} 65534 65534 +expect 0 unlink ${n0} + +expect 0 create ${n0} 0644 +expect 0 chflags ${n0} SF_NOUNLINK +expect 0 chown ${n0} 65534 65534 +expect 0 chflags ${n0} none +expect 0 unlink ${n0} + +expect 0 create ${n0} 0644 +expect 0 chflags ${n0} UF_NOUNLINK +expect 0 chown ${n0} 65534 65534 +expect 0 chflags ${n0} none +expect 0 unlink ${n0} |