RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 838656 - logconv.pl tool removes the access logs contents if "-M" is not correctly used
Summary: logconv.pl tool removes the access logs contents if "-M" is not correctly used
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.0
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: 7.0
Assignee: Rich Megginson
QA Contact: Sankar Ramalingam
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-09 17:38 UTC by Sankar Ramalingam
Modified: 2020-09-13 20:18 UTC (History)
4 users (show)

Fixed In Version: 389-ds-base-1.3.1.6-18.el7
Doc Type: Bug Fix
Doc Text:
Cause: Using options -M or -m require a output file arguement. If the output file is not specified, then the script thinks the access log arguement is the output file. Consequence: The access log is overwritten with the output of the -M/-m feature Fix: Properly check all the agruments passed to the script. Result: If a output file is not specified then an error is reported, and the access log is not overwritten.
Clone Of:
Environment:
Last Closed: 2014-06-13 12:29:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 471 0 None None None 2020-09-13 20:18:06 UTC

Description Sankar Ramalingam 2012-07-09 17:38:44 UTC
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

Comment 2 Nathan Kinder 2012-09-20 19:39:22 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/471

Comment 6 Rich Megginson 2013-10-01 23:26:20 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata).  When the errata is created, the bugs should be automatically moved back to ON_QA.

Comment 8 Sankar Ramalingam 2014-01-30 06:28:56 UTC
[root@hp-dl380pgen8-02-vm-1 ~]# ls -l /var/log/dirsrv/slapd-hp-dl380pgen8-02-vm-1/access
-rw-------. 1 svrbld svrbld 60614 Jan 28 07:26 /var/log/dirsrv/slapd-hp-dl380pgen8-02-vm-1/access

[root@hp-dl380pgen8-02-vm-1 ~]# logconv.pl -M /var/log/dirsrv/slapd-hp-dl380pgen8-02-vm-1/access
Access Log Analyzer 8.0

Command: logconv.pl /tmp/testlog

Processing 1 Access Log(s)...

Use of uninitialized value $cursize in sprintf at /usr/bin/logconv.pl line 418.
[00] /tmp/testlog                  	size (bytes):             
Can not open /tmp/testlog error (No such file or directory) at /usr/bin/logconv.pl line 2400.
Cleaning up temp files . . .
Done

[root@hp-dl380pgen8-02-vm-1 ~]# ls -l /var/log/dirsrv/slapd-hp-dl380pgen8-02-vm-1/access
-rw-------. 1 svrbld svrbld 0 Jan 30 01:05 /var/log/dirsrv/slapd-hp-dl380pgen8-02-vm-1/access


Incorrect usage of logconv.pl tool still cleans up the access log files.

Comment 9 Rich Megginson 2014-01-30 15:51:39 UTC
I reopened the upstream ticket - see the ticket for comments.

Comment 10 Rich Megginson 2014-02-01 00:34:42 UTC
To ssh://git.app.eng.bos.redhat.com/srv/git/389-ds-base.git
   9b1e2d0..7dc5c28  rhel-7.0 -> rhel-7.0
commit 7dc5c28a3beeeb90cdae084ae6d1fa338c09c50f
Author: Rich Megginson <rmeggins>
Date:   Fri Jan 31 16:49:58 2014 -0700

Comment 11 Sankar Ramalingam 2014-02-04 20:51:42 UTC
Test1:
[root@hp-dl380pgen8-02-vm-1 ~]# ls -l /var/log/dirsrv/slapd-sriram3/access ; logconv.pl  -M /tmp/test123  
-rw-------. 1 svrbld svrbld 742 Feb  4 15:42 /var/log/dirsrv/slapd-sriram3/access
Usage error for option -m or -M, either the output file or access log is missing!

Cleaning up temp files . . .
Done
[root@hp-dl380pgen8-02-vm-1 ~]# ls -l /var/log/dirsrv/slapd-sriram3/access 
-rw-------. 1 svrbld svrbld 742 Feb  4 15:42 /var/log/dirsrv/slapd-sriram3/access

Test2:
[root@hp-dl380pgen8-02-vm-1 ~]# ls -l /var/log/dirsrv/slapd-sriram3/access ; logconv.pl  -M /var/log/dirsrv/slapd-sriram3/access
-rw-------. 1 svrbld svrbld 742 Feb  4 15:42 /var/log/dirsrv/slapd-sriram3/access
Usage error for option -m or -M, either the output file or access log is missing!

Cleaning up temp files . . .
Done
[root@hp-dl380pgen8-02-vm-1 ~]# ls -l /var/log/dirsrv/slapd-sriram3/access 
-rw-------. 1 svrbld svrbld 742 Feb  4 15:42 /var/log/dirsrv/slapd-sriram3/access


Test1 and Test2 are giving usage error for option -M. Also, -M option doesn't cleanup the access log file contents. Hence, marking the bug as verified.

Build tested - 389-ds-base-1.3.1.6-18

Comment 12 Sankar Ramalingam 2014-02-13 11:51:58 UTC
Test cases automated in ./logfile/logconv.sh

Comment 13 Ludek Smid 2014-06-13 12:29:41 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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