Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1009430

Summary: traceback when running rhn-satellite-exporter/spacewalk-remove-channel as non-root: spacewalk.common.rhnConfig.ConfigParserError: ('config file read error', '/etc/rhn/rhn.conf', 'Permission denied')
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: ClientAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Dimitar Yordanov <dyordano>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 560CC: dyordano
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-13 09:55:28 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:
Bug Depends On:    
Bug Blocks: 1127641    

Description Jan Hutař 2013-09-18 12:33:51 UTC
Description of problem:
There is a traceback when running rhn-satellite-exporter/spacewalk-remove-channel as non-root: spacewalk.common.rhnConfig.ConfigParserError: ('config file read error', '/etc/rhn/rhn.conf', 'Permission denied')


Version-Release number of selected component (if applicable):
spacewalk-backend-tools-2.0.3-17.el5sat


How reproducible:
always


Steps to Reproduce:
1. # rhn-satellite-exporter
2. # spacewalk-remove-channel -h


Actual results:
Traceback (most recent call last):
  File "/usr/bin/rhn-satellite-exporter", line 22, in ?
    from spacewalk.satellite_tools.disk_dumper import iss
  File "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/disk_dumper/iss.py", line 21, in ?
    import dumper
  File "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/disk_dumper/dumper.py", line 25, in ?
    from spacewalk.common.rhnConfig import CFG
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 522, in ?
    ALL_CFG.parse()
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 119, in parse
    timeDiff = self.modifiedYN()
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 98, in modifiedYN
    si = os.stat(self.filename)
spacewalk.common.rhnConfig.ConfigParserError: ('config file read error', '/etc/rhn/rhn.conf', 'Permission denied')

Traceback (most recent call last):
  File "/usr/bin/spacewalk-remove-channel", line 33, in ?
    from spacewalk.common.rhnConfig import CFG, initCFG
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 522, in ?
    ALL_CFG.parse()
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 119, in parse
    timeDiff = self.modifiedYN()
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 98, in modifiedYN
    si = os.stat(self.filename)
spacewalk.common.rhnConfig.ConfigParserError: ('config file read error', '/etc/rhn/rhn.conf', 'Permission denied')


Expected results:
Nice error message should be printed.


Additional info:
Not a Sat560 release blocker for sure IMO.

I just wanted to verify you can not get list of organizations as non-root using `rhn-satellite-exporter --list-orgs` which you can not due to this bug.

Comment 1 Dimitar Yordanov 2014-10-06 12:14:29 UTC
Fixed in SW master: f993820314390ee12293d4b6c4a5b58b3e34cb58

Comment 2 psmatana 2014-12-01 19:52:11 UTC
Verification.

spacewalk-backend-tools-2.3.3-21.el6sat

Steps to Verified:

# useradd test
# su test
$ rhn-satellite-exporter
ERROR: must be root to execute
$ spacewalk-remove-channel -h
ERROR: must be root to execute



Reproduction.

spacewalk-backend-tools-2.0.3-30.el6sat

Steps to Reproduce:

# useradd test
# su test
$ rhn-satellite-exporter

Traceback (most recent call last):
  File "/usr/bin/rhn-satellite-exporter", line 22, in <module>
    from spacewalk.satellite_tools.disk_dumper import iss
  File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/disk_dumper/iss.py", line 21, in <module>
    import dumper
  File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/disk_dumper/dumper.py", line 25, in <module>
    from spacewalk.common.rhnConfig import CFG
  File "/usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py", line 522, in <module>
    ALL_CFG.parse()
  File "/usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py", line 119, in parse
    timeDiff = self.modifiedYN()
  File "/usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py", line 98, in modifiedYN
    si = os.stat(self.filename)
spacewalk.common.rhnConfig.ConfigParserError: ('config file read error', '/etc/rhn/rhn.conf', 'Permission denied')

$ spacewalk-remove-channel -h

Traceback (most recent call last):
  File "/usr/bin/spacewalk-remove-channel", line 33, in <module>
    from spacewalk.common.rhnConfig import CFG, initCFG
  File "/usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py", line 522, in <module>
    ALL_CFG.parse()
  File "/usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py", line 119, in parse
    timeDiff = self.modifiedYN()
  File "/usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py", line 98, in modifiedYN
    si = os.stat(self.filename)
spacewalk.common.rhnConfig.ConfigParserError: ('config file read error', '/etc/rhn/rhn.conf', 'Permission denied')
You have new mail in /var/spool/mail/root

Comment 4 Clifford Perry 2015-01-13 09:55:28 UTC
With the release of Red Hat Satellite 5.7 on January 12th 2015 this bug is
being moved to a Closed Current Release state. 

The Satellite 5.7 GA Errata:
 - https://rhn.redhat.com/errata/RHSA-2015-0033.html 

Satellite 5.7 Release Notes:
 -
https://access.redhat.com/documentation/en-US/Red_Hat_Satellite/5.7/html-single/Release_Notes/index.html

Satellite Customer Portal Blog announcement for release:
 - https://access.redhat.com/blogs/1169563/posts/1315743 

Cliff