Re: File name.

2002-02-04 Thread Terry Lambert
Pawe³ Jakub Dawidek wrote: > Nope. We are in kernel area. > I want to control for example open() syscall: > static int my_open(register struct proc *p, register struct open_args *ea) > { > [...] > } > Name of file to open is in ea->path, but this name can be: ./somefile > and i need a full path to

Re: file name

2002-02-04 Thread Paweł Jakub Dawidek
On Mon, Feb 04, 2002 at 01:36:44PM +0300, Eugene L. Vorokov wrote: +> I faced that problem once. I used an ugly hack: simulation of __getcwd() +> syscall. You need to allocate user memory via mmap() with MAP_ANON flag, +> pass it to __getcwd(), then copy string to kernel using copyin() or like +>

Re: file name

2002-02-04 Thread Eugene L. Vorokov
> I want to control for example open() syscall: > static int my_open(register struct proc *p, register struct open_args *ea) > { > [...] > } > Name of file to open is in ea->path, but this name can be: ./somefile > and i need a full path to it. I faced that problem once. I used an ugly hack: sim

Re: File name.

2002-02-04 Thread Paweł Jakub Dawidek
On Mon, Feb 04, 2002 at 01:27:39AM -0800, Terry Lambert wrote: +> char *saved_name; +> +> func() +> { +> char *foo; +> +> ... +> +> fd = open( foo, O_RDWR, 0664); +> saved_name = strdup( foo); +> +> ... +> +>

Re: File name.

2002-02-04 Thread Terry Lambert
Pawe³ Jakub Dawidek wrote: > I can get vnode of changed file. > I can get inode number of changed file. > But how can i get file name? > > There is a way to get inode when i have file name and p (struct proc), so > maybe there is a way to get file name from inode number and p. > > And another t

Re: File name.

2002-02-04 Thread Paweł Jakub Dawidek
On Sun, Feb 03, 2002 at 11:54:58PM -0800, Alfred Perlstein wrote: +> However there's a dirty way to get at it via the vfs lookup cache +> entries hung off the vnode. Paul Saab showed me a delta that +> did something nasty like this, but I've got no clue as to where +> it is now. +> Hmm... And w

Re: File name.

2002-02-03 Thread Alfred Perlstein
* Pawel Jakub Dawidek <[EMAIL PROTECTED]> [020203 23:49] wrote: > On Sun, Feb 03, 2002 at 10:11:37PM +0100, Pawel Jakub Dawidek wrote: > +> But how can i get file name? > +> > [...] > +> I got file name, but how can I get full path name for this file? > +> > Answer that there is no way to get th

Re: File name.

2002-02-03 Thread Paweł Jakub Dawidek
On Sun, Feb 03, 2002 at 10:11:37PM +0100, Paweł Jakub Dawidek wrote: +> But how can i get file name? +> [...] +> I got file name, but how can I get full path name for this file? +> Answer that there is no way to get that will be nice too. -- Paweł Jakub Dawidek Network Administrator. Am I Evil