From owner-freebsd-hackers Mon Jan 6 15:34:36 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 18B6A37B401 for ; Mon, 6 Jan 2003 15:34:35 -0800 (PST) Received: from prioris.mini.pw.edu.pl (prioris.mini.pw.edu.pl [194.29.178.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 717FC43E4A for ; Mon, 6 Jan 2003 15:34:34 -0800 (PST) (envelope-from P.Dawidek@prioris.mini.pw.edu.pl) Received: from localhost (localhost.mini.pw.edu.pl [127.0.0.1]) by prioris.mini.pw.edu.pl (Postfix) with ESMTP id 7E0357D2F7; Tue, 7 Jan 2003 00:34:32 +0100 (CET) Received: by prioris.mini.pw.edu.pl (Postfix, from userid 1091) id C3B517D307; Tue, 7 Jan 2003 00:34:27 +0100 (CET) Date: Tue, 7 Jan 2003 00:34:27 +0100 From: Pawel Jakub Dawidek To: David Schultz Cc: freebsd-hackers@freebsd.org Subject: Re: Caching [sugestion]. Message-ID: <20030106233427.GC6825@prioris.mini.pw.edu.pl> References: <20030105215024.GB99855@prioris.mini.pw.edu.pl> <3E18B97A.32ABAE7@mindspring.com> <20030106074005.GB6825@prioris.mini.pw.edu.pl> <20030106163723.GA721@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20030106163723.GA721@HAL9000.homeunix.com> User-Agent: Mutt/1.4i X-PGP-Key-URL: http://garage.freebsd.pl/jules.pgp X-OS: FreeBSD 4.7-STABLE i386 X-Virus-Scanned: by AMaViS (prioris) 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 Mon, Jan 06, 2003 at 08:37:23AM -0800, David Schultz wrote: +> You still haven't explained exactly what you're trying to do, but +> you may wish to look into Niels Provos' Systrace. It should give +> you a good example of how to do system call interposition in the +> kernel, and it has been ported to all three BSDs. +> +> http://www.citi.umich.edu/u/provos/systrace/ +> +> It sounds like you're trying to do something complicated with +> chdir, and that could make things harder. First of all, you +> should be comparing vnodes instead of pathnames when possible, in +> order to avoid canonicalization bugs. Second, it only makes sense +> to ask for the path of a directory vnode, since ordinary files can +> have multiple hard links. For directories, you can get the full +> path by walking up the '..' pointers, sort of like vn_fullpath(), +> except that you have to do a lookup if something is missing from +> the cache. I expect locking would be a pain as well. Yes, I know that already. Soon I'll send announce of what I'm doing, for now I'll use my ugly way. Not always is chance to operate only on vnodes. When You (for example) want to denied mode changes for some file, You can do this through catching chmod(2), but when someone open this file how You get file name when You want create policy rules for fchmod(2)? Remember that files could have temporary names, so You can't compare vnode from file descriptor with some file that You're expecting. PS. No comments about systrace... ever. -- 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