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.
Bug 1859569 - On a registered system if user tries to list role/usage/addons using invalid credentials , no error message is thrown
Summary: On a registered system if user tries to list role/usage/addons using invalid ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.6
Assignee: mhorky
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 2022788
TreeView+ depends on / blocked
 
Reported: 2020-07-22 13:13 UTC by Shwetha Kallesh
Modified: 2022-05-10 16:39 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.28.24-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2022788 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:22:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2721 0 None Merged 1859569: Abort on invalid username/token argument in syspurpose subcommands 2021-09-15 09:27:53 UTC
Github candlepin subscription-manager pull 2737 0 None Merged [1.28] 1859569: Abort on invalid username/token argument in syspurpose 2021-09-15 09:27:54 UTC
Red Hat Product Errata RHBA-2022:2047 0 None None None 2022-05-10 15:23:20 UTC

Description Shwetha Kallesh 2020-07-22 13:13:40 UTC
Description of problem:
On a registered system if user tries to list role/usage/addons using invalid credentials , no error message is thrown

Version-Release number of selected component (if applicable):
[root@kvm-07-guest02 ~]# subscription-manager version
subscription-manager: 1.27.10-1.git.2.ffd7a7e.el8


How reproducible:


Steps to Reproduce:
[root@kvm-07-guest02 ~]# subscription-manager role --list --username sdsfdsf --password fdsfds
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node

[root@kvm-07-guest02 ~]# subscription-manager role --list --org dsadsa
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node


Actual results:
Available roles, usage and addons are listed even with invalid credentials

Expected results:
"Invalid user credentials" message when user provides invalid username/password

and 

"Organization with id dsadsa could not be found."  message when user provides invalid role


Additional info:

Comment 4 Zdenek Petracek 2021-11-04 16:14:52 UTC
Pre-verification version:
[root@kvm-06-guest07 rhsm]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.28.22-1.git.0.5118d85.el8

Registering a system:
[root@kvm-06-guest07 rhsm]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: zpetracePH03
Password: 
The system has been registered with ID: 8e41e2e5-1890-47e4-bb97-1471c61e856c
The registered system name is: kvm-06-guest07.hv2.lab.eng.bos.redhat.com

Pre-verification 1:
[root@kvm-06-guest07 rhsm]# subscription-manager role --list --username jdkfsl --password ikjko
Error: --username, --password, --token and --org can be used only on unregistered systems

Pre-verification 2:
[root@kvm-06-guest07 rhsm]# subscription-manager usage --list --username jdkfsl --password ikjko
Error: --username, --password, --token and --org can be used only on unregistered systems

Pre-verification 3:
[root@kvm-06-guest07 rhsm]# subscription-manager addons --list --username jdkfsl --password ikjko
Error: --username, --password, --token and --org can be used only on unregistered systems

Comment 8 Archana Pandey 2021-11-29 10:14:37 UTC
      Beaker Test information:
                         HOSTNAME=hpe-dl380pgen8-02-vm-9.hpe2.lab.eng.bos.redhat.com
                            JOBID=6040357
                         RECIPEID=11050021
                    RESULT_SERVER=
                           DISTRO=RHEL-8.6.0-20211128.3
                     ARCHITECTURE=x86_64

 [root@hpe-dl380pgen8-02-vm-9 ~]# 
[root@hpe-dl380pgen8-02-vm-9 ~]# 
[root@hpe-dl380pgen8-02-vm-9 ~]# rpm -qa subscription-manager
subscription-manager-1.28.24-1.el8.x86_64
[root@hpe-dl380pgen8-02-vm-9 ~]# 
[root@hpe-dl380pgen8-02-vm-9 ~]# rpm -qa --changelog subscription-manager | grep 1859569
- [1.28] 1859569: Abort on invalid username/token argument in syspurpose

[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager register --username rhel9GA --password ***** --serverurl subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 7a42bcf0-fa68-42f6-ae21-bf7bd5f5b4ee
The registered system name is: hpe-dl380pgen8-02-vm-9.hpe2.lab.eng.bos.redhat.com

[root@hpe-dl380pgen8-02-vm-9 ~]# 
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager role --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems                     << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]# 
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager usage --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems                     << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager service-level --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems                     << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager addons --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems                     << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]#                                                                
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager role --list --org 13343512               
Error: --username, --password, --token and --org can be used only on unregistered systems   << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager service-level --list --org 13343512     
Error: --username, --password, --token and --org can be used only on unregistered systems   << PASS   
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager addons --list --org 13343512        
Error: --username, --password, --token and --org can be used only on unregistered systems   << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]# subscription-manager usage --list --org 13343512          
Error: --username, --password, --token and --org can be used only on unregistered systems   << PASS
[root@hpe-dl380pgen8-02-vm-9 ~]# 
[root@hpe-dl380pgen8-02-vm-9 ~]# man subscription-manager  | grep "role options" -A 20
   role options
       The  role subcommand displays the current configured role preference for products installed on the system. For example, if the role preference is "Red Hat Enter‐
       prise Linux Server", then a subscription with a "Red Hat Enterprise Linux Server" role is selected when auto-attaching subscriptions to the system.

       --show Shows the system's current role preference. If a role is not set, then there is a message saying it is not set.

       --list Lists the available role system purpose values.

       --username=USERNAME
              Gives the username for the account to use to connect to the organization account [Usable with --list on unregistered systems].

       --password=PASSWORD
              Gives the user account password [Usable with --list on unregistered systems].       

       --token=TOKEN
              Token to use when authorizing against the server [Usable with --list on unregistered systems].

       --org=ORG
              Identifies the organization for which the role applies [Usable with --list on unregistered systems].

       --set=ROLE

[root@hpe-dl380pgen8-02-vm-9 ~]# 

Verified : PASSED

Comment 10 errata-xmlrpc 2022-05-10 15:22:56 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 (subscription-manager bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2022:2047


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