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.
This commit is contained in:
Tim Kientzle 2008-06-21 19:05:29 +00:00
parent 1aaade6e93
commit be5eb9821c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179914

View file

@ -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) {
/*