*BSD News Article 79222


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!cancer.vividnet.com!hunter.premier.net!www.nntp.primenet.com!nntp.primenet.com!arclight.uoregon.edu!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail
From: brian@awfulhak.demon.co.uk (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: 2nd try: amd -vs- home directories...
Date: 24 Sep 1996 23:50:43 +0100
Organization: Coverform Ltd.
Lines: 44
Message-ID: <529ok3$mao@anorak.coverform.lan>
References: <3246BCFD.41C67EA6@baynetworks.com>
NNTP-Posting-Host: localhost.coverform.lan
X-NNTP-Posting-Host: awfulhak.demon.co.uk
X-Newsreader: TIN [version 1.2 PL2]

Robert Withrow (bwithrow@baynetworks.com) wrote:
: For some reason FreeBSD is converting home directory
: mountpoints to the actuall mount directory, which causes
: problems.  Can someone tell me how to prevent this? 

: bash$ ypcat passwd | grep bwithrow
: bwithrow:<rem>:<rem>:20:Robert Withrow:/bne/home/bwithrow:/bin/csh

: bash$ telnet tuva
: Trying 192.32.180.119...
: Connected to tuva
: Escape character is '^]'.

:    FreeBSD (tuva) (ttyp3)

: login: bwithrow
: Password:

: bash$ pwd
: /a/akila-e1/usr25/bwithrow
: bash$ echo $HOME
: /bne/home/bwithrow
: bash$ cd $HOME
: bash$ pwd
: /bne/home/bwithrow

This has always been a bit of a problem.  When you do the first "pwd",
the only way that bash can determine the current directory is by
climbing the path:

start:
    stat "." and remember the device & inode
    if ".." is the same, break
    open ".." and parse 'till you find something w/ the same device & inode.
    tack the name on the *front* of the path
    goto start, tacking "../" on the front of all stats and opens.

After that, bash caches the current directory.  This can be proven by
running bash (another shell) after your last command above - you'll be
back in the /a/akila-e1/usr25/bwithrow directory !

--
Brian <brian@awfulhak.demon.co.uk>
Don't _EVER_ lose your sense of humour....