echo echo hello world >"$acl_xattr_test_file" || exit 1
sys=$(uname -s)
acls=no
if ( setfacl -m u::rwx,u:root:rwx,g:sys:rwx,u:daemon:r,mask::rwx \
default_acls=no
if ( setfacl -m u::rwx,g::r-x,o::---,u:root:rwx,g::r-x,g:sys:rwx,u:daemon:r--,mask::rwx \
"$acl_xattr_test_file" ) >/dev/null 2>&1
then
if ( getfacl "$acl_xattr_test_file" ) >/dev/null 2>&1
then
acls=yes
if ( setfacl -m u::rwx,g::r-x,o::---,u:root:rwx,g::r-x,g:sys:rwx,u:daemon:r--,mask::rwx \
"$acl_xattr_test_dir" ) >/dev/null 2>&1
then
acls=yes
# Setting of "default" ACLs will fail on FreeBSD. It will nevertheless be
# done in the image by a xorriso command. Restoring is supposed to skip
# "default" ACLs if none could be recorded.
if setfacl -m u::rwx,g::r-x,o::---,u:root:rwx,g:sys:rwx,u:daemon:r--,mask::rwx,d:u::rwx,d:g::r-x,d:o::---,d:u:root:rwx,d:g:sys:rwx,d:u:daemon:r--,d:mask::rwx "$acl_xattr_iso_dir" 2>/dev/null
then
default_acls=yes
fi
fi
fi
fi
# GNU/Linux and FreeBSD have different tools for Extended Attributes
xattrs=no
extattrs=no
# Try GNU/Linux style setattr/getattr
if ( setfattr -n user.test_xattr -v test_value "$acl_xattr_test_file" ) \
>/dev/null 2>&1
then
@ -123,14 +146,24 @@ then
fi
if test "$xattrs" = no
then
# >>> Try FreeBSD style setextattr
dummy=dummy
# Try FreeBSD style setextattr
if ( setextattr user test_xattr test_value "$acl_xattr_test_file" ) \
>/dev/null 2>&1
then
if ( getextattr user test_xattr "$acl_xattr_test_file" ) >/dev/null 2>&1
then
setextattr user long_data 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "$acl_xattr_test_file"
setextattr user more_data 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "$acl_xattr_test_file"
if ( lsextattr user "$acl_xattr_test_file" ) >/dev/null 2>&1