From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomas M Subject: possible bug in /proc filesystem? Date: Sat, 25 Jun 2011 21:32:42 +0200 Message-ID: <4E0637DA.3010502@slax.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from smtp-out3.iol.cz ([194.228.2.91]:39952 "EHLO smtp-out3.iol.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016Ab1FYUBE (ORCPT ); Sat, 25 Jun 2011 16:01:04 -0400 Received: from antivir5.iol.cz (unknown [192.168.30.212]) by smtp-out3.iol.cz (Postfix) with ESMTP id 17ED1BC8102 for ; Sat, 25 Jun 2011 19:33:25 +0000 (UTC) Received: from localhost (antivir5.iol.cz [127.0.0.1]) by antivir5.iol.cz (Postfix) with ESMTP id 06FD91E8044 for ; Sat, 25 Jun 2011 21:33:25 +0200 (CEST) Received: from antivir5.iol.cz ([127.0.0.1]) by localhost (antivir5.iol.cz [127.0.0.1]) (amavisd-new, port 10224) with LMTP id WR6lX2feHhNh for ; Sat, 25 Jun 2011 21:33:24 +0200 (CEST) Received: from port4.iol.cz (unknown [192.168.30.94]) by antivir5.iol.cz (Postfix) with ESMTP id DCDD01E8034 for ; Sat, 25 Jun 2011 21:33:24 +0200 (CEST) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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