[BusyBox-cvs] busybox/archival/libunarchive data_extract_all.c,1.9,1.10

Glenn McGrath bug1 at busybox.net
Mon Apr 21 11:03:32 UTC 2003


Update of /var/cvs/busybox/archival/libunarchive
In directory winder:/tmp/cvs-serv14477/archival/libunarchive

Modified Files:
	data_extract_all.c 
Log Message:
unlink a previous file before its extracted


Index: data_extract_all.c
===================================================================
RCS file: /var/cvs/busybox/archival/libunarchive/data_extract_all.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- data_extract_all.c	19 Mar 2003 09:11:25 -0000	1.9
+++ data_extract_all.c	21 Apr 2003 11:03:29 -0000	1.10
@@ -53,7 +53,8 @@
 #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);
 			}



More information about the busybox-cvs mailing list