Bug 53918 - pidof ignores file path
pidof ignores file path
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: SysVinit (Show other bugs)
7.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-21 11:50 EDT by bastiaan
Modified: 2014-03-16 22:23 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-28 00:56:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description bastiaan 2001-09-21 11:50:55 EDT
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-18 22:09:57 EDT
Fixed in 2.84-5, thanks!
Comment 2 Dmitry V. Levin 2003-03-01 17:05:33 EST
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 00:56:44 EST
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.