From nobody@FreeBSD.org  Mon Mar 19 19:20:05 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D763C16A405
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 19 Mar 2007 19:20:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id C948913C469
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 19 Mar 2007 19:20:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2JJK5mf082748
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 19 Mar 2007 19:20:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2JJF3x0078797;
	Mon, 19 Mar 2007 19:15:03 GMT
	(envelope-from nobody)
Message-Id: <200703191915.l2JJF3x0078797@www.freebsd.org>
Date: Mon, 19 Mar 2007 19:15:03 GMT
From: David Sanderson<dsanderson@panasas.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sh cd updates current directory even when cd fails
X-Send-Pr-Version: www-3.0

>Number:         110531
>Category:       bin
>Synopsis:       /bin/sh: sh cd updates current directory even when cd fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    stefanf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 19 19:30:03 GMT 2007
>Closed-Date:    Fri Mar 30 17:00:08 GMT 2007
>Last-Modified:  Fri Mar 30 17:00:08 GMT 2007
>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:
Responsible-Changed-From-To: freebsd-bugs->stefanf 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Mar 19 19:32:13 UTC 2007 
Responsible-Changed-Why:  
Assign to maintainer 


http://www.freebsd.org/cgi/query-pr.cgi?pr=110531 
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Fri Mar 30 16:59:46 UTC 2007 
State-Changed-Why:  
Duplicate of bin/101316. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110531 
>Unformatted:
