Bug 53918 - pidof ignores file path
Summary: pidof ignores file path
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: SysVinit
Version: 7.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-21 15:50 UTC by bastiaan
Modified: 2014-03-17 02:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-28 05:56:44 UTC
Embargoed:


Attachments (Terms of Use)

Description bastiaan 2001-09-21 15:50:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.6 i686; en-US; rv:0.9.1)
Gecko/20010608

Description of problem:
pidof stips the path to the executable for which you want the pid(s),
before performing the process lookup. 

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1./sbin/pidof /doesnotexist/syslogd
2.
3.
	

Actual Results:  pidof returns the pid /sbin/syslogd

Expected Results:  it should not return the pid /sbin/syslogd

Additional info:

This bugs allows any unpriviliged user to fool 'service XXX status'
commands by running a process named XXX. This way sysadmins could tricked
into believing service XXX is running while actually it is not.

Comment 1 Bill Nottingham 2002-07-19 02:09:57 UTC
Fixed in 2.84-5, thanks!

Comment 2 Dmitry V. Levin 2003-03-01 22:05:33 UTC
Btw, readlink(2) does not append a NUL character to the buffer, so behaviour of 
your patch depends on malloc(3). 
 

Comment 3 Bill Nottingham 2005-01-28 05:56:44 UTC
Fixed, will be in SysVinit-2.85-36.


Note You need to log in before you can comment on or make changes to this bug.