Bug 630905

Summary: Problem with counting procs
Product: Red Hat Enterprise Linux 5 Reporter: Johan Huysmans <johan.huysmans>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: ksrot, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 846436 (view as bug list) Environment:
Last Closed: 2011-07-21 09:08:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch none

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