Correct a brain-o in extract_dir: mkdirpath() and mkdir(2) are

not interchangable.
This commit is contained in:
Tim Kientzle 2004-07-10 18:10:20 +00:00
parent 89438367ae
commit 320adc42ea

View File

@ -477,13 +477,15 @@ extract_dir(struct archive *a, struct archive_entry *entry, int flags)
unlink(path);
} else {
/* Doesn't already exist; try building the parent path. */
if (mkdirpath(a, p, flags) != ARCHIVE_OK)
if (mkdirpath_internal(a, path, flags) != ARCHIVE_OK)
return (ARCHIVE_WARN);
}
/* One final attempt to create the dir. */
if (mkdirpath_internal(a, path, flags) != ARCHIVE_OK)
if (mkdir(path, SECURE_DIR_MODE) != 0) {
archive_set_error(a, errno, "Can't create directory");
return (ARCHIVE_WARN);
}
success:
/* Add this dir to the fixup list. */