From owner-freebsd-bugs Tue Jan 7 10:42:59 2003 Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4E2537B401 for ; Tue, 7 Jan 2003 10:42:57 -0800 (PST) Received: from cvsup.no.freebsd.org (c2h5oh.idi.ntnu.no [129.241.103.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA61643ED4 for ; Tue, 7 Jan 2003 10:42:56 -0800 (PST) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from localhost (localhost [127.0.0.1]) by cvsup.no.freebsd.org (8.12.6/8.12.6) with ESMTP id h07IgsE0054090; Tue, 7 Jan 2003 18:42:55 GMT (envelope-from tegge@cvsup.no.freebsd.org) To: roam@ringlet.net Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/45349: /bin/sh and 8-bit characters From: Tor.Egge@cvsup.no.freebsd.org In-Reply-To: <200301071220.h07CK3qv089807@freefall.freebsd.org> References: <200301071220.h07CK3qv089807@freefall.freebsd.org> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030107184254E.tegge@cvsup.no.freebsd.org> Date: Tue, 07 Jan 2003 18:42:54 GMT X-Dispatcher: imput version 20000228(IM140) Lines: 64 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > So it seems it is still not quite OK on -STABLE. With a minor tweak to the test program, the problem is still reproducable on 5.0-CURRENT. --- /tmp/shtest.pl Tue Jan 7 15:44:19 2003 +++ /tmp/shtest2.pl Tue Jan 7 19:31:05 2003 @@ -6,3 +6,3 @@ $c = chr($x); - system("echo blah > \"./$c\""); # calls /bin/sh + system("A=\"$c\"; echo blah > \"./\$A\""); # calls /bin/sh unless (-e $c) { Revision 1.39 of expand.c changes the initialization of the local variable "quotes" in argstr() but doesn't update similar code in exptilde(), expari(), expbackq() and evalvar(). Index: expand.c =================================================================== RCS file: /home/ncvs/src/bin/sh/expand.c,v retrieving revision 1.40 diff -u -r1.40 expand.c --- expand.c 26 Dec 2002 14:28:54 -0000 1.40 +++ expand.c 7 Jan 2003 15:33:29 -0000 @@ -278,7 +278,7 @@ char c, *startp = p; struct passwd *pw; char *home; - int quotes = flag & (EXP_FULL | EXP_CASE); + int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); while ((c = *p) != '\0') { switch(c) { @@ -369,7 +369,7 @@ char *p, *start; int result; int begoff; - int quotes = flag & (EXP_FULL | EXP_CASE); + int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); int quoted; @@ -436,7 +436,7 @@ int startloc = dest - stackblock(); char const *syntax = quoted? DQSYNTAX : BASESYNTAX; int saveherefd; - int quotes = flag & (EXP_FULL | EXP_CASE); + int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); INTOFF; saveifs = ifsfirst; @@ -635,7 +635,7 @@ int startloc; int varlen; int easy; - int quotes = flag & (EXP_FULL | EXP_CASE); + int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); varflags = *p++; subtype = varflags & VSTYPE; - Tor Egge To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message