Otherwise it causes connections that we don't want exported to leak
out and be shown in the connection editor even though the device
isn't supposed to be managed.
ifup/ifdown, nmcli, and possibly other tools need a way to get the
internally generated connection UUID and possibly it's path given
just the ifcfg file path. Not all ifcfg files have the UUID in
the file, so ifcfg-rh generates one. But external tools don't know
what that UUID is or what the logic that NM uses to generate it is.
Help them out a bit so that ifup/ifdown can easily poke NM given
just the ifcfg file.
The errors weren't registered with dbus-glib yet for some reason, so
errors returned when adding invalid connections or updating or whatever
weren't meaningful at all. We register them in the system settings
service (and not libnm-util) becuase libnm-util doesn't really have
anything to do wtih D-Bus, so we put the error registration with the
code that exports the connections over the bus.
Due to various ordering issues in ModemManager, when the Enable()
call fails because a PIN is required, MM will disable the modem
and *then* complete the dbus call. That means that NM gets the
Enable property change before the Enable() call completes, and NM
would then transition the device to DISCONNECTED. What we
really want to do is get the response from MM and then figure out
whether to fail activation or get secrets, not go to DISCONNECTED.
To fix this, ignore Enabled property changes to FALSE while
activating so we can handle it ourselves. There are still a few
fixes left in nm-applet to make the secrets request for PINs work
on-the-fly, but saved in the connection works fine.
If the user has already mapped the hostname to some other address,
assume the user knows what they are doing (since they probably do)
and leave that mapping alone, and create a minimal 127.0.0.1 entry.
If there was no hostname mapping, add it to the 127.0.0.1 entry
like NM did before.
Having the original hostname checks in the settings-service code
didn't allow the policy enough granularity to differentiate between
a plugin-provided hostname and the original hostname. We want to
fall back to the original hostname if there isn't a persistent
hostname (from a plugin) and if there isn't a DHCP-provided
hostname. Moving the original hostname checks to the policy
makes that possible. Clarify the precedence order at the same
time, and minimally validate the DHCP hostname as well.