Bug 1021422 - Insufficient validation of PID file contents
Insufficient validation of PID file contents
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: perl-File-Pid (Show other bugs)
el6
All All
unspecified Severity low
: ---
: ---
Assigned To: Iain Arnell
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-21 05:30 EDT by Dag-Erling Smørgrav
Modified: 2013-10-21 05:30 EDT (History)
2 users (show)

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


Attachments (Terms of Use)
Patch for Pid.pm and spec file (1.86 KB, patch)
2013-10-21 05:30 EDT, Dag-Erling Smørgrav
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
CPAN 89647 None None None Never

  None (edit)
Description Dag-Erling Smørgrav 2013-10-21 05:30:08 EDT
Created attachment 814502 [details]
Patch for Pid.pm and spec file

Description of problem:

File::Pid::running() passes undef as the PID argument to kill().

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

1.01-2.el6.src.rpm

How reproducible:

100%

Steps to Reproduce:

First test case:

  touch /tmp/frobozz.pid
  perl -w -MFile::Pid -e"File::Pid->new({ file => '/tmp/frobozz.pid' })->running();"

Second test case:

  echo >/tmp/frobozz.pid
  perl -w -MFile::Pid -e"File::Pid->new({ file => '/tmp/frobozz.pid' })->running();"

Third test case:

  echo >/tmp/frobozz.pid
  perl -Tw -MFile::Pid -e"File::Pid->new({ file => '/tmp/frobozz.pid' })->running();"

Actual results:

First test case:

  Use of uninitialized value $pid in chomp at /usr/share/perl5/File/Pid.pm line 175.
  Use of uninitialized value $pid in chomp at /usr/share/perl5/File/Pid.pm line 175.
  Use of uninitialized value $pid in kill at /usr/share/perl5/File/Pid.pm line 124.
  not running

Second test case:

  Argument "" isn't numeric in kill at /usr/share/perl5/File/Pid.pm line 124.
  not running

Third test case:

  Insecure dependency in kill while running with -T switch at /usr/share/perl5/File/Pid.pm line 124.

Expected results:

In all three cases, merely

  not running

Additional info:

Patch attached.  Regression tests are left as an exercise for the reader.

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