xref: /freebsd/contrib/pjdfstest/tests/granular/01.t (revision d93a896e)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/granular/01.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="NFSv4 granular permissions checking - ACL_READ_ATTRIBUTES and ACL_WRITE_ATTRIBUTES"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10[ "${os}:${fs}" = "FreeBSD:ZFS" ] || quick_exit
11
12echo "1..12"
13
14n0=`namegen`
15n1=`namegen`
16n2=`namegen`
17
18expect 0 mkdir ${n2} 0755
19cdir=`pwd`
20cd ${n2}
21
22# Tests 1..12 - check out whether user 65534 is permitted to read attributes.
23expect 0 create ${n0} 0644
24expect 0 lstat ${n0} size
25expect 0 -u 65534 -g 65534 stat ${n0} size
26expect 0 prependacl ${n0} user:65534:read_attributes::deny
27expect 0 lstat ${n0} size
28expect EACCES -u 65534 -g 65534 stat ${n0} size
29expect 0 prependacl ${n0} user:65534:read_attributes::allow
30expect 0 -u 65534 -g 65534 stat ${n0} size
31expect 0 lstat ${n0} size
32expect 0 unlink ${n0}
33
34# Tests 12..12 - check out whether user 65534 is permitted to write attributes.
35# XXX: Check if ACL_WRITE_ATTRIBUTES allows for modifying access times.
36
37cd ${cdir}
38expect 0 rmdir ${n2}
39