Bug 630905 - Problem with counting procs
Summary: Problem with counting procs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: net-snmp
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jan Safranek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-07 10:21 UTC by Johan Huysmans
Modified: 2012-08-07 19:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 846436 (view as bug list)
Environment:
Last Closed: 2011-07-21 09:08:22 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1076 0 normal SHIPPED_LIVE net-snmp bug fix and enhancement update 2011-07-21 09:07:58 UTC

Description Johan Huysmans 2010-09-07 10:21:14 UTC
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 09:12:34 UTC
I've fixed it upstream, SVN rev. 19893.

Comment 5 errata-xmlrpc 2011-07-21 09:08:22 UTC
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 12:22:32 UTC
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.