gnu linux update question

Bryn M. Reeves bmr at redhat.com
Wed Jun 29 10:01:59 UTC 2011


On 06/29/2011 06:39 AM, Genes MailLists wrote:
> On 06/28/2011 10:51 PM, Genes MailLists wrote:
>> On 06/28/2011 10:13 PM, James McKenzie wrote:
>>> On 6/28/11 6:37 PM, Genes MailLists wrote:
>>
>>
>>>>
>>>> Works fine as root.
>>> Usually ordinary users are prohibited from accessing /proc/<whatever> 
>>> from what I remember.  That is why root works and joe-blow does not.
>>>
>>> James McKenzie
>>>
>>
>> I'm totally fine with it - but seems to work for some - curiosity now.
>>
> 
>  Hah - this machine has rawhide kernel and procps - I suspect the latter
> could be a relevant difference to stock F15?

Not really. The procps package is just the userspace ps tools that use the /proc
file system as the data source (the name is a bit of a throwback).

There was some bugs waaay back in RHEL4/5 where the maps/smaps files were
created with overly restrictive permisions (S_IRUSR - read only for the owner of
the file) which caused problems for SUID applications that dropped their root
privileges but there's been nothing like this in Fedora's kernels for years
(that I know of anyway):

https://bugzilla.redhat.com/show_bug.cgi?id=322881 [RHEL5]

Did you determine what PID the script is accessing when you hit the backtrace?

A quick and dirty way to determine this is to copy the script to /tmp and add a
line to the top of the get_open_files() function like this (patch below):

def get_open_files(pid):
    print "pid: %s" % pid # add this line

Then make the script in /tmp executable (chmod +x) and run it. It will spew out
lots of pids, the last one before the backtrace is the one you are interested in.

Regards,
Bryn.

--- /usr/bin/needs-restarting	2011-02-08 10:17:42.000000000 +0000
+++ /tmp/needs-restarting	2011-06-29 09:57:32.125200206 +0100
@@ -73,6 +73,7 @@ def return_running_pids(uid=None):
     return pids

 def get_open_files(pid):
+    print "pid: %s" % pid
     files = []
     smaps = '/proc/%s/smaps' % pid
     try:


More information about the users mailing list