Date: Mon, 19 Mar 2007 19:19:54 GMT From: David Sanderson<dsanderson@panasas.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/110530: sh cd updates current directory even when cd fails Message-ID: <200703191919.l2JJJs0A082659@www.freebsd.org> Resent-Message-ID: <200703191930.l2JJU3jU029824@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 110530 >Category: misc >Synopsis: sh cd updates current directory even when cd fails >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 19 19:30:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: David Sanderson >Release: 6.2-RELEASE >Organization: Panasas >Environment: FreeBSD freebsd6 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 >Description: In sh on FreeBSD 6.2, a failed cd command updates the shell's notion of the current directory as if the cd succeeded. I tried this on a FreeBSD 4.3 system and the sh there did not have this problem. I'm not sure when the regression appeared. >How-To-Repeat: : freebsd6; cd / : freebsd6; cd /tmp : freebsd6; env | grep PWD OLDPWD=/ PWD=/tmp : freebsd6; pwd /tmp : freebsd6; cd /var/crash cd: can't cd to /var/crash : freebsd6; pwd /var/crash <-- this is incorrect : freebsd6; env | grep PWD OLDPWD=/tmp PWD=/var/crash : freebsd6; /bin/pwd /tmp <-- /bin/pwd is correct : freebsd6; echo $0 -sh >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703191919.l2JJJs0A082659>