I've been having some trouble with this, and I was wondering if
I could get some help. I'm brand new to kernel hacking, so I was hoping
I could get some help from you folks.
Here's the problem: I want a message printed to /var/log/messages
every time someone tries to open /etc/passwd. I've decided to start with
sys_open() -- what I'm having trouble with is figuring out if the file being
opened is /etc/passwd. :P
My first idea was just a simple strcmp() .. however, I started
realizing that not all calls have absolute pathnames (ie, instead of
/etc/passwd, it could just be passwd, or even ../passwd), so I've decided
to try and keep track of the inode.
Finding the inode of passwd is simple from the shell .. ls -i ..
but for the life of me, I can't get namei() to give me the same number.
Am I totally off base here, or am I sort of on the right track? :)
http://www.europa.com/~pb/ a living. The world owes you nothing. It
Powered by Linux since '95 was here first." -- Mark Twain