Bug 630905 - Problem with counting procs
Problem with counting procs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: net-snmp (Show other bugs)
5.4
All Linux
low Severity medium
: rc
: ---
Assigned To: Jan Safranek
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-07 06:21 EDT by Johan Huysmans
Modified: 2012-08-07 15:47 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 846436 (view as bug list)
Environment:
Last Closed: 2011-07-21 05:08:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch (483 bytes, patch)
2010-09-07 06:21 EDT, Johan Huysmans
no flags Details | Diff

  None (edit)
Description Johan Huysmans 2010-09-07 06:21:14 EDT
Created attachment 443476 [details]
Patch

net-snmpd-5.3.2.2-9

We are monitoring the processes running on a CentOS host through snmpd.
Every 3secs it will verify the value of the prErrorFlag.

On some moments the prErrorFlag tells us that the process is not running, although it is running without any problems.
The next check the prErrorFlag gives the actual situation again.


The problem is located in the sh_count_procs function in agent/mibgroup/ucd-snmp/proc.c
The patch is attached.

Problem description:
if ((status = fopen(cmdline, "r")) == NULL) {
==> The file will be opened, if it cannot be opened, we go to the next file with continue.

if (fgets(cmdline, sizeof(cmdline), status) == NULL) {
==> The file is read, if it cannot be read, we should not abort (break) but go to the next file (continue)

The situation that a file can be opened but not read can be that a process is running in the first if, but is stopped in the 2nd if. This should not result in the situation where it aborts the checking of the processes.
Comment 1 Jan Safranek 2011-01-26 04:12:34 EST
I've fixed it upstream, SVN rev. 19893.
Comment 5 errata-xmlrpc 2011-07-21 05:08:22 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1076.html
Comment 6 errata-xmlrpc 2011-07-21 08:22:32 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1076.html

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