[BusyBox 0003914]: busybox unzip overwrite existing files

bugs at busybox.net bugs at busybox.net
Sun Jun 29 07:15:24 PDT 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=3914 
====================================================================== 
Reported By:                prien
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   3914
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             06-29-2008 06:58 PDT
Last Modified:              06-29-2008 07:15 PDT
====================================================================== 
Summary:                    busybox unzip overwrite existing files
Description: 
when i execute busybox unzip -o myfile.zip, I want to decompress new myfile
to overwrite existing old myfile,but it produces unexpected results. If the
size of the new file(myfile) is smalller than the old one, it cannot
completely override the old file, and I got the wrong file.

I look for the source code in archival/unzip.c and find 369 line:

369    dst_fd = bb_xopen(dst_fn, O_WRONLY | O_CREAT);

I change it with:

369    dst_fd = bb_xopen(dst_fn, O_WRONLY | O_CREAT | O_TRUNC);

so busybox unzip -o myfile.zip can work right
====================================================================== 

---------------------------------------------------------------------- 
 vda - 06-29-08 07:15  
---------------------------------------------------------------------- 
This bug was fixed 1.5 years ago. Try newer version. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-29-08 06:58  prien          New Issue                                    
06-29-08 06:58  prien          Status                   new => assigned     
06-29-08 06:58  prien          Assigned To               => BusyBox         
06-29-08 07:15  vda            Status                   assigned => closed  
06-29-08 07:15  vda            Note Added: 0008834                          
======================================================================



More information about the busybox-cvs mailing list