From: Mandy Kirkconnell Date: Thu, 26 Feb 2004 00:31:25 +0000 (+0000) Subject: Add xfsdump support for the security extended attributes namespace. X-Git-Tag: v1.1.0~860 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1262ba3c4afe5b49d9abd46df95c8c2b0da32f69;p=users%2Fhch%2Fxfstests-dev.git 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"). --- diff --git a/062 b/062 index eb3c92cbc..63014d377 100755 --- a/062 +++ b/062 @@ -95,7 +95,12 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs _scratch_mount || _fail "mount failed" _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 echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo diff --git a/common.dump b/common.dump index 31ab8b22b..fa38afb9f 100644 --- a/common.dump +++ b/common.dump @@ -1172,7 +1172,7 @@ _get_eas_on_path() # sort |\ # and this is now the Linux way... echo "User names" - getfattr --absolute-names -Rh $_path |\ + getfattr --absolute-names -Rh -m user $_path |\ perl -wn -e ' if (m/^# file: (\S+)/) { $file = $1 } elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\ @@ -1181,6 +1181,18 @@ _get_eas_on_path() attr -g $ea_name $file 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" getfattr --absolute-names -Rh -m trusted $_path |\ perl -wn -e ' diff --git a/setup b/setup index d99d0790e..62d8175e1 100755 --- a/setup +++ b/setup @@ -9,11 +9,12 @@ fi [ "$USE_EXTERNAL" = yes ] || USE_EXTERNAL=no [ "$USE_LBD_PATCH" = yes ] || USE_LBD_PATCH=no [ "$USE_BIG_LOOPFS" = yes ] || USE_BIG_LOOPFS=no +[ "$USE_ATTR_SECURE"= yes ] || USE_ATTR_SECURE=no [ -z "$FSTYP" ] && FSTYP="xfs" cat <