_apply_linux_xattr_rec(): do nothing if no rec; fix restricted access test.

If the metadata object has no linux_xattr, don't do anything at all in
_apply_linux_xattr_rec(), and don't test the filesystem for xattr
support to determine whether or not to expect an xattr error, because
EACCES trumps the other errors.

This should be more efficient and fix a
test_apply_to_path_restricted_access() failure.

Thanks to Sebastian Schumb <sebastian@sebastians-site.de> for
reporting the problem and helping track down the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Include the chattr value in the ApplyError.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Add current-filesystem and path-filesystems to t/lib.sh; use to guard test.

Add current-filesystem which reports the current filesystem type, and
path-filesystems which reports all the filesystems back up to the
root, and use the latter to skip the "save --strip-path (no match)"
test whenever all the filesystems involved aren't the same type.

This issue was discovered while testing on
/some/ext4/tree/containing/a/btrfs/tree.  When the test indexes/saves,
it picks up the metadata for the parents above the btrfs, which may
have (for example) linux +e attrs.  Then when it tries to restore the
tree fully within the btrfs, the restore defers an error when it tries
to restore the +e, which isn't valid for btrfs.

Normally we can avoid this problem via --strip, but this particular
test is actually checking the behavior when --strip doesn't apply.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Use "type -p" instead of "which" in test.sh.

Which isn't portable (if I recall correctly), and we know we're in
Bash.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>