From owner-freebsd-current Sun May 19 8:34:50 2002 Delivered-To: freebsd-current@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id AA4DD37B40C; Sun, 19 May 2002 08:34:44 -0700 (PDT) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.3/8.12.3) with ESMTP id g4JFYcHc053885 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sun, 19 May 2002 17:34:41 +0200 (CEST) (envelope-from ticso@cicely5.cicely.de) Received: from cicely5.cicely.de (localhost [IPv6:::1]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id g4JFYT95063784 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 19 May 2002 17:34:29 +0200 (CEST)?g (envelope-from ticso@cicely5.cicely.de) Received: (from ticso@localhost) by cicely5.cicely.de (8.12.1/8.12.1/Submit) id g4JFYTAf063783; Sun, 19 May 2002 17:34:29 +0200 (CEST)?g (envelope-from ticso) Date: Sun, 19 May 2002 17:34:28 +0200 From: Bernd Walter To: "J. Mallett" Cc: freebsd-current@FreeBSD.ORG Subject: Re: make(1) patch to ReadMakefile() to use realpath(3) Message-ID: <20020519153428.GK44753@cicely5.cicely.de> References: <20020519100420.GA8356@FreeBSD.ORG> <20020519132159.GI44753@cicely5.cicely.de> <20020519140003.GA19399@FreeBSD.ORG> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020519140003.GA19399@FreeBSD.ORG> User-Agent: Mutt/1.3.26i X-Operating-System: FreeBSD cicely5.cicely.de 5.0-CURRENT i386 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, May 19, 2002 at 02:00:04PM +0000, J. Mallett wrote: > On Sun, May 19, 2002 at 03:21:59PM +0200, Bernd Walter wrote: > > Why do people think that a realpath is always available? > > Because the manual page doesn't say it isn't. > > > What is wrong with just extending using pwd? > > That won't handle . and .. and relative paths spanning symbolic links, which > you may or may not want to see in the output, etc. > > > And maybe optionally stripping .. and . elements if wanted. > > The ODE make(1) as seen in CMU buildtools4 did this by hand, there's no reason > we couldn't either, except someone would likely come along and use realpath(3) > in place of it at a later date. That's what I did to ODE. > > > At least pwd doesn't break amd(8) pathnames. > > How does realpath _break_ amd(8) pathnames? I'm not very familiar with any > functionality that would cause this. If realpath(3) gets broken, that sounds > like we either need some new conditions in realpath(3), or we need to fix > amd(8) paths. > > > It became nearly impossible to use amd(8) today just because of all that > > realpath introduced breakage. > > To what end? More information is helpful. amd works as a userland nfs server which builds softlinks to the path it mounts the volume. An example: [52]cicely30> cd /net [53]cicely30> ls -al total 3 dr-xr-xr-x 2 root wheel 512 May 18 14:08 . drwxr-xr-x 19 root wheel 512 May 18 14:08 .. [54]cicely30> ls -ald cicely5.cicely.de/var/d9 drwxr-xr-x 4 root wheel 512 May 19 01:03 cicely5.cicely.de/var/d9 [55]cicely30> ls -al total 4 dr-xr-xr-x 2 root wheel 512 May 19 17:10 . drwxr-xr-x 19 root wheel 512 May 18 14:08 .. lrwxrwxrwx 1 root wheel 22 May 19 17:10 cicely5.cicely.de -> /.amd_mnt/cicely5/host [56]cicely30> mount | grep d9 cicely5:/var/d9 on /.amd_mnt/cicely5/host/var/d9 (nfs, nodev, nosuid) [57]cicely30> mount | grep net pid192@cicely30:/net on /net (nfs) amd has mounted cicely5:/var/d9 on /.amd_mnt/cicely5/host/var/d9 because /net/cicely5.cicely.de/var/d9 was accessed. But /net/cicely5.cicely.de/var/d9 is visible as a softlink. After a while /.amd_mnt/cicely5/host/var/d9 gets unmounted. Now we can't access the realpath anymore! But the path we originally used (/net/cicely5.cicely.de/var/d9) is still fully functional. My "canonical" path is /net/cicely5.cicely.de/var/d9 - even it contains a softlink. It's worse if I want to relocate the data to another server. amd mounts the path under a different name, but the intended access path is still valid. If I can't mount on fly or relocate directories it would obsolete any possible benefit from amd. Even without amd realpath(3) sucks. Say I have a fat volume mounted under /var/d1. I softlink /usr/local to /var/d1/local and /home to /var/d1/home. Now that fat volume gets filled and I add a second volume under /var/d2. To have an effect I relocate /var/d1/home to /var/d2/home and update the link. Thanks to all that realpath(3) crap /var/d1/home got spread into thousands places and I have to softlink /var/d1/home to /var/d2/home... I even can't buildworld on another machine without taking care of realpath. If I don't enshure that the source has the same realpath on the machine to run installworld as it had on the machine where I did the buildworld it break. And all that without a real benefit from blindly using realpath(3). -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message