Bug 501780

Summary: Luci invalidates some "system hostnames" that are valid
Product: Red Hat Enterprise Linux 5 Reporter: Shane Bradley <sbradley>
Component: congaAssignee: Ryan McCabe <rmccabe>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.5CC: bbrock, cluster-maint, cward, jha, jwest, plyons, rmccabe, tao
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: conga-0.12.2-15.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 22:26:26 UTC Type: ---
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:    
Bug Blocks: 580200, 580201, 580202    
Attachments:
Description Flags
Patch to fix bug
none
new patch with additional fix none

Description Shane Bradley 2009-05-20 17:09:05 UTC
Description of problem:                                                                                                                                                            
                                                                                                                                                                                   
Luci will invalidate some "System Hostnames". There are two known cases that I am aware of:                                                                                        
Both of these issues occur in  conga-0.12.2/luci/plone-custom/conga.js                                                                                                             
                                                                                                                                                                                   
1) Using non-fqdns(however hostname is in /etc/hosts on all nodes)                                                                                                                 
 will yield the error, as in with hostname "rh5node1":                                                                                                                             
                                                                                                                                                                                   
"rh5node1" is not a valid hostname: Hostnames must be fully qualified.                                                                                                             
                                                                                                                                                                                   
 if (i.length === 1) {                                                                                                                                                             
               if (iponly) {                                                                                                                                                       
                       return ('You must enter an IP address in quad-dot notation.');                                                                                              
               } else {                                                                                                                                                            
                       return ('Hostnames must be fully qualified.');                                                                                                              
               }                                                                                                                                                                   
       }                                                                                                                                                                           
                                                                                                                                                                                   
2) Using TLD that is incorrect detect as IP "glycine.0efg" will error:                                                                                                             
                                                                                                                                                                                   
  "glycine.0efg" is not a valid hostname: Invalid IP address.                                                                                                                      
                                                                                                                                                                                   
  if (!isNaN(parseInt(i[i.length - 1], 10))) {                                                                                                                                     
              return ('Invalid IP address.');                                                                                                                                      
  }                                                                                                                                                                                
                                                                                                                                                                                   
Now, one solution would be script around these conditions or "System                                                                                                               
Hostname" checking can be completely removed in the javascript.                                                                                                                    
                                                                                                                                                                                   
Version-Release number of selected component (if applicable):                                                                                                                      
conga-0.12.1-7.3.el5_3                                                                                                                                                             
                                                                                                                                                                                   
How reproducible:                                                                                                                                                                  
Everytime                                                                                                                                                                          
                                                                                                                                                                                   
Steps to Reproduce:                                                                                                                                                                
1.Add existing cluster to luci                                                                                                                                                     
2.Enter System hostname as example above                                                                                                                                           
3.Submit                                                                                                                                                                           
                                                                                                                                                                                   
Actual results:                                                                                                                                                                    
Errors are returned as stated above                                                                                                                                                
                                                                                                                                                                                   
Expected results:                                                                                                                                                                  
System Hostname should be accepted and submit should not error out.                                                                                                                
                                                                                                                                                                                   
Additional info:

Comment 3 Chris Ward 2010-02-11 10:16:19 UTC
~~ Attention Customers and Partners - RHEL 5.5 Beta is now available on RHN ~~

RHEL 5.5 Beta has been released! There should be a fix present in this 
release that addresses your request. Please test and report back results 
here, by March 3rd 2010 (2010-03-03) or sooner.

Upon successful verification of this request, post your results and update 
the Verified field in Bugzilla with the appropriate value.

If you encounter any issues while testing, please describe them and set 
this bug into NEED_INFO. If you encounter new defects or have additional 
patch(es) to request for inclusion, please clone this bug per each request
and escalate through your support representative.

Comment 7 Issue Tracker 2010-02-23 14:20:22 UTC
Event posted on 02-23-2010 09:20am EST by akunysz

Repro steps assuming a pristine RHEL 5 system registered to the
server-cluster channel (no need for custom DNS, resolv.conf or cluster
setup):
# yum install luci
# luci_admin init
[set password to "quux" or whatever]
# service luci start

From an host that has a web browser (possibly the same host that is
running luci but another is fine):
go to https://$HOSTNAME:8084/
log in the web interface as "admin" and the password you defined earlier
("quux")
click "Add a System"
enter "foo.bar" in the "System Hostname" field
enter "foobar" in the "Root Password" field
click "Submit"

A message box saying "Do you really want to add the following Storage
Systems: foo.bar" should appear. This is expected.
click "cancel"

Replace "foo.bar" in the "System Hostname" field with "foo.0efg".
Click on "Submit".

A message box saying "The following errors were found: "foo.0efg" is
not a valid hostname: Invalid IP Address." should appear. That's the
bug.


This event sent from IssueTracker by akunysz 
 issue 289144

Comment 8 Issue Tracker 2010-02-23 14:32:55 UTC
Event posted on 02-23-2010 09:32am EST by akunysz

I confirm the bug is still present in luci-0.12.2-10.el5.


This event sent from IssueTracker by akunysz 
 issue 289144

Comment 26 Ryan McCabe 2010-07-02 15:32:52 UTC
Created attachment 429101 [details]
Patch to fix bug

Comment 32 Ryan McCabe 2010-09-01 06:11:44 UTC
Created attachment 442336 [details]
new patch with additional fix

Comment 36 errata-xmlrpc 2011-01-13 22:26:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0033.html