From rfg@tristatelogic.com  Wed Jun 20 05:42:30 2012
Return-Path: <rfg@tristatelogic.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 63468106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Jun 2012 05:42:30 +0000 (UTC)
	(envelope-from rfg@tristatelogic.com)
Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118])
	by mx1.freebsd.org (Postfix) with ESMTP id 410C48FC12
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Jun 2012 05:42:29 +0000 (UTC)
Received: by segfault.tristatelogic.com (Postfix, from userid 1237)
	id 7905B5081B; Tue, 19 Jun 2012 22:32:32 -0700 (PDT)
Message-Id: <20120620053232.7905B5081B@segfault.tristatelogic.com>
Date: Tue, 19 Jun 2012 22:32:32 -0700 (PDT)
From: Ronald F.Guilmette <rfg@tristatelogic.com>
Reply-To: Ronald F.Guilmette <rfg@tristatelogic.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: /bin/sh provides crummy diagnositic when cd fails
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         169256
>Category:       bin
>Synopsis:       sh(1) provides crummy diagnositic when cd fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jilles
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 20 05:50:07 UTC 2012
>Closed-Date:    Tue Jul 03 22:37:35 UTC 2012
>Last-Modified:  Tue Jul 03 22:37:35 UTC 2012
>Originator:     Ronald F. Guilmette
>Release:        FreeBSD 8.3-RELEASE amd64
>Organization:
entropy
>Environment:

8.3-RELEASE amd64

>Description:

If you are running /bin/sh and you try to `cd' into a non-existant directory
(or one that you are not allowed to cd into, due to permissions) then /bin/sh
gives you the following unhelpful diagnostic:

	cd: can't cd to craponarope

(Here, the the directory name "craponarope" is just used as an example.)

I checked and both csh and bash give much more helpful diagnostics when
attempting to perform the same operation, i.e. :

	No such file or directory

In my opinion, /bin/sh should provide that more helpful diagnostic.

>How-To-Repeat:

	/bin/sh
	cd some-nonexistant-directory

>Fix:

I have not looked at the source, but I imagine that the fix should be
fairly trivial.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: jilles 
State-Changed-When: Sun Jun 24 17:33:15 UTC 2012 
State-Changed-Why:  
In 9-stable and 10-current, sh's cd builtin already writes errno messages. 
These are Subversion r222292 and r230095. 

I can MFC this to 8 if wanted. 


Responsible-Changed-From-To: freebsd-bugs->jilles 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Sun Jun 24 17:33:15 UTC 2012 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169256 
State-Changed-From-To: patched->closed 
State-Changed-By: jilles 
State-Changed-When: Tue Jul 3 22:35:53 UTC 2012 
State-Changed-Why:  
This is already fixed in 9-stable and 10-current; because the submitter 
does not ask me to and there may not even be an 8.4 release, I do not plan 
on MFC'ing the change to 8-stable. 

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