Bug 838656
| Summary: | logconv.pl tool removes the access logs contents if "-M" is not correctly used | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Sankar Ramalingam <sramling> |
| Component: | 389-ds-base | Assignee: | Rich Megginson <rmeggins> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Sankar Ramalingam <sramling> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | CC: | jgalipea, mreynolds, nhosoi, nkinder |
| Target Milestone: | rc | ||
| Target Release: | 7.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| 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.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-06-13 12:29:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Upstream ticket: https://fedorahosted.org/389/ticket/471 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. [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. I reopened the upstream ticket - see the ticket for comments. 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 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 Test cases automated in ./logfile/logconv.sh 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. |
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