sys_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am making some modifications to the Linux sys_open function to keep track of various things. Two of the things I am trying to do is to get the path of the executable that is doing the open, and the path of the file being opened.
Let me start with the file name: I have tried to copy the path from the user (it is stored by) filename using strncpy_from_user into a buffer of size PATH_MAX, and also tried to strcpy tmp, which is what getname(filename) returns (a kernel pointer). Every time I try to copy this though, my kernel just crashes. My theory is that it is missing a '\0' but I am not really sure. Can someone help?
My other problem is figuring out where to get the path for exec from, is there someway to find this using current? I've been looking through several files, but couldn't figure out a way.


Thanks for your help,
Can Sar


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux