Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1236613 - reporter-mailx fails for blank spaces in /etc/libreport/plugins/mailx.conf
reporter-mailx fails for blank spaces in /etc/libreport/plugins/mailx.conf
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libreport (Show other bugs)
7.1
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: abrt
Martin Kyral
:
Depends On:
Blocks: 1289025 1305230 1323625
  Show dependency treegraph
 
Reported: 2015-06-29 10:33 EDT by Deepu K S
Modified: 2016-11-03 23:05 EDT (History)
7 users (show)

See Also:
Fixed In Version: libreport-2.1.11-34.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1323625 (view as bug list)
Environment:
Last Closed: 2016-11-03 23:05:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch 1/1: augeas: trim spaces before key value (1.77 KB, patch)
2016-04-19 07:20 EDT, Matej Habrnal
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2307 normal SHIPPED_LIVE abrt, gnome-abrt, and libreport bug fix and enhancement update 2016-11-03 09:40:24 EDT

  None (edit)
Description Deepu K S 2015-06-29 10:33:27 EDT
Description of problem:
reporter-mailx fails if there are blank spaces before parameters in /etc/libreport/plugins/mailx.conf

Version-Release number of selected component (if applicable):
libreport-plugin-mailx-2.1.11-23.el7_1.x86_64
abrt-2.1.11-22.el7_1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Enter the Email Subject, Sender and Recipient details in `/etc/libreport/plugins/mailx.conf`
=====================
  5 #
  6 # String parameters:
  7  Subject="[abrt] a crash has been detected"
  8  EmailFrom="root@localhost"
  9  EmailTo="test@localhost"
 10 #
 11 # Boolean parameter:
 12 # SendBinaryData=yes/no
=====================

2. Kill a process by sending SIGSEGV signal.
# /bin/sleep 60 &
[1] 12372
[root@dhcp210-48 rpms]# kill -11 12372
[1]+  Segmentation fault      (core dumped) /bin/sleep 60

3. Email isn't send to test@localhost, instead defaults to "root@localhost".

Actual results:
/var/log/messages :
Jun 29 19:42:37 dhcp210-48 gnome-session: abrt-applet: repeated problem in coreutils-8.22-11.el7, not showing the notification
Jun 29 19:42:37 dhcp210-48 abrt-server: Email address of sender was not specified. Would you like to do so now? If not, 'user@localhost' is to be used [y/N] 
Jun 29 19:42:37 dhcp210-48 abrt-server: Email address of receiver was not specified. Would you like to do so now? If not, 'root@localhost' is to be used [y/N] 
Jun 29 19:42:37 dhcp210-48 abrt-server: Sending an email...
Jun 29 19:42:37 dhcp210-48 abrt-server: Email was sent to: root@localhost  <--====

Expected results:
Jun 29 19:43:54 dhcp210-48 abrt-server: Sending an email...
Jun 29 19:43:54 dhcp210-48 abrt-server: Email was sent to: "test@locahost"

Additional info:

Workaround is to remove the blank spaces.
====================
#
#String parameters:
Subject="[abrt] a crash has been detected"
EmailFrom="root@localhost"
EmailTo="test@locahost"
#
# Boolean parameter:
# SendBinaryData=yes/no
=====================

/var/log/messages :
Jun 29 19:43:54 dhcp210-48 abrt-server: DUP_OF_DIR: /var/tmp/abrt/ccpp-2015-06-24-17:47:44-20013
Jun 29 19:43:54 dhcp210-48 abrt-server: Deleting problem directory ccpp-2015-06-29-19:43:47-10397 (dup of ccpp-2015-06-24-17:47:44-20013)
Jun 29 19:43:54 dhcp210-48 gnome-session: abrt-applet: repeated problem in coreutils-8.22-11.el7, not showing the notification
Jun 29 19:43:54 dhcp210-48 abrt-server: Sending an email...
Jun 29 19:43:54 dhcp210-48 abrt-server: Email was sent to: "test@locahost"
Comment 1 Richard W.M. Jones 2016-03-31 12:20:37 EDT
Try editing the libreport.aug lens, changing:

    let option = [ key ident . value_sep . value_to_eol . eol ]

to:

    let option = [ del /[ \t]*/ . key ident . value_sep . value_to_eol . eol ]
Comment 2 Jakub Filak 2016-04-01 02:25:57 EDT
(In reply to Richard W.M. Jones from comment #1)
Thank you for the tip. We are going to do this:

-    let value_sep    = del / = ?/ " = "
+    let value_sep    = del / ?= ?/ " = "
Comment 3 Jakub Filak 2016-04-01 03:51:07 EDT
(In reply to Jakub Filak from comment #2)
> (In reply to Richard W.M. Jones from comment #1)
> Thank you for the tip. We are going to do this:
> 
> -    let value_sep    = del / = ?/ " = "
> +    let value_sep    = del / ?= ?/ " = "

Oops, I didn't realize that this issue is about trailing white spaces.
Comment 4 Matej Habrnal 2016-04-19 07:20:45 EDT
Created attachment 1148507 [details]
Patch 1/1: augeas: trim spaces before key value
Comment 5 Matej Habrnal 2016-04-19 07:22:03 EDT
Patch contains testcase.
Comment 7 Matej Habrnal 2016-04-22 07:26:04 EDT
How to test:

1. Install libreport version libreport-2.1.11-34.el7
2. Run augparse withtest_libreport.aug
  * in libreport repository
    $ augparse augeas/test_libreport.aug
  * with downloaded test_libreport.aug file https://github.com/abrt/libreport/blob/rhel7/augeas/test_libreport.aug
Comment 8 Matej Habrnal 2016-04-22 10:22:44 EDT
Another way how to test the bugzilla:

1. set the configuration file the same way how it is described in the Bugzilla's description (Step to reproduce)
2. run following command:
$ augtool print /files/etc/libreport/plugins/mailx.conf/Subject
$ augtool print /files/etc/libreport/plugins/mailx.conf/EmailFrom
$ augtool print /files/etc/libreport/plugins/mailx.conf/EmailTo
Comment 11 errata-xmlrpc 2016-11-03 23:05:51 EDT
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.

https://rhn.redhat.com/errata/RHBA-2016-2307.html

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