From: Tomas M <tomas@slax.org>
To: linux-fsdevel@vger.kernel.org
Subject: possible bug in /proc filesystem?
Date: Sat, 25 Jun 2011 21:32:42 +0200 [thread overview]
Message-ID: <4E0637DA.3010502@slax.org> (raw)
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
next reply other threads:[~2011-06-25 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-25 19:32 Tomas M [this message]
[not found] ` <BANLkTim1xvkuihgvnEixhKe4LUb4DYLRQg@mail.gmail.com>
2011-06-26 17:55 ` possible bug in /proc filesystem? Tomas M
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E0637DA.3010502@slax.org \
--to=tomas@slax.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).