linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* possible bug in /proc filesystem?
@ 2011-06-25 19:32 Tomas M
       [not found] ` <BANLkTim1xvkuihgvnEixhKe4LUb4DYLRQg@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas M @ 2011-06-25 19:32 UTC (permalink / raw)
  To: linux-fsdevel

I'm trying to list all opened fd (file descriptors) through /proc by apache, using the following method:

- in apache process (php script), traverse /proc entries for all processes owned by 'apache' user
- find out all 'fd' directories and list all symlinks inthere
- use that data to find out all files opened by apache

My problem is that I can't do that as the apache user, the directory /proc/1234/fd/ is owned by root even if the process 1234 is apache (and runs under 'apache' user and 'apache' group).

Is this a bug in /proc filesystem? Or is there a functionality in kernel made for apache so it is able to somehow modify 'fd' directory in proc to not be owned by apache but by root instead?

I am willing to patch kernel sources in /fs/proc/* in order to get a better behavior, would anybody please suggest what function in kernel's proc sources to modify in order to either force apache owner for the 'fd' directory or to make it 'executable by all' so I could list the links inthere even without the need to be root?

Thank you very much

Tomas M


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-26 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-25 19:32 possible bug in /proc filesystem? Tomas M
     [not found] ` <BANLkTim1xvkuihgvnEixhKe4LUb4DYLRQg@mail.gmail.com>
2011-06-26 17:55   ` Tomas M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).