Bug 443945 - bad hostname processing in rc.sysinit
Summary: bad hostname processing in rc.sysinit
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 10
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-04-24 09:13 UTC by JW
Modified: 2014-03-17 03:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-23 17:25:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description JW 2008-04-24 09:13:58 UTC
Description of problem:
In rc.sysinit there is a line which attempt to discover an ip address and
thereby a suitable hostname, but unfortunately the awk expression can return
multiple ip addresses which results in subsequent ipcalc failure.

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

How reproducible:
Always

Steps to Reproduce:
1. read /etc/rc.d/rc.sysinit line 560 approx.
2. run that line on a multihomed system
  
Actual results:
1. Yuk! Can return multiple ip addresses
2. On my system: 10.1.1.5 192.168.0.1

Expected results:
1. Should not return multiple ip addresses
2. Should try each ip until success

Additional info:
Should be something like this:

for ipaddr in $(ip addr show to 0/0 scope global | awk '/[[:space:]]inet / {
print gensub("/.*","","g",$2) }'
do
     HOSTNAME=
     eval $(ipcalc -h $ipaddr 2>/dev/null)
     [ "$HOSTNAME" ] && { hostname $HOSTNAME; break; }
done

The ordering of interfaces is arbitary and this might not always produce the
best result. The comments also state that there should not be more than one
network interface active at that stage. But how about some defensive programming
and simply assume the worst. Doesn't hurt.

Comment 1 Bug Zapper 2008-11-26 10:33:42 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 iarly selbir 2009-03-23 00:30:02 UTC
This bug seems inactive.

I want keep it alive.

any feedback about?

Thanks.

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 3 Bill Nottingham 2009-03-23 16:29:18 UTC
It's still there.

Comment 4 Bill Nottingham 2009-03-23 17:25:59 UTC
http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=dcd2526f079cad6a27fc72284f0977780a8fe198

Sorry about the delayed response.


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