diff --git a/checkcopyattrs.sh b/checkcopyattrs.sh index 9196795..a9149d7 100755 --- a/checkcopyattrs.sh +++ b/checkcopyattrs.sh @@ -49,6 +49,9 @@ setfattr -n user.pax.flags -v "r" c [ "$(getfattr --only-values -n user.bas f/a)" == "x" ] [ "$(getfattr --only-values -n user.pax.flags f/a)" == "mr" ] +# Check that we can copy large files +truncate -s2G a +./install-xattr a x # The following are just tests to make sure the raw install # options don't get lost in our optargs parsing. diff --git a/install-xattr.c b/install-xattr.c index 0b5eb25..3e20b63 100644 --- a/install-xattr.c +++ b/install-xattr.c @@ -365,8 +365,10 @@ main(int argc, char* argv[]) if (!opts_target_directory) { target = argv[last]; - if (stat(target, &s) != 0) + if (stat(target, &s) != 0) { + err(1, "failed to stat %s", target); return EXIT_FAILURE; + } target_is_directory = S_ISDIR(s.st_mode); } else { /* target was set above with the -t option */ @@ -381,8 +383,10 @@ main(int argc, char* argv[]) last++; for (i = first; i < last; i++) { - if (stat(argv[i], &s) != 0) + if (stat(argv[i], &s) != 0) { + err(1, "failed to stat %s", argv[i]); return EXIT_FAILURE; + } /* We reproduce install's behavior and skip * all extra directories on the command line * that are not the final target directory.