Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1134339[details]
Patch for rhsm/certificate2.py
Description of problem:
Stacktrace occurs when using rct against an inaccessible file
Version-Release number of selected component (if applicable):
subscription-manager-1.15.9-15.el7.x86_64
How reproducible:
As a normal user, execute:
rct cat-cert /etc/pki/consumer/
Actual results:
[student@desktop pki]$ rct cat-cert consumer/cert.pem
Traceback (most recent call last):
File "/usr/bin/rct", line 49, in <module>
sys.exit(abs(main() or 0))
File "/usr/bin/rct", line 44, in main
return RctCLI().main()
File "/usr/share/rhsm/subscription_manager/cli.py", line 159, in main
return cmd.main()
File "/usr/share/rhsm/rct/commands.py", line 39, in main
return_code = self._do_command()
File "/usr/share/rhsm/rct/cert_commands.py", line 74, in _do_command
cert = self._create_cert()
File "/usr/share/rhsm/rct/cert_commands.py", line 43, in _create_cert
return certificate.create_from_file(cert_file)
File "/usr/lib64/python2.7/site-packages/rhsm/certificate.py", line 59, in create_from_file
return _CertFactory().create_from_file(path)
File "/usr/lib64/python2.7/site-packages/rhsm/certificate2.py", line 65, in create_from_file
pem = open(path, 'r').read()
IOError: [Errno 13] Permission denied: 'consumer/cert.pem'
Expected results:
[student@desktop ~]$ rct cat-cert /etc/pki/consumer/cert.pem
Permission denied
[student@desktop ~]$ sudo rct cat-cert /etc/pki/consumer/cert.pem
+-------------------------------------------+
Identity Certificate
+-------------------------------------------+
Certificate:
Path: /etc/pki/consumer/cert.pem
Version: 1.0
Serial: 6678847080198154076
Start Date: 2016-02-28 23:52:59+00:00
End Date: 2017-02-28 23:52:59+00:00
Alt Name: URI:CN=desktop.lab.internal
Subject:
CN: 10bc093b-fe9a-4633-ad35-c679a7853724
Issuer:
C: US
CN: Red Hat Candlepin Authority
O: Red Hat, Inc.
OU: Red Hat Network
ST: North Carolina
emailAddress: ca-support
Additional info:
I've attached a patch for rhsm/certificate2.py which generates the expected results, testing required
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/RHSA-2016-2592.html
Created attachment 1134339 [details] Patch for rhsm/certificate2.py Description of problem: Stacktrace occurs when using rct against an inaccessible file Version-Release number of selected component (if applicable): subscription-manager-1.15.9-15.el7.x86_64 How reproducible: As a normal user, execute: rct cat-cert /etc/pki/consumer/ Actual results: [student@desktop pki]$ rct cat-cert consumer/cert.pem Traceback (most recent call last): File "/usr/bin/rct", line 49, in <module> sys.exit(abs(main() or 0)) File "/usr/bin/rct", line 44, in main return RctCLI().main() File "/usr/share/rhsm/subscription_manager/cli.py", line 159, in main return cmd.main() File "/usr/share/rhsm/rct/commands.py", line 39, in main return_code = self._do_command() File "/usr/share/rhsm/rct/cert_commands.py", line 74, in _do_command cert = self._create_cert() File "/usr/share/rhsm/rct/cert_commands.py", line 43, in _create_cert return certificate.create_from_file(cert_file) File "/usr/lib64/python2.7/site-packages/rhsm/certificate.py", line 59, in create_from_file return _CertFactory().create_from_file(path) File "/usr/lib64/python2.7/site-packages/rhsm/certificate2.py", line 65, in create_from_file pem = open(path, 'r').read() IOError: [Errno 13] Permission denied: 'consumer/cert.pem' Expected results: [student@desktop ~]$ rct cat-cert /etc/pki/consumer/cert.pem Permission denied [student@desktop ~]$ sudo rct cat-cert /etc/pki/consumer/cert.pem +-------------------------------------------+ Identity Certificate +-------------------------------------------+ Certificate: Path: /etc/pki/consumer/cert.pem Version: 1.0 Serial: 6678847080198154076 Start Date: 2016-02-28 23:52:59+00:00 End Date: 2017-02-28 23:52:59+00:00 Alt Name: URI:CN=desktop.lab.internal Subject: CN: 10bc093b-fe9a-4633-ad35-c679a7853724 Issuer: C: US CN: Red Hat Candlepin Authority O: Red Hat, Inc. OU: Red Hat Network ST: North Carolina emailAddress: ca-support Additional info: I've attached a patch for rhsm/certificate2.py which generates the expected results, testing required