kern___getcwd() returns ENOTDIR
From: Kentucky Mandeloid Mo. (ky_at_df.ru)
Date: 06/27/04
- Previous message: Robert Watson: "Re: A few technical items on UFS2 and snapshots..."
- Next in thread: David Schultz: "Re: kern___getcwd() returns ENOTDIR"
- Reply: David Schultz: "Re: kern___getcwd() returns ENOTDIR"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: freebsd-hackers@freebsd.org Date: Sun, 27 Jun 2004 19:25:40 +0400
I'm writng a smal kernel module that catches file access syscalls.
At every syscall I need a full name of file is being passed to a syscall.
I'm getting it with a path passed to syscall and if path is not starting
with / I get current working directory of process using kern___getcwd().
In every syscall all works just fine except rmdir & unlink.
Sometimes in unlink and everytime in rmdir it returns "not a directory" error.
I know already that kern___getcwd() works through vnode cache and this method
is not a reliable way to get file names.
So is there any other way get cwd of a proccess?
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Robert Watson: "Re: A few technical items on UFS2 and snapshots..."
- Next in thread: David Schultz: "Re: kern___getcwd() returns ENOTDIR"
- Reply: David Schultz: "Re: kern___getcwd() returns ENOTDIR"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: kern___getcwd() returns ENOTDIR
... +>> I'm writng a smal kernel module that catches file access syscalls. ...
+>> At every syscall I need a full name of file is being passed to a syscall. ...
+>> Sometimes in unlink and everytime in rmdir it returns "not a directory" error.
... (freebsd-hackers) - Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
... the "open" syscall. ... forced unlink() followed by an open. ...
copying to move across file systems and there is no way to control this. ... Changing the
target to a symlink to a directory on a different file ... (FreeBSD-Security) - Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
... still follow a symlink if one is created between the "unlink" syscall and ...
the "open" syscall. ... /* remove existing destination file name, ... (FreeBSD-Security)