Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 916369

Summary: insecure in rhsm.comf should not be updated when using --insecure option if command fails
Product: Red Hat Enterprise Linux 5 Reporter: Sharath Dwaral <fsharath>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.10CC: bkearney, jesusr, jgalipea, jsefler
Target Milestone: beta   
Target Release: 5.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The parameter parsing code was always updating the configuration whenever the --insecure option was present. Consequence: The --insecure option would always overwrite the configuration value. Fix: Delayed the insecure value persistence until after the command completes. Result: A more consistent experience for the user.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 22:58:02 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: 840995, 920191    

Description Sharath Dwaral 2013-02-27 22:47:45 UTC
Description of problem:

When using --insecure option the insecure should not be set in rhsm.conf file when the transaction does not complete successfully.

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

# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-gui-1.8.3-1.el7.x86_64
subscription-manager-debuginfo-1.8.3-1.el7.x86_64
subscription-manager-1.8.3-1.el7.x86_64
subscription-manager-firstboot-1.8.3-1.el7.x86_64
python-rhsm-debuginfo-1.8.3-1.el7.x86_64
python-rhsm-1.8.3-1.el7.x86_64
subscription-manager-migration-1.8.3-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:

# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

# cat /etc/rhsm/rhsm.conf | grep insecure
insecure = 0

# subscription-manager register --serverurl fsharath-candlepin.usersys.redhat.com:8443/candlepin --insecure
Username: ^C
User interrupted process.

# cat /etc/rhsm/rhsm.conf | grep insecure
insecure=1

Actual results:

As shown above

Expected results:

insecure should be set only when the transaction completes succefully.

Additional info:

Comment 1 Sharath Dwaral 2013-02-28 00:06:22 UTC
Related to Bug 844411

Comment 3 Bryan Kearney 2013-03-05 16:14:31 UTC
commit b539676648028688d3018f0a04c2f7ea0e4372b8
Author: Bryan Kearney <bkearney>
Date:   Mon Mar 4 16:41:15 2013 -0500

    916369: Do not persist config changes until the action completes

Comment 4 Sharath Dwaral 2013-03-12 15:28:08 UTC
# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-firstboot-1.8.4-1.el7.x86_64
python-rhsm-1.8.7-1.el7.x86_64
subscription-manager-gui-1.8.4-1.el7.x86_64
subscription-manager-migration-1.8.4-1.el7.x86_64
subscription-manager-1.8.4-1.el7.x86_64
subscription-manager-debuginfo-1.8.4-1.el7.x86_64

# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

# cat /etc/rhsm/rhsm.conf | grep insecure
insecure=0

# subscription-manager register --serverurl fsharath-candlepin.usersys.redhat.com:8443/candlepin --insecure
Username: ^C
User interrupted process.

# cat /etc/rhsm/rhsm.conf | grep insecure
insecure=0

# subscription-manager register --serverurl fsharath-candlepin.usersys.redhat.com:8443/candlepin --insecure
Username: testuser1 
Password: 
User interrupted process.

# cat /etc/rhsm/rhsm.conf | grep insecure
insecure=0

# subscription-manager register --serverurl fsharath-candlepin.usersys.redhat.com:8443/candlepin --insecure
Username: testuser1
Password: 
Organization: ^C
User interrupted process.

# cat /etc/rhsm/rhsm.conf | grep insecure
#insecure = 0
insecure=0

# subscription-manager register --serverurl fsharath-candlepin.usersys.redhat.com:8443/candlepin --insecure
Username: testuser1
Password: 
Organization: snowwhite
The system has been registered with id: a763a15f-6655-4454-9503-806a0aa8f8ed

Verified

Comment 5 RHEL Program Management 2013-04-09 20:49:57 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 7 errata-xmlrpc 2013-09-30 22:58:02 UTC
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.

http://rhn.redhat.com/errata/RHBA-2013-1332.html