| Summary: | CR-LF-terminated lines break output formatting | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Martin Frodl <mfrodl> |
| Component: | logwatch | Assignee: | Jan Synacek <jsynacek> |
| Status: | CLOSED WONTFIX | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | jsynacek, mfrodl, ppisar, qe-baseos-apps |
| Target Milestone: | rc | Keywords: | Patch |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1295467 | Environment: | |
| Last Closed: | 2016-04-28 11:14:32 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: | |
|
Description
Martin Frodl
2016-01-05 11:40:03 UTC
I don't know how perl handles this internally. Moving to perl team to get some input. Use need-info instead of assigning-to. Perl uses platform's specific end-of-lines processing. On Linux, it is LF, thus LF is the line separator. This can be redefined, for each file handle or line processing function separately. Show me exact Perl code with input and undesired output that you think does not match your expectation. But in general, I believe processing files as is used on given platform by any other tools is fine. Ok, I definitely don't want to fix this in general in every script "just in case". Then patch for this is quite trivial:
--- /usr/share/logwatch/scripts/services/sendmail 2013-12-28 17:01:49.000000000 +0100
+++ /usr/share/logwatch/scripts/services/sendmail.new 2016-04-26 14:51:15.825294510 +0200
@@ -381,6 +381,7 @@
}
# $ThisLine might have been reset (undef, or empty string) in $MatchFilter
next unless $ThisLine;
+ $ThisLine =~ s/\r$//;
if (
# informational statements of little value
I wonder, how did the sendmail log end up with CRLF newlines?
|