From owner-cvs-src-old@FreeBSD.ORG Sat Jul 3 21:09:30 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78A26106566B for ; Sat, 3 Jul 2010 21:09:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6683F8FC23 for ; Sat, 3 Jul 2010 21:09:30 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o63L9UEM081647 for ; Sat, 3 Jul 2010 21:09:30 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o63L9UjH081646 for cvs-src-old@freebsd.org; Sat, 3 Jul 2010 21:09:30 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201007032109.o63L9UjH081646@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Sat, 3 Jul 2010 21:06:48 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/bin/sh expand.c src/tools/regression/bin/sh/expansion pathname2.0 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jul 2010 21:09:30 -0000 jilles 2010-07-03 21:06:48 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) bin/sh expand.c Added files: (Branch: RELENG_7) tools/regression/bin/sh/expansion pathname2.0 Log: SVN rev 209675 on 2010-07-03 21:06:48Z by jilles MFC r207944: sh: Fix pathname expansion with quoted slashes like *\/. These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash. Because this is the first code I'm importing from dash to expand.c, add the Herbert Xu copyright notice which is in dash's expand.c. When pathname expanding *\/, the CTLESC representing the quoted state was erroneously taken as part of the * pathname component. This CTLESC was then seen by the pattern matching code as escaping the '\0' terminating the string. The code is slightly different because dash converts the CTLESC characters to backslashes and removes all the other CTL* characters to allow substituting glob(3). The effect of the bug was also slightly different from dash (where nothing matched at all). Because a CTLESC can escape a '\0' in some way, whether files were included despite the bug depended on memory that should not be read. In particular, on many machines /*\/ expanded to a strict subset of what /*/ expanded to. Example: echo /*"/null" This should print /dev/null, not /*/null. PR: bin/146378 Obtained from: dash Revision Changes Path 1.51.2.3 +15 -9 src/bin/sh/expand.c 1.1.4.2 +31 -0 src/tools/regression/bin/sh/expansion/pathname2.0 (new)