print_ver_ cp
require_root_
require_selinux_
+getlimits_
cwd=$(pwd)
cleanup_() { cd /; umount "$cwd/mnt"; }
echo > g
cp --preserve=all ../f g 2>err || fail=1
test -s g || fail=1
-grep "Operation not supported" err && fail=1
+grep "$ENOTSUP" err && fail=1
# =====================================================
# The same as above except destination does not exist
rm -f g
cp --preserve=all ../f g 2>err || fail=1
test -s g || fail=1
-grep "Operation not supported" err && fail=1
+grep "$ENOTSUP" err && fail=1
# An alternative to the following approach would be to run in a confined
# domain (maybe creating/loading it) that lacks the required permissions
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cp mv
-
+getlimits_
require_root_
cwd=$(pwd)
# This should fail with corresponding diagnostics
cp -a --preserve=xattr xattr/a noxattr/ 2>err && fail=1
if grep '^#define USE_XATTR 1' $CONFIG_HEADER > /dev/null; then
-cat <<\EOF > exp
-cp: setting attributes for 'noxattr/a': Operation not supported
+cat <<EOF > exp
+cp: setting attributes for 'noxattr/a': $ENOTSUP
EOF
else
cat <<\EOF > exp