summaryrefslogtreecommitdiff
path: root/src/nm-policy-hosts.h
Commit message (Collapse)AuthorAgeFilesLines
* policy: stop touching /etc/hostsDan Williams2010-12-171-18/+2
| | | | | | | | | | | | | | | | | | | | | | | Handling of /etc/hosts is highly site- and admin- specific in many more complex cases, and it's exceedingly hard and error- prone for NetworkManager to handle all those cases. So remove this functionality entirely. That's not a big loss, as it turns out there's a much more elegant solution. The only requirement is that the machine's hostname map back to an IP address owned by the machine. That requirement can be satisifed by nss-myhostname or even possibly the distro's installer. If the user does not want nss-myhostname then it can be uninstalled. Distros should use a "recommends" feature in their packaging system so that the NetworkManager package does *not* have a hard requirement on nss-myhostname. Thus everyone is happy; things Just Work when nss-myhostname is installed, but more advanced users can uninstall it and customize /etc/hosts as they wish. Another alternative is a dispatcher script that listents for the 'hostname' event, and updates /etc/hosts according to the administrator's preference.
* policy: preserve custom hostnames on local-mapping lines (rh #627269)Dan Williams2010-10-071-0/+2
| | | | | | Try to preserve custom hostnames (ie, anything not a localhost* variant, the current hostname, or the previous hostname) when rewriting the 127.0.0.1/::1 localhost mapping lines.
* policy: map hostname to current IP address (bgo #619931)Dan Williams2010-06-211-2/+6
| | | | | | | | | | | | Instead of always mapping the current hostname to 127.0.0.1 or whatever the user mapped it to manually, make sure the hostname maps to the default device's IPv4 and IPv6 address if there's a default device. This helps out services that do a lookup on the machine hostname to determine the IP address, which while a broken behavior (since there are too many edge-cases) is pretty wide-spread and thus we should support it.
* policy: pass default IPv4 and IPv6 addresses to hostname functionsDan Williams2010-06-171-0/+2
| | | | | | | In preparation for updating /etc/hosts to assign the current hostname to the current IP address to allow programs that (somewhat incorrectly) do DNS lookups on the machine's current hostname to find out its IP address.
* policy: move hostname/lookup thread operations into separate fileDan Williams2010-04-191-3/+7
|
* hosts: always check and update /etc/hosts if needed (rh #569914)Dan Williams2010-03-021-0/+36
If the hostname was changed while NM wasn't running, and thus /etc/hosts was out of sync with the new hostname, NM wouldn't make sure that the new hostname was mapped in /etc/hosts. Make sure that happens and add a bunch of testcases for /etc/hosts rewriting.