Add xfsdump support for the security extended attributes namespace.
[xfstests-dev.git] / common.dump
index 5a885efe463884cf773c8c51e6d22fbb11272dcc..fa38afb9f2247fb2b005b9a27c752ef873f4b444 100644 (file)
@@ -758,7 +758,7 @@ _ls_filter()
         /^c/ { date = $9; sub(date,"DATE"); print}
         /^d/ { size = $5; sub(size,"SIZE"); print}
         {print}' \
-  | sed -e 's/total [0-9][0-9]*/total TOTAL/'
+  | sed -e 's/total [0-9][0-9]*/total TOTAL/' -e 's/[ \t][ \t]*/ /g'
 }
 
 
@@ -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 '