Bug 5484 - Provisioning: Don't use an 127.0.0.* host IP if they're alternatives
Summary: Provisioning: Don't use an 127.0.0.* host IP if they're alternatives
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: samba4-qa@samba.org
URL:
Keywords:
: 7142 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-22 04:54 UTC by Matthias Dieter Wallnöfer
Modified: 2010-03-04 03:39 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Dieter Wallnöfer 2008-05-22 04:54:02 UTC
I discovered in the autogenerated zone files from recent SAMBA 4 versions the ip address set to "127.0.0.1" rather than the one visible in the network. I've to change it after every provision process.
Could it be that this is caused by a missing "/etc/hosts" line/entry?
Comment 1 Andrew Bartlett 2008-05-22 05:20:43 UTC
Use the --host-ip option if your hostname does not resolve to a public IP address. 
Comment 2 Matthias Dieter Wallnöfer 2010-02-17 12:44:06 UTC
*** Bug 7142 has been marked as a duplicate of this bug. ***
Comment 3 John H Terpstra (mail address dead( 2010-02-17 13:07:54 UTC
Matthias,

Andrew Bartlett asked me to file a new bug report. I did as requested - 7142 is the result.

- John T.
Comment 4 Andrew Bartlett 2010-02-17 15:16:09 UTC
We can at least impose a filter to avoid any 127.* address being loaded into the zone file, if not specified. 

We can also try a reverse lookup on all the addresses found by the interfaces code and see if any of those match the proposed host name.  (Which should distinguish between VPN, virtual and other interfaces). 

Comment 5 Matthias Dieter Wallnöfer 2010-02-18 06:45:07 UTC
Sorry, JHT for closing the new bug report - but it's always the same issue. Let us now track the problem here in the original report.

I changed also the title to be more expressive.
Comment 6 Matthias Dieter Wallnöfer 2010-02-21 16:06:30 UTC
I pushed a patch which uses always a non-127.0.0.x address of the "/etc/hosts" file if other addresses are available (and the same also for IPv6 - "::1" is the local loopback there).
If you (jht) are satisfied with this approach please close.
Comment 7 Andrew Bartlett 2010-02-21 16:38:26 UTC
I don't think this will be quite enough to defeat the silly /etc/hosts produced by the OpenSUSE install on the box JHT has.  

Tridge has recently added a get_interfaces hook in python in some of his soon to land work on DNS.  When that lands we should be able to do the proposed reverse name resolution trick.  We should also be able to look for the only non-loopback address in some other cases. 

This may also be overtaken by us simply always using dynamic DNS updates. 

Andrew Bartlett
Comment 8 Andrew Tridgell 2010-03-03 15:46:41 UTC
> Tridge has recently added a get_interfaces hook in python in some of his soon
> to land work on DNS.  When that lands we should be able to do the proposed
> reverse name resolution trick.  We should also be able to look for the only
> non-loopback address in some other cases. 

yep, that is the right fix. We should use glue.interface_ips() in the provision.
That will avoid loopback, and ensure the IPs we get matches what Samba will
actually listen on.

Cheers, Tridge
Comment 9 Matthias Dieter Wallnöfer 2010-03-04 03:39:38 UTC
I will shortly push a fix. Marking this as "FIXED".