Bug 1009430 - 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')
traceback when running rhn-satellite-exporter/spacewalk-remove-channel as non...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client (Show other bugs)
560
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michael Mráka
Dimitar Yordanov
: Patch
Depends On:
Blocks: sat570-lowbug
  Show dependency treegraph
 
Reported: 2013-09-18 08:33 EDT by Jan Hutař
Modified: 2015-01-13 04:55 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-13 04:55:28 EST
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)

  None (edit)
Description Jan Hutař 2013-09-18 08:33:51 EDT
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 08:14:29 EDT
Fixed in SW master: f993820314390ee12293d4b6c4a5b58b3e34cb58
Comment 2 psmatana 2014-12-01 14:52:11 EST
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 04:55:28 EST
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

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