Anonymous | Login | Signup for a new account | 11-10-2008 12:23 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003854 | [BusyBox] Other | minor | always | 06-24-08 21:36 | 06-25-08 13:55 | ||||
Reporter | qarce | View Status | public | ||||||
Assigned To | BusyBox | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | |||||||
Summary | 0003854: 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. |
||||||||
Additional Information |
Patch from my local svn repository: Index: archival/bbunzip.c =================================================================== --- archival/bbunzip.c (revision 34216) +++ archival/bbunzip.c (working copy) @@ -73,6 +73,17 @@ bb_error_msg("%s: unknown suffix - ignored", filename); goto err; } + + /* if the force option is given unlink the file if it exists */ + if ((stat(filename, &stat_buf) == 0) && + (option_mask32 & OPT_FORCE)) { + if (unlink(filename) != 0) { + bb_simple_perror_msg(filename); + exitcode = 1; + goto free_name; + } + } + /* O_EXCL: "real" bunzip2 doesn't overwrite files */ /* GNU gunzip does not bail out, but goes to next file */ if (open_to_or_warn(STDOUT_FILENO, new_name, O_WRONLY | O_CREAT | O_EXCL, @@ -163,6 +174,7 @@ { getopt32(argv, "cfvdt"); argv += optind; + if (applet_name[2] == 'c') option_mask32 |= OPT_STDOUT; @@ -261,10 +273,12 @@ { getopt32(argv, "cfvdt"); argv += optind; + /* if called as zcat */ if (applet_name[1] == 'c') option_mask32 |= OPT_STDOUT; + return bbunpack(argv, make_new_name_gunzip, unpack_gunzip); } |
||||||||
Attached Files |
![]() |
||||||||
|
Copyright © 2000 - 2006 Mantis Group |