Bug 827403 - CLI: gluster peer probe with single character returns usage
CLI: gluster peer probe with single character returns usage
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: cli (Show other bugs)
3.3.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Kaushal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-01 07:24 EDT by Rahul Hinduja
Modified: 2013-07-24 13:19 EDT (History)
2 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-24 13:19:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Rahul Hinduja 2012-06-01 07:24:28 EDT
Description of problem:

gluster peer probe <single character hostname> returns the usage. The host name can also be of a 1 character.

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

[root@QA-54 glusterfs]# gluster --version
glusterfs 3.3.0qa45 built on Jun  1 2012 00:10:06

How reproducible:


Steps to Reproduce:
1. use the cli "gluster peer probe" with single character hostname
  
Actual results:
[root@QA-54 glusterfs]# gluster --version
glusterfs 3.3.0qa45 built on Jun  1 2012 00:10:06


[root@QA-54 glusterfs]# gluster peer probe Q
Usage: peer probe <HOSTNAME>
[root@QA-54 glusterfs]# 

Expected results:


Additional info:
Comment 1 Amar Tumballi 2012-06-02 01:27:34 EDT
Kaushal,

--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1644,7 +1644,7 @@ valid_host_name (char *address, int length)
         char            *temp_str = NULL;
         char            *save_ptr = NULL;
 
-        if ((length > _POSIX_HOST_NAME_MAX) || (length == 1)) {
+        if ((length > _POSIX_HOST_NAME_MAX) || (length < 1)) {
                 ret = 0;
                 goto out;
         }

fixed the issue. Check if that is right fix and submit it.
Comment 2 Vijay Bellur 2012-07-03 15:37:22 EDT
CHANGE: http://review.gluster.com/3516 (libglusterfs: valid_host_name() fix) merged in release-3.3 by Vijay Bellur (vijay@gluster.com)
Comment 3 Sachidananda Urs 2012-07-06 00:28:18 EDT
Fixed in master.

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