Add xfsdump support for the security extended attributes namespace.
authorMandy Kirkconnell <alkirkco@sgi.com>
Thu, 26 Feb 2004 00:31:25 +0000 (00:31 +0000)
committerMandy Kirkconnell <alkirkco@sgi.com>
Thu, 26 Feb 2004 00:31:25 +0000 (00:31 +0000)
Execute security attribute tests if $USE_ATTR_SECURE environment variable
is set to "yes" (security attribute tests disabled by default - "no").

062
common.dump
setup

diff --git a/062 b/062
index eb3c92cbc2fb70deaaf852d59e699824fb89c446..63014d37701e1df0e8ef3907320f3430fec51fda 100755 (executable)
--- a/062
+++ b/062
@@ -95,7 +95,12 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 _scratch_mount || _fail "mount failed"
 _create_test_bed
 
 _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
        for inode in reg dir lnk dev/b dev/c dev/p; do
 
                echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
index 31ab8b22b1f9af78aa54d052d594998ac3dc2403..fa38afb9f2247fb2b005b9a27c752ef873f4b444 100644 (file)
@@ -1172,7 +1172,7 @@ _get_eas_on_path()
     # sort |\
 # and this is now the Linux way...
     echo "User names"
     # 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" }' |\
     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
 
        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 '
     echo "Root names"
     getfattr --absolute-names -Rh -m trusted $_path |\
     perl -wn -e '
diff --git a/setup b/setup
index d99d0790e2c6d00401a263d48a03d376995504dc..62d8175e158d3c33920313a9d6009634db2b9006 100755 (executable)
--- 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_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 <<EOF
 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]
 SCRATCH: MNT=$SCRATCH_MNT DEV=$SCRATCH_DEV rt=[$SCRATCH_RTDEV] log=[$SCRATCH_LOGDEV]
 [ -z "$FSTYP" ] && FSTYP="xfs"
 
 cat <<EOF
 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]
 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