mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Add xfsdump support for the security extended attributes namespace.
Execute security attribute tests if $USE_ATTR_SECURE environment variable is set to "yes" (security attribute tests disabled by default - "no").
This commit is contained in:
@@ -95,7 +95,12 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
|
|||||||
_scratch_mount || _fail "mount failed"
|
_scratch_mount || _fail "mount failed"
|
||||||
_create_test_bed
|
_create_test_bed
|
||||||
|
|
||||||
for nsp in user trusted; do # security
|
if [ "$USE_ATTR_SECURE" = yes ]; then
|
||||||
|
ATTR_MODES="user security trusted"
|
||||||
|
else
|
||||||
|
ATTR_MODES="user trusted"
|
||||||
|
fi
|
||||||
|
for nsp in $ATTR_MODES; do
|
||||||
for inode in reg dir lnk dev/b dev/c dev/p; do
|
for inode in reg dir lnk dev/b dev/c dev/p; do
|
||||||
|
|
||||||
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
||||||
|
|||||||
+13
-1
@@ -1172,7 +1172,7 @@ _get_eas_on_path()
|
|||||||
# sort |\
|
# sort |\
|
||||||
# and this is now the Linux way...
|
# and this is now the Linux way...
|
||||||
echo "User names"
|
echo "User names"
|
||||||
getfattr --absolute-names -Rh $_path |\
|
getfattr --absolute-names -Rh -m user $_path |\
|
||||||
perl -wn -e '
|
perl -wn -e '
|
||||||
if (m/^# file: (\S+)/) { $file = $1 }
|
if (m/^# file: (\S+)/) { $file = $1 }
|
||||||
elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
||||||
@@ -1181,6 +1181,18 @@ _get_eas_on_path()
|
|||||||
attr -g $ea_name $file
|
attr -g $ea_name $file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$USE_ATTR_SECURE" = yes ]; then
|
||||||
|
echo "Security names"
|
||||||
|
getfattr --absolute-names -Rh -m security $_path |\
|
||||||
|
perl -wn -e '
|
||||||
|
if (m/^# file: (\S+)/) { $file = $1 }
|
||||||
|
elsif (m/^security\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
||||||
|
sort |\
|
||||||
|
while read file ea_name; do
|
||||||
|
attr -g $ea_name $file
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Root names"
|
echo "Root names"
|
||||||
getfattr --absolute-names -Rh -m trusted $_path |\
|
getfattr --absolute-names -Rh -m trusted $_path |\
|
||||||
perl -wn -e '
|
perl -wn -e '
|
||||||
|
|||||||
@@ -9,11 +9,12 @@ fi
|
|||||||
[ "$USE_EXTERNAL" = yes ] || USE_EXTERNAL=no
|
[ "$USE_EXTERNAL" = yes ] || USE_EXTERNAL=no
|
||||||
[ "$USE_LBD_PATCH" = yes ] || USE_LBD_PATCH=no
|
[ "$USE_LBD_PATCH" = yes ] || USE_LBD_PATCH=no
|
||||||
[ "$USE_BIG_LOOPFS" = yes ] || USE_BIG_LOOPFS=no
|
[ "$USE_BIG_LOOPFS" = yes ] || USE_BIG_LOOPFS=no
|
||||||
|
[ "$USE_ATTR_SECURE"= yes ] || USE_ATTR_SECURE=no
|
||||||
[ -z "$FSTYP" ] && FSTYP="xfs"
|
[ -z "$FSTYP" ] && FSTYP="xfs"
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
TEST: DIR=$TEST_DIR DEV=$TEST_DEV rt=[$TEST_RTDEV] log=[$TEST_LOGDEV]
|
TEST: DIR=$TEST_DIR DEV=$TEST_DEV rt=[$TEST_RTDEV] log=[$TEST_LOGDEV]
|
||||||
TAPE: dev=[$TAPE_DEV] rmt=[$RMT_TAPE_DEV] rmtirix=[$RMT_TAPE_USER@$RMT_IRIXTAPE_DEV]
|
TAPE: dev=[$TAPE_DEV] rmt=[$RMT_TAPE_DEV] rmtirix=[$RMT_TAPE_USER@$RMT_IRIXTAPE_DEV]
|
||||||
SCRATCH: MNT=$SCRATCH_MNT DEV=$SCRATCH_DEV rt=[$SCRATCH_RTDEV] log=[$SCRATCH_LOGDEV]
|
SCRATCH: MNT=$SCRATCH_MNT DEV=$SCRATCH_DEV rt=[$SCRATCH_RTDEV] log=[$SCRATCH_LOGDEV]
|
||||||
VARIABLES: external=$USE_EXTERNAL largeblk=$USE_LBD_PATCH fstyp=$FSTYP bigloopfs=$USE_BIG_LOOPFS
|
VARIABLES: external=$USE_EXTERNAL largeblk=$USE_LBD_PATCH fstyp=$FSTYP bigloopfs=$USE_BIG_LOOPFS attrsecure=$USE_ATTR_SECURE
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user