bin/153276: uudecode error message is incorrect

David Brennan freebsd at brennanhome.com
Sat Dec 18 19:20:09 UTC 2010


>Number:         153276
>Category:       bin
>Synopsis:       uudecode error message is incorrect
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 18 19:20:08 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     David Brennan
>Release:        OS X.6.5
>Organization:
>Environment:
Darwin clifford.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov  5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386

>Description:
I discovered this problem on my OS X machine, and I am just trying to pass the information upstream as I see it also exists in the FreeBSD source code.

When using uudecode, if an improper character is detected, the error message that is printed does not match the actual error. The problem is that the IS_DEC macro allows character 32-96 inclusive. But the error message says that the allowed characters are 33-96. This caused me some trouble in diagnosing a problem with an external uuencode system.


#define IS_DEC(c)	 ( (((c) - ' ') >= 0) && (((c) - ' ') <= 077 + 1) )

#define OUT_OF_RANGE do {						\
	warnx("%s: %s: character out of range: [%d-%d]",		\
	    infile, outfile, 1 + ' ', 077 + ' ' + 1);			\

As you can see, the error message includes a 1 + ' ', which this IS_DEC macro does not have.

>How-To-Repeat:
This only occurs with an improperly formatted file. Here is a simple way to improperly format a file.
$ echo "This is a test" >temp.txt
$ uuencode -o temp.uu temp.txt temp.txt
$ cat temp.uu
begin 644 temp.txt
/5&AI<R!I<R!A('1E<W0*
`
end

$ sed 's/^`$//' temp.uu | uudecode
uudecode: 
    input file: stdin
    encoded file: temp.txt
    character out of range: [33-96]


>Fix:
#define OUT_OF_RANGE do {						\
	warnx("%s: %s: character out of range: [%d-%d]",		\
	    infile, outfile, ' ', 077 + ' ' + 1);			\

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list