Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 1996 19:15:43 -0400 (EDT)
From:      Dave Chapeskie <dchapes@zeus.leitch.com>
To:        FreeBSD-hackers@FreeBSD.org
Subject:   BUG in FreeBSD 2.1R
Message-ID:  <199604242315.TAA07530@ale.zeus.leitch.com>
In-Reply-To: <199604242137.XAA28721@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
>As Seppo Kallio wrote:
>> 
>> If I have
>> 
>> /opt/ftp directory with permissions    -rwx-----
>> 
>> Then I mount /opt/ftp /dev/sd1a having -rwxr-xr-x
>> 
>> The /opt/ftp directory is getting the real permissions from the original
>> directory definition, but it is SHOWING the permissions the mounted disk
>> directory has.
>
>cd /opt/ftp
>pwd
>
>:-)
>
>This seems to be a bug with all Unix implementations i've seen so far.
>The simplest workaround: since mount points finally always use the
>permissions from the mounted resource, do always give them 555 or 755
>permissions.
>
>-- 
>cheers, J"org
>
>joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
>Never trust an operating system you don't have sources for. ;-)

    This is not a bug.  I asked this question a year and a half ago on
comp.os.386bsd.questions when pwd started giving me errors and I got the
following useful reply.  The only thing the system uses the mount
point's permissions for is in reading ".."

>From: blymn@awadi.com.au (Brett Lymn)
Newsgroups: comp.os.386bsd.questions
Subject: Re: pwd problem with NFS
Date: 05 Sep 1994 06:55:47 GMT
Message-ID: <BLYMN.94Sep5162547@mallee.awadi.com.au>

At first I was going to just shrug my shoulders and say "I dunno" but
after a bit of thought I think I have a theory (It's all mine!!!).

The theory goes that though we are used to thinking that a file system
"covers up" the underlying mount point.  This cannot work for some
things.  Consider the concept of "..", from the file system point of
view there is no ".." because it is the top of the tree.  When that
file system gets mounted under another one then I suppose some magic
is done to point ".." of the mounted file system to the correct i-node
of the mount point so that when you do something like "cd .." it works
properly.  Otherwise you would have the weird situation of doing a "cd
.." from the mounted file system and staying where you are - just like
you do in /.

  Now if the permissions of the mount point are such that
you cannot read them then you cannot work out what you parent
directory is hence the message from ls *but* the permissions you see
for the mount point when something is mounted are those for "." of the
mounted file system *not* the mount point.  Getting everything to work
so that you could see the underlying mount permissions without
breaking the concept of just having something that looks like one big
file system (anyone for VMS style sys$dsk0:[usr.blymn]? .... I thought
not ;-) would be - ummmm - challenging.

  Managing disk storage on a unix system is made a lot easier by the
fact you can do things like "hmmmm /var is filling up / a lot - I'll
wack another disk on and mount it under /var to fix that"

    Dave> I wonder how many
    Dave> people get burned on this one.

*Lots*  I am on a Sun mailing list and see this problem turn up quite
regularly.

--
Brett Lymn

-- 
Dave Chapeskie
Leitch Technology International Inc.
Email: dchapes@zeus.leitch.com



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