From nobody@FreeBSD.org  Fri Sep 27 16:35:07 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0383437B401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Sep 2002 16:35:07 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B982D43E65
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Sep 2002 16:35:06 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g8RNZ67R014902
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Sep 2002 16:35:06 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.6/8.12.6/Submit) id g8RNZ6MT014901;
	Fri, 27 Sep 2002 16:35:06 -0700 (PDT)
Message-Id: <200209272335.g8RNZ6MT014901@www.freebsd.org>
Date: Fri, 27 Sep 2002 16:35:06 -0700 (PDT)
From: Paul te Bokkel <paul@teBokkel.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: setting CDPATH causes compiling ports and installworld to fail
X-Send-Pr-Version: www-1.0

>Number:         43439
>Category:       misc
>Synopsis:       setting CDPATH causes compiling ports and installworld to fail
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 27 16:40:01 PDT 2002
>Closed-Date:    Tue Oct 01 11:29:00 PDT 2002
>Last-Modified:  Tue Oct 01 11:29:00 PDT 2002
>Originator:     Paul te Bokkel
>Release:        4.7 RC#0 (02/09/26@03:00GMT)
>Organization:
>Environment:
FreeBSD devil.tebokkel.com 4.7-RC FreeBSD 4.7-RC #0: Thu Sep 26 05:09:56 CEST 2002     root@naya.internal.tebokkel.com:/usr/obj/usr/src/sys/DEVIL  i386      
>Description:
Having a CDPATH in the environment set to (for example) ~:/usr:/usr/local causes the building of ports (for example nessus or proftpd) to fail and also an installworld (prepared on another machine). The symptoms are the failing of build, ending in a 'Cannot cd to xxxx'.
I normally use bash2 (05b) but it also seem to occur with tcsh.
>How-To-Repeat:
export CDPATH=~:/usr:/usr/local
cd /usr/src && make installworld
cd /usr/ports/ftp/proftpd && make

>Fix:
I think _unsetting_ the CDPATH in de mk-files is advisable. At least a warning or doc-change would do the trik. I didn't look into the actual cause.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: schweikh 
State-Changed-When: Sat Sep 28 09:13:27 PDT 2002 
State-Changed-Why:  
Two questions: 
- why are you *exporting* a CDPATH? It's good for login shells and you 
simply assign to it in your .profile. You'd mess up almost any /bin/sh 
script you run. 
- why don't you put dot first in your CDPATH to make the CDPATH mechanism 
for all shells alike? If CDPATH is set and does not contain dot, /bin/sh 
will not look in dot (while bash, tcsh and zsh apparently do). 

The problem is that *un*setting shell variables in makefiles is awkward 
(you'd have to prepend each command with "unset CDPATH"). One workaround 
is setting CDPATH=. from some makefile. However I think you should fix 
your CDPATH as described. Maybe it's a good idea to change the CDPATH 
mechanism in /bin/sh, IEEE Std 1003.1-2001 does not describe CDPATH, 
so we're free to align it with the other shells. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43439 
State-Changed-From-To: feedback->closed 
State-Changed-By: schweikh 
State-Changed-When: Tue Oct 1 11:28:23 PDT 2002 
State-Changed-Why:  
Can be worked around by not exporting CDPATH. 

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