_need_to_be_root
_acl_setup_ids
-
-[ ! -x /bin/chacl -a ! -x /usr/bin/chacl ] && _notrun "chacl command not found"
+_acl_requirements
[ -x $runas ] || _notrun "$runas executable not found"
# get dir
mkdir $seq.dir1
cd $seq.dir1
-# test if acl_get syscall is operational
-# and hence the ACL config has been turned on
-touch syscalltest
-if chacl -l syscalltest 2>&1 | tee -a $here/$seq.full | grep 'Function not implemented' >/dev/null
-then
- cd $here
- _notrun "requires kernel ACL support"
-fi
-
#-------------------------------------------------------
# real QA test starts here
echo "QA output created by $seq"
echo ""
echo "--- Test get and set of ACL ---"
+echo "Note: Old interface gave an empty ACL - now output an ACL"
chacl -l file1 | _acl_filter_id
-echo "Expect to FAIL"
+echo "Try using single colon separator"
+echo "Note: Old interface FAILed because of single colon - new one allows it"
chacl u::r--,g::rwx,o:rw- file1 2>&1
echo "Expect to PASS"
chacl u::r--,g::rwx,o::rw- file1 2>&1
chacl -R file1
chacl -B acldir
chacl -R acldir/file2
+echo "Note: Old interface would mean empty ACLs - now we show mode ACLs"
chacl -l file1 | _acl_filter_id
chacl -l acldir | _acl_filter_id
chacl -l acldir/file2 | _acl_filter_id
popd >/dev/null
chown -R 12345.54321 root
echo "Change #1..."
-$runas -u 12345 -g 54321 -- /bin/chacl -r u::rwx,g::-w-,o::--x root
+$runas -u 12345 -g 54321 -- `which chacl` -r u::rwx,g::-w-,o::--x root
find root -print | xargs chacl -l
echo "Change #2..."
-$runas -u 12345 -g 54321 -- /bin/chacl -r u::---,g::---,o::--- root
+$runas -u 12345 -g 54321 -- `which chacl` -r u::---,g::---,o::--- root
find root -print | xargs chacl -l
echo ""
echo "=== Test out error messages for ACL text parsing ==="
+echo "Note: Old interface gave more informative error msgs"
touch file1
set -x
chacl a::rwx file1
set +x
+#-------------------------------------------------------
-
+echo ""
+echo "=== Test out large ACLs ==="
+touch largeaclfile
+XFS_ACL_MAX_ENTRIES=25
+num_aces_pre=`expr $XFS_ACL_MAX_ENTRIES - 1`
+num_aces_post=`expr $XFS_ACL_MAX_ENTRIES + 1`
+
+acl1=`_create_n_aces $num_aces_pre`
+acl2=`_create_n_aces $XFS_ACL_MAX_ENTRIES`
+acl3=`_create_n_aces $num_aces_post`
+acl4=`_create_n_aces 16` # Andreas G. libacl size for initial get
+acl5=`_create_n_aces 17` # 1 over A.G. libacl initial size
+
+echo "1 below xfs acl max"
+chacl $acl1 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "xfs acl max"
+chacl $acl2 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "1 above xfs acl max"
+chacl $acl3 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "use 16 aces"
+chacl $acl4 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "use 17 aces"
+chacl $acl5 largeaclfile
+getfacl largeaclfile | _filter_aces
#-------------------------------------------------------