Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[sharutils-4.13.3] uudecode does not handle -o option properly

3 views
Skip to first unread message

Petr Pisar

unread,
Jan 21, 2013, 5:12:50 AM1/21/13
to bug-gn...@gnu.org
Hello,

I got bug report <https://bugzilla.redhat.com/show_bug.cgi?id=901895> where
it's not possible to decode to standard output:

$ echo hello | uuencode hello >hello.uu
$ cat hello.uu
begin 664 hello
&:&5L;&\*
`
end
$ uudecode -o - hello.uu
uudecode usage error:
You cannot specify an output file when processing
multiple input files.
uudecode (GNU sharutils) - decode an encoded file - Ver. 4.13.3
USAGE: uudecode [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ file ... ][test@fedora-19 test]$
$ echo $?
64

First "uudecode -o - hello.uu" counts input files wrongly. There is only one
input with only one encoded file, but it reports there are more input files.

Second the error message does not print new line at the end of usage line.
(After "[ file ...]".)


Also there is another bug: Replacing "-" with "/dev/stdout" leads to differnt
error even if uudecode(1) reads:

If the output file is specified to be /dev/stdout or -,
the result will be written to standard output.

$ uudecode -o /dev/stdout hello.uu
uudecode: /dev/stdout: Permission denied
$ echo $?
8

-- Petr

Bruce Korb

unread,
Jan 21, 2013, 2:12:35 PM1/21/13
to Petr Pisar, bug-gn...@gnu.org
On 01/21/13 02:12, Petr Pisar wrote:
> Second the error message does not print new line at the end of usage line.
> (After "[ file ...]".)

That has already been fixed.

> Also there is another bug: Replacing "-" with "/dev/stdout" leads to differnt
> error even if uudecode(1) reads:
>
> If the output file is specified to be /dev/stdout or -,
> the result will be written to standard output.
>
> $ uudecode -o /dev/stdout hello.uu
> uudecode: /dev/stdout: Permission denied
> $ echo $?
> 8

The code is blindly opening whatever argument was passed in.
Apparently, you cannot open /dev/stdout in your configuration.
I've now modified the code to look for file names "-" and
"/dev/stdout" as special cases. I am adding your case as a test case.
Thanks!

0 new messages