mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Test for handling of large ACLs with the limit and beyond
number of ACEs.
This commit is contained in:
@@ -344,8 +344,66 @@ chacl m:user1:rwx file1
|
||||
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`
|
||||
|
||||
_create_n_aces()
|
||||
{
|
||||
n=`expr $1 - 4`
|
||||
acl='u::rwx,g::rwx,o::rwx,m::rwx' # 4 ace acl start
|
||||
while [ $n -ne 0 ]; do
|
||||
acl="$acl,u:$n:rwx"
|
||||
n=`expr $n - 1`
|
||||
done
|
||||
echo $acl
|
||||
}
|
||||
|
||||
_filter_aces()
|
||||
{
|
||||
$AWK_PROG '
|
||||
BEGIN {
|
||||
FS=":"
|
||||
while ( getline <"/etc/passwd" > 0 ) {
|
||||
idlist[$1] = $3
|
||||
}
|
||||
}
|
||||
/^user/ { if ($2 in idlist) sub($2, idlist[$2])}
|
||||
{print}
|
||||
'
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
@@ -218,3 +218,138 @@ chacl: m:user1:rwx - Invalid argument
|
||||
+ chacl a::rwx file1
|
||||
chacl: a::rwx - Invalid argument
|
||||
+ set +x
|
||||
|
||||
=== Test out large ACLs ===
|
||||
1 below xfs acl max
|
||||
# file: largeaclfile
|
||||
# owner: root
|
||||
# group: root
|
||||
user::rwx
|
||||
user:1:rwx
|
||||
user:2:rwx
|
||||
user:3:rwx
|
||||
user:4:rwx
|
||||
user:5:rwx
|
||||
user:6:rwx
|
||||
user:7:rwx
|
||||
user:8:rwx
|
||||
user:9:rwx
|
||||
user:10:rwx
|
||||
user:11:rwx
|
||||
user:12:rwx
|
||||
user:13:rwx
|
||||
user:14:rwx
|
||||
user:15:rwx
|
||||
user:16:rwx
|
||||
user:17:rwx
|
||||
user:18:rwx
|
||||
user:19:rwx
|
||||
user:20:rwx
|
||||
group::rwx
|
||||
mask::rwx
|
||||
other::rwx
|
||||
|
||||
xfs acl max
|
||||
# file: largeaclfile
|
||||
# owner: root
|
||||
# group: root
|
||||
user::rwx
|
||||
user:1:rwx
|
||||
user:2:rwx
|
||||
user:3:rwx
|
||||
user:4:rwx
|
||||
user:5:rwx
|
||||
user:6:rwx
|
||||
user:7:rwx
|
||||
user:8:rwx
|
||||
user:9:rwx
|
||||
user:10:rwx
|
||||
user:11:rwx
|
||||
user:12:rwx
|
||||
user:13:rwx
|
||||
user:14:rwx
|
||||
user:15:rwx
|
||||
user:16:rwx
|
||||
user:17:rwx
|
||||
user:18:rwx
|
||||
user:19:rwx
|
||||
user:20:rwx
|
||||
user:21:rwx
|
||||
group::rwx
|
||||
mask::rwx
|
||||
other::rwx
|
||||
|
||||
1 above xfs acl max
|
||||
chacl: cannot set access acl on "largeaclfile": Invalid argument
|
||||
# file: largeaclfile
|
||||
# owner: root
|
||||
# group: root
|
||||
user::rwx
|
||||
user:1:rwx
|
||||
user:2:rwx
|
||||
user:3:rwx
|
||||
user:4:rwx
|
||||
user:5:rwx
|
||||
user:6:rwx
|
||||
user:7:rwx
|
||||
user:8:rwx
|
||||
user:9:rwx
|
||||
user:10:rwx
|
||||
user:11:rwx
|
||||
user:12:rwx
|
||||
user:13:rwx
|
||||
user:14:rwx
|
||||
user:15:rwx
|
||||
user:16:rwx
|
||||
user:17:rwx
|
||||
user:18:rwx
|
||||
user:19:rwx
|
||||
user:20:rwx
|
||||
user:21:rwx
|
||||
group::rwx
|
||||
mask::rwx
|
||||
other::rwx
|
||||
|
||||
use 16 aces
|
||||
# file: largeaclfile
|
||||
# owner: root
|
||||
# group: root
|
||||
user::rwx
|
||||
user:1:rwx
|
||||
user:2:rwx
|
||||
user:3:rwx
|
||||
user:4:rwx
|
||||
user:5:rwx
|
||||
user:6:rwx
|
||||
user:7:rwx
|
||||
user:8:rwx
|
||||
user:9:rwx
|
||||
user:10:rwx
|
||||
user:11:rwx
|
||||
user:12:rwx
|
||||
group::rwx
|
||||
mask::rwx
|
||||
other::rwx
|
||||
|
||||
use 17 aces
|
||||
# file: largeaclfile
|
||||
# owner: root
|
||||
# group: root
|
||||
user::rwx
|
||||
user:1:rwx
|
||||
user:2:rwx
|
||||
user:3:rwx
|
||||
user:4:rwx
|
||||
user:5:rwx
|
||||
user:6:rwx
|
||||
user:7:rwx
|
||||
user:8:rwx
|
||||
user:9:rwx
|
||||
user:10:rwx
|
||||
user:11:rwx
|
||||
user:12:rwx
|
||||
user:13:rwx
|
||||
group::rwx
|
||||
mask::rwx
|
||||
other::rwx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user