Bug 788972 - Script /etc/cron.daily/rhn-ssl-cert-check FAILs if more than one traceback mails are set
Summary: Script /etc/cron.daily/rhn-ssl-cert-check FAILs if more than one traceback m...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 541
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Jan Pazdziora
QA Contact: Martin Korbel
URL:
Whiteboard:
Depends On:
Blocks: sat550-blockers
TreeView+ depends on / blocked
 
Reported: 2012-02-09 12:55 UTC by Dimitar Yordanov
Modified: 2018-11-29 20:26 UTC (History)
5 users (show)

Fixed In Version: spacewalk-ssl-cert-check-2.1-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-21 09:17:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dimitar Yordanov 2012-02-09 12:55:15 UTC
Description of problem:
Script  /etc/cron.daily/rhn-ssl-cert-check  FAILs if more than one traceback mails are set in /etc/rhn/rhn.conf

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. In /etc/rhn/rhn.conf set more than one traceback e-mails.
     traceback_mail = root@localhost, abc
2. Execute:
     /etc/cron.daily/rhn-ssl-cert-check
  

Actual results:
sed: -e expression #2, char 81: extra characters after command

Expected results:
No output, no errors.

Additional info:

Comment 1 Dimitar Yordanov 2012-02-09 13:06:30 UTC
The problem is that the code used for processing the output form 
     $(spacewalk-cfg-get traceback_mail)
is the same as in Sat[5.3|5.2] but there two main differences:
  1. then the approach for obtaining traceback_mail list was different back then.
  2. In 5.3 and 5.2  /bin/mail was used for sending the mail. In 5.4 is used sendmail.

Proposed Fix:

file: /etc/cron.daily/rhn-ssl-cert-check

if [ -z "$ADMIN" ]; then
    #ADMIN=$(spacewalk-cfg-get traceback_mail)
     ADMIN=$( spacewalk-cfg-get traceback_mail | tr '\n' ',')
    # Remove the last comma
     ADMIN=${ADMIN/%,/}
    # Replace commas with spaces
    #ADMIN=${ADMIN//,/ }
    # Trim leading spaces
    shopt -s extglob
    ADMIN=${ADMIN/#+( )/}
fi


How the fix was tested:
Sat 5.4.1 RHEL6 and RHEL5

In file: /etc/cron.daily/rhn-ssl-cert-check
Set : EXPIRATION=${EXPIRATION:-10000}

In file /etc/rhn/rhn.conf
Set :traceback_mail = root@localhost, dyordano

Execute:
  /etc/cron.daily/rhn-ssl-cert-check

Result:
 Two mails received.

Comment 2 Jan Pazdziora 2012-02-15 09:07:14 UTC
Would the following patch help?

--- rhn-ssl-cert-check 2010-06-04 14:19:03.000000000 +0200
+++ rhn-ssl-cert-check.new 2012-02-15 09:55:24.000000000 +0100
@@ -33,11 +33,6 @@

 if [ -z "$ADMIN" ]; then
     ADMIN=$(spacewalk-cfg-get traceback_mail)
-    # Replace commas with spaces
-    ADMIN=${ADMIN//,/ }
-    # Trim leading spaces
-    shopt -s extglob
-    ADMIN=${ADMIN/#+( )/}
 fi

 if [ -z "$ADMIN" ]; then

Comment 5 Jan Pazdziora 2012-06-07 13:59:50 UTC
Fixed in Spacewalk master, 302f3073eec15286963a3b862519a84cb460af4a.

Comment 12 Clifford Perry 2012-09-21 09:17:51 UTC
This issue is resolved with the release of RHN Satellite 5.5. 

As of September 20th 2012, RHN Satellite 5.5 has been generally available. 

Release Notes and other 5.5 documentation can be found here:

 https://access.redhat.com/knowledge/docs/Red_Hat_Network_Satellite/

The associated Errata for the 5.5 release are:

5.5 Satellite GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1296.html

5.5 Upgrade Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1298.html

5.5 RHN Proxy GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1297.html

5.5 RHN Tools GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1299.html

Regards,
Clifford
- Engineering Manager, Satellite


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