Bug 1381158

Summary: CLI option "--timeout" is accepting non numeric and negative values.
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Byreddy <bsrirama>
Component: cliAssignee: Atin Mukherjee <amukherj>
Status: CLOSED ERRATA QA Contact: Bala Konda Reddy M <bmekala>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.2CC: amukherj, asrivast, rhinduja, rhs-bugs, storage-qa-internal, vbellur
Target Milestone: ---   
Target Release: RHGS 3.3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.8.4-19 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1420697 (view as bug list) Environment:
Last Closed: 2017-09-21 04:28:23 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: 1420697, 1421017    
Bug Blocks: 1417147    

Description Byreddy 2016-10-03 09:28:25 UTC
Description of problem:
=======================
Gluster CLI option "--timeout" is accepting  non numeric and negative values.

This option is introduced for the issue:  https://bugzilla.redhat.com/show_bug.cgi?id=1340338

Non Numeric value setting
[root@ ~]# gluster --timeout=xvafgs   volume  status replica inode
^Z
[1]+  Stopped                 gluster --timeout=xvafgs volume status replica inode
[root@ ~]# 

Negative value setting:
~]# gluster --timeout=-12  volume  status replica inode

^Z
[2]+  Stopped                 gluster --timeout=-12 volume status replica inode
[root@ ~]# 




Version-Release number of selected component (if applicable):
===========================================================
glusterfs-3.8.4-2


How reproducible:
=================
Always

Steps to Reproduce:
1. Use CLI option "--timeout=" with negative values and non numeric values.
2.
3.

Actual results:
===============
CLI option "--timeout" is accepting negative and non  numeric values 


Expected results:
================
It should accept only positive numeric values

Additional info:

Comment 4 Atin Mukherjee 2017-02-09 10:41:13 UTC
upstream patch : https://review.gluster.org/16578

Comment 6 Atin Mukherjee 2017-03-24 09:41:09 UTC
downstream patch : https://code.engineering.redhat.com/gerrit/#/c/101312/

Comment 8 Bala Konda Reddy M 2017-04-07 10:31:32 UTC
Verified in the build: glusterfs-3.8.4-21

CLI option --timeout is accepting only positive integers throws correct error message when non-numeric and negative integers are given

[root@dhcp37-135 /]# gluster vol status testvol inode --timeout=ab
timeout value should be a postive integer
[root@dhcp37-135 /]# gluster vol status testvol inode --timeout=1ab
timeout value should be a postive integer
[root@dhcp37-135 /]# gluster vol status testvol inode --timeout=10ab
timeout value should be a postive integer
[root@dhcp37-135 /]# gluster vol status testvol inode --timeout=10!
timeout value should be a postive integer
[root@dhcp37-135 /]# gluster vol status testvol inode --timeout=10~
timeout value should be a postive integer
[root@dhcp37-135 /]# gluster vol status testvol inode --timeout=-10
timeout value should be a postive integer

Hence marking the bug verified

Comment 10 errata-xmlrpc 2017-09-21 04:28:23 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.

https://access.redhat.com/errata/RHBA-2017:2774

Comment 11 errata-xmlrpc 2017-09-21 04:54:54 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.

https://access.redhat.com/errata/RHBA-2017:2774