Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 16:58:16 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Pawel Jakub Dawidek <P.Dawidek@prioris.mini.pw.edu.pl>
Cc:        Terry Lambert <tlambert2@mindspring.com>, freebsd-hackers@freebsd.org
Subject:   Re: Caching [sugestion].
Message-ID:  <Pine.BSF.4.21.0301061653580.4845-100000@InterJet.elischer.org>
In-Reply-To: <20030107003613.GG6825@prioris.mini.pw.edu.pl>

next in thread | previous in thread | raw e-mail | index | archive | help


On Tue, 7 Jan 2003, Pawel Jakub Dawidek wrote:

> from vnode was mistake). That's why I think that there should be some
> caching mechanism that should remember file name of every opened file,
> name of executable and working directory.
> 
> Example rules:

I vaguely remember that Linux keeps teh path used aroud on openned file
descriptors some how but I don't remember the details.


> 
> 	We want to permit those operations:
> 	- opening file /etc/master.passwd for read only,
> 	- opening files that match to /tmp/temp.*  for write,
> 	- changing mode of files /tmp/temp.* to '0666', BUT via fchmod(2).
> 
> 	How to do that correct?
> 	There is no chance to do this in simple, clean way.

you would have to attach a 'chmod capability' to the file descriptor
when you open it.. in other words it would be pre-decided at open time.

Even if you remembered what name was used when you openned it you would
have no proof that it still had that name when you do the chmod.

> 
> I've returned to my old, ugly way - caching filenames on open(2) -
> it's working fine, but is complicated, because I need to catch calls
> of p->p_fd->fd_ofiles[X]->f_ops->fo_close() functions.
> 
> -- 
> Pawel Jakub Dawidek
> UNIX Systems Administrator
> http://garage.freebsd.pl
> Am I Evil? Yes, I Am.
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0301061653580.4845-100000>