diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-11-27 05:14:36 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-11-27 05:14:36 +0000 |
commit | cfaf87c8f3aa634237236a3928a357096bb9381a (patch) | |
tree | 61380daa9f15712e4ef3ce88945608340599263c /usr.bin/tar | |
parent | 93f46a969a86e524c4e6455c9545c62512c1372b (diff) | |
download | FreeBSD-src-cfaf87c8f3aa634237236a3928a357096bb9381a.zip FreeBSD-src-cfaf87c8f3aa634237236a3928a357096bb9381a.tar.gz |
If we're unable to chdir() to a directory that we know exists,
that should result in a non-zero return value.
In particular, this should address the issue that David Wolfskill
ran into with a somewhat flaky NFS mount resulting in a damaged
archive even though tar returned success.
MFC after: 4 days
Diffstat (limited to 'usr.bin/tar')
-rw-r--r-- | usr.bin/tar/write.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index 20e9316..894b9ba 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -655,8 +655,10 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path) const struct stat *st = NULL, *lst = NULL; int descend; - if (tree_ret == TREE_ERROR_DIR) + if (tree_ret == TREE_ERROR_DIR) { bsdtar_warnc(bsdtar, errno, "%s: Couldn't visit directory", name); + bsdtar->return_value = 1; + } if (tree_ret != TREE_REGULAR) continue; lst = tree_current_lstat(tree); |