From: Glenn L McGrath Date: Mon, 21 Apr 2003 11:03:29 +0000 (-0000) Subject: unlink a previous file before its extracted X-Git-Tag: 1_00_pre1~109 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=afc01cd48544d4e0e7575a8518e575dd499e297c;p=oweals%2Fbusybox.git unlink a previous file before its extracted --- diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c index 77b4de593..bd264dd74 100644 --- a/archival/libunarchive/data_extract_all.c +++ b/archival/libunarchive/data_extract_all.c @@ -53,7 +53,8 @@ extern void data_extract_all(archive_handle_t *archive_handle) #endif { /* Regular file */ - dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT); + unlink(file_header->name); + dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT | O_EXCL); archive_copy_file(archive_handle, dst_fd); close(dst_fd); }