Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 May 2002 17:34:28 +0200
From:      Bernd Walter <ticso@cicely5.cicely.de>
To:        "J. Mallett" <jmallett@FreeBSD.ORG>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: make(1) patch to ReadMakefile() to use realpath(3)
Message-ID:  <20020519153428.GK44753@cicely5.cicely.de>
In-Reply-To: <20020519140003.GA19399@FreeBSD.ORG>
References:  <20020519100420.GA8356@FreeBSD.ORG> <20020519132159.GI44753@cicely5.cicely.de> <20020519140003.GA19399@FreeBSD.ORG>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020519153428.GK44753>