Bug 763981 (GLUSTER-2249)

Summary: Problems with hostname validation
Product: [Community] GlusterFS Reporter: Jeff Darcy <jdarcy>
Component: unclassifiedAssignee: tcp
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs, kbudiger, vijay
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jeff Darcy 2010-12-23 17:06:29 UTC
A user on IRC was unable to start a filesystem because of the following:

E [xlator.c:602:_volume_option_value_validate] gfs-client-11: internet address 'WKS_2UA0441DXR' does not conform to standards.
E [graph.c:309:glusterfs_graph_validate_options] gfs-client-11: validating translator failed

As I dug into this, I found four different problems with how hostnames are validated.

(1) It's all very nice to be RFC-compliant (valid_host_name refers to "RFC 1123 & 952") but throwing an error and failing translator validation for something that would probably work otherwise seems a bit restrictive.

(2) If we are going to throw an error for a bad hostname, it should probably be done when we try to create the volume (which must not have checked).

(3) Any failure at either time should be reported to the user, not just buried in a log.

(4) The functions involved - at least valid_host_name and valid_internet_address, probably others - seem to be duplicated between libglusterfs/src/xlator.c and rpc/rpc-lib/src/rpc-transport.c, which could be a maintenance problem if bugs are ever fixed in one copy but not the other.

Comment 1 Anand Avati 2011-01-27 17:18:09 UTC
PATCH: http://patches.gluster.com/patch/6050 in master (Move hostname, ip address validating functions to libglusterfs.)

Comment 2 Vijay Bellur 2011-03-29 08:14:38 UTC
PATCH: http://patches.gluster.com/patch/6610 in master (Loosen restrictions on hostnames)