From: Glenn L McGrath Date: Thu, 20 Nov 2003 08:00:38 +0000 (-0000) Subject: Dont attempt to unlink directories X-Git-Tag: 1_00_pre4~36 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=90c9df93f3fa9fb9c6b576c92c19bbe36bdc6e52;p=oweals%2Fbusybox.git Dont attempt to unlink directories --- diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c index 1a6b6244b..4dccb815d 100644 --- a/archival/libunarchive/data_extract_all.c +++ b/archival/libunarchive/data_extract_all.c @@ -42,7 +42,7 @@ extern void data_extract_all(archive_handle_t *archive_handle) /* Check if the file already exists */ if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) { /* Remove the existing entry if it exists */ - if ((unlink(file_header->name) == -1) && (errno != ENOENT)) { + if (((file_header->mode & S_IFMT) != S_IFDIR) && (unlink(file_header->name) == -1) && (errno != ENOENT)) { bb_perror_msg_and_die("Couldnt remove old file"); } }