Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1187442 - subscription-manager some "--config" option can use all kinds of characters when it should be a "number"
Summary: subscription-manager some "--config" option can use all kinds of characters w...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel72
TreeView+ depends on / blocked
 
Reported: 2015-01-30 03:32 UTC by xingge
Modified: 2016-09-20 02:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-29 17:03:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description xingge 2015-01-30 03:32:55 UTC
Description of problem:
subscription-manager some "--config" option can use all kinds of characters when it should be a "number"

Version-Release number of selected component (if applicable):
subscription-manager-firstboot-1.13.19-1.el7.x86_64
subscription-manager-1.13.19-1.el7.x86_64
subscription-manager-gui-1.13.19-1.el7.x86_64
python-rhsm-1.13.10-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.run subscription-manager config --server.port=PORT
2.run subscription-manager config --rhsmcertd.autoattachinterval=PORT 

Actual results:
No errors report and when run "subscription-manager --config" I get output below
[server]
   hostname = subscription.rhn.stage.redhat.com
   insecure = [0]
   port = PORT      <==================should ONLY be a number
   prefix = [/subscription]
   proxy_hostname = []
   proxy_password = []
   proxy_port = []
   proxy_user = []
   ssl_verify_depth = [3]

[rhsm]
   baseurl = [https://cdn.redhat.com]
   ca_cert_dir = [/etc/rhsm/ca/]
   consumercertdir = [/etc/pki/consumer]
   entitlementcertdir = [/etc/pki/entitlement]
   full_refresh_on_yum = [0]
   manage_repos = [1]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   productcertdir = [/etc/pki/product]
   repo_ca_cert = [/etc/rhsm/ca/redhat-uep.pem]
   report_package_profile = [1]

[rhsmcertd]
   autoattachinterval = PORT  <===========should ONLY be a number
   certcheckinterval = [240]

[] - Default value in use


Expected results:
when run 
subscription-manager config --server.port=PORT
there should be a error report like
"port must be 0-65535."
when run 
subscription-manager config --rhsmcertd.autoattachinterval=PORT
the error report should be
"Must enter a number"

Additional info:
I find that if you set some option that require "numbers" to a character the subscription-manager will use the default value of the option, that's good but I think we should not let the customer set a wrong option value.

Comment 1 Adrian Likins 2015-04-29 17:03:11 UTC
I devel nack'ed this.

The config values are mostly untyped, with server port being the exception.

I don't think the complexity is worthwhile to solve this generally. We
could probably special case the port values at some point, but unlikely
for 7.2.


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