bugSystem V style init programs - Bugs: bug #47196, pidof: matches wrong process when...

 
 

bug #47196: pidof: matches wrong process when full path is given if process is invoked without path elements

Submitted by:  Steve Beattie <sbeattie>
Submitted on:  Thu 18 Feb 2016 10:38:14 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 18 Feb 2016 10:38:14 PM UTC, original submission:

(This is a forwarded bug report from launchpad https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1546126 )

pidof will display the wrong process pid in the following situation:

sleep 5 & pidof /wrongdir/sleep

even though the invoked sleep command is found on path as /bin/sleep. On linux kernels, /proc/PID/exe will point correctly to /bin/sleep (killall5.c:pidof() already attempts to look at this proc entry at least for binaries on nfs paths).

/wrongdir/sleep could be another executable, but the above happens even if the file or even the /wrongdir does not exist.

However, if sleep was called with full path
$(command -v sleep) 5 & pidof /wrongdir/sleep
pidof does not display anything, which is expected.

Steve Beattie <sbeattie>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sbeattie (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1