Bug 592613

Summary: clufindhostname -i returns random value
Product: Red Hat Enterprise Linux 5 Reporter: Dyna <dyn_ares>
Component: rgmanagerAssignee: Lon Hohberger <lhh>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: cluster-maint, djansa, edamato
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rgmanager-2.0.52-16.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 661881 (view as bug list) Environment:
Last Closed: 2011-07-21 10:46:58 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: 661881    

Description Dyna 2010-05-15 18:15:48 UTC
Description of problem:
clufindhostname -i myhost.example.com returns random value.

Version-Release number of selected component (if applicable):
Tested with 2.0.56-6 (latest) 

How reproducible:
Every time.. 


Steps to Reproduce:
1. clufindhostname -i myhost.example.com 
2. most likely it will return a funny value and make nfsclient check in the cluster go south.

Problem is that:
inet_pton:
0 is returned if src does not contain  a  character  string  representing  a  valid  network address. A positive value is returned if the network address was successfully converted.

From  clufindhostname source code:

if (inet_pton(family, optarg, ptr) < 0) {
        perror("inet_pton");
        exit(2);
}

The check should be:

if (inet_pton(family, optarg, ptr) <= 0) {
        perror("inet_pton");
        exit(2);
}

Cheers D

Comment 2 RHEL Program Management 2011-01-11 19:49:56 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2011-01-11 23:27:06 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 4 Lon Hohberger 2011-04-08 14:39:44 UTC
I have been unable to reproduce the problem where it produces an incorrect value, however, positive testing works:

[root@rhel5-1 ~]# clufindhostname -i 1.1.1.1
[root@rhel5-1 ~]# echo $?
2
[root@rhel5-1 ~]# clufindhostname -i 192.168.122.22
client
[root@rhel5-1 ~]# echo $?
0
[root@rhel5-1 ~]# clufindhostname -i client
[root@rhel5-1 ~]# echo $?
2
[root@rhel5-1 ~]# clufindhostname -i ARGLEBARGLE
[root@rhel5-1 ~]# echo $?
2

Comment 7 errata-xmlrpc 2011-07-21 10:46:58 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/RHSA-2011-1000.html