Bug 1013135

Summary: logconv.pl tool removes the access logs contents if "-M" is not correctly used
Product: Red Hat Enterprise Linux 6 Reporter: Rich Megginson <rmeggins>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Sankar Ramalingam <sramling>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: jgalipea, nhosoi, nkinder, srkrishn
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.11.15-34.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:50:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1061410    

Description Rich Megginson 2013-09-27 21:52:03 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/471

https://bugzilla.redhat.com/show_bug.cgi?id=838656 (''Red Hat Enterprise Linux 7'')

{{{
Description of problem:
     Running logconv.pl tool with -m or -M option without specifying the
stats.out file, leads to removal of the access logs file contents. This option
is recently introduced to generate Minute/Second based statitics for the ldap
operations.

Version-Release number of selected component (if applicable):
389-ds-base-1.2.10.2-20

How reproducible: Consistently

Steps to Reproduce:
1. Install 389-ds-base latest packages on rhel6.
2. Run logconv.pl tool with -M option.
First, run "ls -l /var/log/dirsrv/slapd-inst/access" to check the size of the
file.
/usr/bin/logconv.pl -M /var/log/dirsrv/slapd-inst/access > /tmp/logconv.out

It generates output as - Illegal division by zero at /usr/bin/logconv.pl line
517

Also, it removes the contents of access logs. Check the file size now.

Actual results: Improper usages of command leads to removal of file contents.

Expected results: Improper usage should give an error message and it should
print the help.

Additional info: Correct usage of the command.
logcov.pl -M /tmp/min_stats.out /var/log/dirsrv/slapd-inst/access
}}}

USCBP would like this in rhel 6.5

Comment 3 srkrishn@redhat.com 2014-07-18 07:46:55 UTC
this bug has been verified as shown below:
following the instructions by Rich Megginson, we can see that the access log file is not empty


[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# ls -l /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403 
-rw-------. 1 nobody nobody 282013304 Jul 18 01:51 /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# logconv.pl -M /var/log/dirsrv/slapd-inst/access > /tmp/logconv.out
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# cat /tmp/logconv.out 
Usage error for option -m or -M, either the output file or access log is missing!

Cleaning up temp files...
Done.
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]#  ls -l /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403 
-rw-------. 1 nobody nobody 282013304 Jul 18 01:51 /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# 

this was tested on build:1.2.11.15.38-389-ds-base

Comment 4 Sankar Ramalingam 2014-07-23 16:25:16 UTC
Marking the bug as Verified as per previous comment

Comment 5 errata-xmlrpc 2014-10-14 07:50:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1385.html