Summary: | uudecode -o doesn't work if piped | ||
---|---|---|---|
Product: | Base System | Reporter: | Kimura Fuyuki <fuyuki> |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | 4.6.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
Kimura Fuyuki
2002-09-03 06:50:01 UTC
* De: Kimura Fuyuki <fuyuki@hadaly.org> [ Data: 2002-09-02 ] [ Subjecte: bin/42356: uudecode -o doesn't work if piped ] > By the way, I don't understand the mean of the following lines. Are they > necessary? If they can be zapped, it could be a better solution. > > } else if (!freopen(buf, "w", stdout) || > fchmod(fileno(stdout), getmode(mode_handle, 0) & 0666)) { > warn("%s: %s", buf, filename); > return(1); > } This is to set the mode within the acceptable bitmask of modes, of the file being created. juli. -- Juli Mallett <jmallett@FreeBSD.org> | FreeBSD: The Power To Serve Will break world for fulltime employment. | finger jmallett@FreeBSD.org > > } else if (!freopen(buf, "w", stdout) || > > fchmod(fileno(stdout), getmode(mode_handle, 0) & 0666)) { > > warn("%s: %s", buf, filename); > > return(1); > > } > This is to set the mode within the acceptable bitmask of modes, of the > file being created. I understand. I must have been half-asleep. :( -- fuyuki Kimura Fuyuki <fuyuki@hadaly.org> wrote: > >uudecode -o doesn't work if the output is piped to other programs. > >>How-To-Repeat: > $ uudecode -o /tmp/a.tgz </tmp/a.uue > $ tar tvzf /tmp/a.tgz > drwxr-xr-x user/user 0 Nov 13 13:10 2001 dir/ > -rw-r--r-- user/user 3 Nov 13 13:10 2001 dir/file > drwxr-xr-x user/user 0 Nov 13 13:10 2001 dir/RCS/ > -r--r--r-- user/user 307 Nov 13 13:10 2001 dir/RCS/file,v > $ uudecode -o /dev/stdout </tmp/a.uue | tar xvzf - > uudecode: /dev/stdout: stdin: Invalid argument > > gzip: stdin: unexpected end of file > tar: child returned status 1 I think this is a documentation bug, rather than a bug in uudecode itself. The manual page should suggest the -p option rather than -o /dev/stdout. (or perhaps failure to chmod should not be fatal) Would fixing the manual page satisfy you? Tony. -- f.a.n.finch <dot@dotat.at> http://dotat.at/ BISCAY SOUTHEAST FITZROY: EAST OR NORTHEAST 4 OR 5 BACKING MAINLY NORTHWEST 3 OR 4. MAINLY FAIR. GOOD. State Changed From-To: open->feedback Is the submitter happy with a manpage fix instead? At Tue, 03 Sep 2002 10:55:51 +0100, Tony Finch <dot@dotat.at> wrote: > > Kimura Fuyuki <fuyuki@hadaly.org> wrote: > > > >uudecode -o doesn't work if the output is piped to other programs. > > > >>How-To-Repeat: > > $ uudecode -o /tmp/a.tgz </tmp/a.uue > > $ tar tvzf /tmp/a.tgz > > drwxr-xr-x user/user 0 Nov 13 13:10 2001 dir/ > > -rw-r--r-- user/user 3 Nov 13 13:10 2001 dir/file > > drwxr-xr-x user/user 0 Nov 13 13:10 2001 dir/RCS/ > > -r--r--r-- user/user 307 Nov 13 13:10 2001 dir/RCS/file,v > > $ uudecode -o /dev/stdout </tmp/a.uue | tar xvzf - > > uudecode: /dev/stdout: stdin: Invalid argument > > > > gzip: stdin: unexpected end of file > > tar: child returned status 1 > > I think this is a documentation bug, rather than a bug in uudecode itself. > The manual page should suggest the -p option rather than -o /dev/stdout. > (or perhaps failure to chmod should not be fatal) > > Would fixing the manual page satisfy you? It would make standards@ people unhappy. Commit log says as follows: ---------------------------- revision 1.18 date: 2002/02/16 09:18:33; author: mike; state: Exp; lines: +0 -1 Un-deprecate the -p option. We now have two ways to output to stdout: `-o /dev/stdout' or `-p'. Requested by: grog, nectar ---------------------------- revision 1.17 date: 2002/01/27 18:21:23; author: mike; state: Exp; lines: +26 -3 Add -o option (POSIX.1-2001) to uudecode(1). Deprecate the -p option (which allows one to redirect output to stdout); `-o /dev/stdout' is recommended instead. Submitted by: Joseph Mallett <jmallett@xMach.org> MFC after: 2 weeks ---------------------------- -- fuyuki State Changed From-To: feedback->patched Patch applied to -CURRENT. State Changed From-To: patched->closed Fixed in -stable a long time ago. |