From owner-freebsd-current Thu Dec 16 6:40:37 1999 Delivered-To: freebsd-current@freebsd.org Received: from gilgamesch.bik-gmbh.de (gilgamesch.bik-gmbh.de [194.233.237.194]) by hub.freebsd.org (Postfix) with ESMTP id E3DB315511 for ; Thu, 16 Dec 1999 06:40:34 -0800 (PST) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.9.3/8.7.3) id PAA41199; Thu, 16 Dec 1999 15:40:20 +0100 (MET) Date: Thu, 16 Dec 1999 15:40:20 +0100 From: Martin Cracauer To: Marcel Moolenaar Cc: Sheldon Hearn , current@FreeBSD.ORG Subject: Re: sh(1) broken caching [was: Re: Broken sh(1)?] Message-ID: <19991216154020.A41154@cons.org> References: <712.945183175@axl.noc.iafrica.com> <38565DEA.4487DF53@scc.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <38565DEA.4487DF53@scc.nl>; from Marcel Moolenaar on Tue, Dec 14, 1999 at 04:10:34PM +0100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You can also fool sh into running the *wrong* binary if if you have two in showdowed paths: #! /bin/sh test -d foo1 || mkdir foo1 test -d foo2 || mkdir foo2 test -d foo2 || mkdir foo3 echo 'echo :one' > foo1/run echo 'echo :two' > foo2/run echo 'echo :three' > foo2/run3 chmod a+x */run* hash -r echo echo Expect one: PATH=./foo3:./foo1:./foo2:./foo5 echo Expect two: PATH=./foo3:./foo3:./foo1 run echo run should be in in foo1: hash -v echo $PATH echo Should give one: run ==> runs foo2/run, not foo1/run. This is still covered by the quick fix I sent. Looking for cases that aren't... Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ BSD User Group Hamburg, Germany http://www.bsdhh.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message