From: Chris Wright Subject: Re: kernel space realpath() Date: Mon, 24 Mar 2003 13:06:59 -0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030324130659.A15394@figure1.int.wirex.com> References: <20030323200353.GG31008@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Ramy M. Hassan" , linux-fsdevel@vger.kernel.org Return-path: To: Matthew Wilcox Content-Disposition: inline In-Reply-To: <20030323200353.GG31008@parcelfarce.linux.theplanet.co.uk>; from willy@debian.org on Sun, Mar 23, 2003 at 08:03:53PM +0000 List-Id: linux-fsdevel.vger.kernel.org * Matthew Wilcox (willy@debian.org) wrote: > On Sun, Mar 23, 2003 at 07:49:18PM +0200, Ramy M. Hassan wrote: > > I am new to kernel development. I am developing now a kernel module to > > create log of all file operations under a certain specified directory. I > > intercept the system calls that may do modifications to this directory > > contents and create the logfile. My problem is that a system call like > > sys_unlink takes a path that could be relative, and could contain ".." or > > ".". It might also contain components that are symlinks to other > > directories. So I want to get the real path of that file given its relative > > path name. > > Is there anyway to do that ? > > Isn't this exactly what the LSM project does? See http://lsm.immunix.org/ Actually, LSM works with dentry/vfsmount pairs not raw pathnames, but yes, there are filesystem level hooks that allow one to do things like this. -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net