[Bug 14241] New: uudecode doesn't recognise the special decode_pathname /dev/stdout

bugzilla at busybox.net bugzilla at busybox.net
Wed Sep 29 02:49:28 UTC 2021


https://bugs.busybox.net/show_bug.cgi?id=14241

            Bug ID: 14241
           Summary: uudecode doesn't recognise the special decode_pathname
                    /dev/stdout
           Product: Busybox
           Version: 1.30.x
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Standard Compliance
          Assignee: unassigned at busybox.net
          Reporter: calestyo at scientia.net
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Hey.

uudecode can get the destination where output shall be written from two places:
a) the -o OUTFILE option
b) if (a) is not given, from the header of it's input data

For both, POSIX defines /dev/stdout to be a special symbol (rather than the
real file) which shall lead uudecode to print the decoded data to its standard
output.
See:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uudecode.html
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uuencode.html


busybox' uudecode however, doesn't recognise that a special symbol, but simply
takes it as a filename.

That will work, but only when it actually exists and in a way like on linux
where it's a symbolic link to /proc/self/fd/1 .
However, there is no guarantee that it exists even there.

Could you please check, whether the decode_pathname (either via the header or
-o) is /dev/stdout and if so, print to the real standard output of the process?


Maybe, but I'm not 100% sure about this, POSIX also specifies - to be such a
special symbol.

It's a bit strange cause POSIX says for:
1) uudecode:
"If the file data header encoded by uuencode is - or /dev/stdout, or the -o
/dev/stdout option overrides the file data, the standard output shall be in the
same format as the file originally encoded by uuencode. Otherwise, the standard
output shall not be used."


but at the same time says in the rationale, that - was specifically not
standardised as meaning stdout:
"In early drafts, the [ -o outfile] option-argument allowed the use of - to
mean standard output. The symbol - has only been used previously in
POSIX.1-2017 as a standard input indicator. The standard developers did not
wish to overload the meaning of - in this manner. The /dev/stdout concept
exists on most modern systems. The /dev/stdout syntax does not refer to a new
special file. It is just a magic cookie to specify standard output."



Cheers,
Chris.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list