Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 May 2010 16:27:51 GMT
From:      Peer Stritzinger <peer@stritzinger.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/146378: sh(1) can't path expand  foo/*"/baz" patterns
Message-ID:  <201005071627.o47GRpO1011796@www.freebsd.org>
Resent-Message-ID: <201005071630.o47GU6UE044469@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         146378
>Category:       bin
>Synopsis:       sh(1) can't path expand  foo/*"/baz" patterns
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 07 16:30:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Peer Stritzinger
>Release:        FreeBSD 8.0-RELEASE i386
>Organization:
Dipl.Phys. Peer Stritzinger GmbH
>Environment:
FreeBSD xxx.xxx.xxx 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
sh(1) does not path expand correctly if the combination *"/ appears in the path.

Paths like foo/*/"baz"  work and also path like fo*"bar".  Also "foo/"*/baz works.

But not paths like foo/*"/baz"

This occurs e.g. in the configure scripts of the latest rtems embedded operating system, this was seen "in the wild":

for bsp_cfgs in `ls "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/"*"/make/custom/$1.cfg" 2>/dev/null`; do

When the port in the ports collection is updated this problem might arise.

I tested this also under other BSDis systems especially an older version of FreeBSD:

FreeBSD 6.1-RELEASE-p3 i386 -> works
OpenBSD 4.2 i386 -> works


>How-To-Repeat:
in an empty directory:

Preparation:

$ mkdir -p foo/bar/baz

Test using /bin/sh:

$ echo foo/*"/baz"
foo/*/baz

-> correct would be the output foo/bar/baz


>Fix:


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005071627.o47GRpO1011796>