Bug 45349

Summary: /bin/sh and 8-bit characters
Product: Base System Reporter: pw34 <pw34>
Component: binAssignee: Tim Robbins <tjr>
Status: Closed FIXED    
Severity: Affects Only Me CC: pw34
Priority: Normal    
Version: 1.0-RELEASE   
Hardware: Any   
OS: Any   

Description pw34 2002-11-17 00:30:00 UTC
 On my FreeBSD 4.5 system, I found that /bin/sh incorrectly parses the 
 characters 129 and 136 (decimal).
 
 I was wondering if this has been fixed, I saw no mention of it in any
 release notes, and the bug list on freebsd.org wasn't really clear on
 this ( http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/28449 ).
 
 Here is some perl which finds which chars fail to work right.
 
 #!/usr/bin/perl -w
 # test_sh.pl , pete weisz
 mkdir "garbage_XXXX", 0777;
 chdir "garbage_XXXX";
 for $x (128..255) {
    $c = chr($x);
    system("echo blah > \"./$c\"");   # calls /bin/sh
    unless (-e $c) {
       print "$x did not work\n";
       next;
    }
    unlink $c;
 }
Comment 1 Giorgos Keramidas freebsd_committer freebsd_triage 2002-11-20 00:34:57 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs


Refile under the bin/ category.  Please remember to fill the Category 
field when submitting bug reports.
Comment 2 Jens Schweikhardt freebsd_committer freebsd_triage 2003-01-04 16:49:17 UTC
State Changed
From-To: open->feedback

Your program prints nothing on 5-current, so it appears to be fixed. 
Can you try a recent STABLE release, like 4.7?
Comment 3 Peter Pentchev 2003-01-07 12:15:09 UTC
On Tue, Jan 07, 2003 at 11:42:54AM +0100, Jens Schweikhardt wrote:
> On Mon, Jan 06, 2003 at 07:18:20PM -0500, pw34@cornell.edu wrote:
> # Thanks. Should I take your email to mean that the fix has been applied to 
> # STABLE?
> 
> No, it means I only have -current running (where it works) and need
> someone to verify it on a recent -stable.

On today's 4.7-STABLE:

[roam@straylight:p5 ~/tmp/shtest]$ perl shtest.pl
cannot create ./: is a directory
129 did not work
cannot create ./: is a directory
136 did not work
[roam@straylight:p5 ~/tmp/shtest]$

So it seems it is still not quite OK on -STABLE.

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Hey, out there - is it *you* reading me, or is it someone else?
Comment 4 Tim Robbins freebsd_committer freebsd_triage 2003-01-08 10:32:14 UTC
Responsible Changed
From-To: freebsd-bugs->tjr

I'll handle this one.
Comment 5 Tim Robbins freebsd_committer freebsd_triage 2003-01-08 10:51:51 UTC
State Changed
From-To: feedback->patched

Fixed in -current (src/bin/sh/expand.c revs. 1.39,1.41). 
Change will be MFC'd after 2 weeks.
Comment 6 Tim Robbins freebsd_committer freebsd_triage 2003-01-17 07:46:53 UTC
State Changed
From-To: patched->closed

Fixed in -stable. Thanks for the report.