diff options
author | 2019-03-30 06:10:31 -0400 | |
---|---|---|
committer | 2019-03-30 06:11:55 -0400 | |
commit | dac123cefa79db06f25b64f8f863b85aa2456342 (patch) | |
tree | 2544f9bb900c75d631f13897e5e816dc9b58bbe9 | |
parent | src/paxctl-ng.c: return ENOENT if a file is not found (diff) | |
download | elfix-dac123cefa79db06f25b64f8f863b85aa2456342.tar.gz elfix-dac123cefa79db06f25b64f8f863b85aa2456342.tar.bz2 elfix-dac123cefa79db06f25b64f8f863b85aa2456342.zip |
install-xattr: report any errors by "stat"
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rwxr-xr-x | misc/install-xattr/checkcopyattrs.sh | 3 | ||||
-rw-r--r-- | misc/install-xattr/install-xattr.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/misc/install-xattr/checkcopyattrs.sh b/misc/install-xattr/checkcopyattrs.sh index 9196795..a9149d7 100755 --- a/misc/install-xattr/checkcopyattrs.sh +++ b/misc/install-xattr/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/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c index 0b5eb25..3e20b63 100644 --- a/misc/install-xattr/install-xattr.c +++ b/misc/install-xattr/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. |