How to do realpath() in kernel mode?
Hi all,
I'm writing a kernel module that hooks the open() syscall (yes I know Linus hates this, but it's for an assignment so I don't have much of a choice) and makes a note whenever an attempt is made to open() something in /tmp. However, simply checking whether the filename argument to open() starts with "/tmp/" is not enough, because of relative paths, "..", symlinks etc. So I need a more reliable way to verify that the filename argument to open() resolves to something in /tmp. In user space there's the realpath() function in stdlib, but how does one do that in kernel mode?
Thanks in advance,
Alphons
|