BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004134 [BusyBox] Standards Compliance minor always 07-14-08 19:53 07-16-08 16:18
Reporter cristic View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0004134: tee - does not copy input twice to stdout
Description In busybox-1.11.1, "tee -" does not copy the input twice to standard output, as expected:

$ echo abc >A
$ ./tee - <A
abc
$

Here is the behavior for tee in GNU coreutils 6.12:
$ tee - <A
abc
abc
$

Thank you,
Cristian
Additional Information
Attached Files  7.patch [^] (600 bytes) 07-14-08 22:09

- Relationships

- Notes
(0009304)
vda
07-14-08 22:09

Please test attached 7.patch
 
(0009334)
cristic
07-15-08 17:00

The patch seems to be a correct fix for the bug reported. There is another problem in tee though. I can open a new bug report if it's preferable. The issue is an infinite loop when the file open on line 55 (svn-22831) fails.

Here's a trivial test case:
$ echo abc| tee ""
tee: : No such file or directory
tee: : No such file or directory
tee: : No such file or directory
tee: : No such file or directory
tee: : No such file or directory
...

This generates an infinite loop. The same happens if you replace "" with a file name for which you lack permissions. I think the patch is just to increment argv if the file open fails:
        if (NOT_LONE_DASH(*argv)) {
            *fp = fopen_or_warn(*argv, mode);
            if (*fp == NULL) {
                retval = EXIT_FAILURE;
+ argv++;
                continue;
            }
        }

Best,
Cristian
 
(0009374)
vda
07-16-08 00:34

Thanks! fixed in svn.
 
(0009444)
cristic
07-16-08 14:25

Cool, I think this can be closed now.
 
(0009464)
vda
07-16-08 16:18

fixed in svn
 

- Issue History
Date Modified Username Field Change
07-14-08 19:53 cristic New Issue
07-14-08 19:53 cristic Status new => assigned
07-14-08 19:53 cristic Assigned To  => BusyBox
07-14-08 22:09 vda File Added: 7.patch
07-14-08 22:09 vda Note Added: 0009304
07-15-08 16:44 cristic Issue Monitored: cristic
07-15-08 17:00 cristic Note Added: 0009334
07-16-08 00:34 vda Note Added: 0009374
07-16-08 14:25 cristic Note Added: 0009444
07-16-08 16:18 vda Status assigned => closed
07-16-08 16:18 vda Note Added: 0009464
07-16-08 16:18 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker