1181847Sjkim#!/bin/sh
2181847Sjkim# $FreeBSD: head/tools/regression/pjdfstest/tests/granular/01.t 211352 2010-08-15 21:24:17Z pjd $
3181847Sjkim
4181847Sjkimdesc="NFSv4 granular permissions checking - ACL_READ_ATTRIBUTES and ACL_WRITE_ATTRIBUTES"
5181847Sjkim
6181847Sjkimdir=`dirname $0`
7181847Sjkim. ${dir}/../misc.sh
8181847Sjkim
9182415Sjkim[ "${os}:${fs}" = "FreeBSD:ZFS" ] || quick_exit
10182219Sjkim
11181847Sjkimecho "1..12"
12181847Sjkim
13181847Sjkimn0=`namegen`
14181847Sjkimn1=`namegen`
15181847Sjkimn2=`namegen`
16181847Sjkim
17181847Sjkimexpect 0 mkdir ${n2} 0755
18181847Sjkimcdir=`pwd`
19181847Sjkimcd ${n2}
20181847Sjkim
21181847Sjkim# Tests 1..12 - check out whether user 65534 is permitted to read attributes.
22181847Sjkimexpect 0 create ${n0} 0644
23181847Sjkimexpect 0 lstat ${n0} size
24181847Sjkimexpect 0 -u 65534 -g 65534 stat ${n0} size
25181847Sjkimexpect 0 prependacl ${n0} user:65534:read_attributes::deny
26181847Sjkimexpect 0 lstat ${n0} size
27181847Sjkimexpect EACCES -u 65534 -g 65534 stat ${n0} size
28181847Sjkimexpect 0 prependacl ${n0} user:65534:read_attributes::allow
29181847Sjkimexpect 0 -u 65534 -g 65534 stat ${n0} size
30182393Sjkimexpect 0 lstat ${n0} size
31181847Sjkimexpect 0 unlink ${n0}
32
33# Tests 12..12 - check out whether user 65534 is permitted to write attributes.
34# XXX: Check if ACL_WRITE_ATTRIBUTES allows for modifying access times.
35
36cd ${cdir}
37expect 0 rmdir ${n2}
38