From owner-freebsd-hackers Mon Jan 6 16:58:22 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD66437B406 for ; Mon, 6 Jan 2003 16:58:19 -0800 (PST) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8463043EC5 for ; Mon, 6 Jan 2003 16:58:19 -0800 (PST) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by rwcrmhc51.attbi.com (rwcrmhc51) with ESMTP id <20030107005818051001ra4de>; Tue, 7 Jan 2003 00:58:18 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA07856; Mon, 6 Jan 2003 16:58:17 -0800 (PST) Date: Mon, 6 Jan 2003 16:58:16 -0800 (PST) From: Julian Elischer To: Pawel Jakub Dawidek Cc: Terry Lambert , freebsd-hackers@freebsd.org Subject: Re: Caching [sugestion]. In-Reply-To: <20030107003613.GG6825@prioris.mini.pw.edu.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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