summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-06-21 19:05:29 +0000
committerkientzle <kientzle@FreeBSD.org>2008-06-21 19:05:29 +0000
commitda7e9647feb7605b759c392628c2fc004df6a58c (patch)
tree962d5b0a308018ecedc7b1f63103e67f97812713
parentc0709d3e410563b2a2e5a24d2d62213ae61db682 (diff)
downloadFreeBSD-src-da7e9647feb7605b759c392628c2fc004df6a58c.zip
FreeBSD-src-da7e9647feb7605b759c392628c2fc004df6a58c.tar.gz
A security-check failure here should be ARCHIVE_FAILED (cannot continue this
operation) and not ARCHIVE_WARN, since we don't actually open the file. Both bsdtar and bsdcpio will try to copy file contents after an ARCHIVE_WARN, which will fail loudly.
-rw-r--r--lib/libarchive/archive_write_disk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libarchive/archive_write_disk.c b/lib/libarchive/archive_write_disk.c
index 8852715..74d083b 100644
--- a/lib/libarchive/archive_write_disk.c
+++ b/lib/libarchive/archive_write_disk.c
@@ -1351,7 +1351,7 @@ cleanup_pathname(struct archive_write_disk *a)
if (*src == '\0') {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Invalid empty pathname");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
/* Skip leading '/'. */
@@ -1382,7 +1382,7 @@ cleanup_pathname(struct archive_write_disk *a)
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Path contains '..'");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
lastdotdot = 1;
} else
@@ -1421,7 +1421,7 @@ cleanup_pathname(struct archive_write_disk *a)
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Path contains trailing '..'");
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
if (dest == a->name) {
/*
OpenPOWER on IntegriCloud