[BusyBox 0003854]: bunzip2 and gzip don't honor the force option -f
bugs at busybox.net
bugs at busybox.net
Wed Jun 25 13:55:04 PDT 2008
The following issue has been CLOSED
======================================================================
http://busybox.net/bugs/view.php?id=3854
======================================================================
Reported By: qarce
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 3854
Category: Other
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Resolution: open
Fixed in Version:
======================================================================
Date Submitted: 06-24-2008 21:36 PDT
Last Modified: 06-25-2008 13:55 PDT
======================================================================
Summary: bunzip2 and gzip don't honor the force option -f
Description:
The -f option while parced has no effect on the tool
checking standard bunzip2 on my ubuntu system ... -f will remove the file
before unpacking. I know the busybox code says this is not standard...
but, why give a -f option if it's not really usable?
I am attaching a patch from my local repository based on busybox 1.9.0
I know your up to 1.10 or so but.... the bug still exists.
======================================================================
----------------------------------------------------------------------
qarce - 06-25-08 12:41
----------------------------------------------------------------------
Add a patch file which has a little better fix in it.
----------------------------------------------------------------------
qarce - 06-25-08 13:52
----------------------------------------------------------------------
How do I go about getting this into busybox?
Do I need to do anything else?
----------------------------------------------------------------------
vda - 06-25-08 13:52
----------------------------------------------------------------------
>why give a -f option if it's not really usable?
Because otherwise even scripts which used -f "just in case" would fail.
Taking and ignoring an option sometimes is better than bombing out on it.
>I am attaching a patch
Thanks!
This is how we think in busybox land: why do we care whether unlink
succeeded - the subsequent open will complain anyway. So we don't need to
test unlink's result.
Now, since we ignore unlink's result, why do we care whether file exists
before unlink? We can just do unlink blindly! The code:
if (option_mask32 & OPT_FORCE)
unlink(new_name);
That's all! :)
Thanks for bringing attention to the problem!
----------------------------------------------------------------------
vda - 06-25-08 13:55
----------------------------------------------------------------------
Fixed in rev 22509, thanks.
Issue History
Date Modified Username Field Change
======================================================================
06-24-08 21:36 qarce New Issue
06-24-08 21:36 qarce Status new => assigned
06-24-08 21:36 qarce Assigned To => BusyBox
06-25-08 12:40 qarce File Added: busybox-1.9.0_bbunzip.patch
06-25-08 12:41 qarce Note Added: 0008564
06-25-08 13:52 qarce Note Added: 0008574
06-25-08 13:52 vda Note Added: 0008584
06-25-08 13:55 vda Status assigned => closed
06-25-08 13:55 vda Note Added: 0008594
======================================================================
More information about the busybox-cvs
mailing list