dns: don't update error when writing private resolv.conf

When update_dns() fails, callers expect 'error' argument to point to a
non-NULL error; but we are reusing the same variable when calling
update_resolv_conf() to update the private resolv.conf and thus the
function may return an empty error on failure.

Don't reuse the same error and pass a NULL argument instead, since we
don't care about errors when updating private resolv.conf.

Fixes: 5f9d348c20
This commit is contained in:
Beniamino Galvani 2015-05-18 17:50:59 +02:00
parent 045938074d
commit 8e46a737db

View file

@ -897,10 +897,8 @@ update_dns (NMDnsManager *self,
/* Unless we've already done it, update private resolv.conf in NMRUNDIR
ignoring any errors */
if (!(update && priv->rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_NONE)) {
g_clear_error (error);
update_resolv_conf (searches, nameservers, options, error, FALSE);
}
if (!(update && priv->rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_NONE))
update_resolv_conf (searches, nameservers, options, NULL, FALSE);
/* signal that resolv.conf was changed */
if (update && success)