mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-14 14:30:36 +01:00
core: minor cleanup in hostname code
This commit is contained in:
parent
442b6630de
commit
c9fcd30758
1 changed files with 8 additions and 6 deletions
|
|
@ -3486,14 +3486,16 @@ pk_hostname_cb(NMAuthChain *chain, GDBusMethodInvocation *context, gpointer user
|
|||
error = g_error_new_literal(NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_PERMISSION_DENIED,
|
||||
NM_UTILS_ERROR_MSG_INSUFF_PRIV);
|
||||
} else {
|
||||
if (!nm_hostname_manager_write_hostname(priv->hostname_manager, hostname)) {
|
||||
error = g_error_new_literal(NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_FAILED,
|
||||
"Saving the hostname failed.");
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!nm_hostname_manager_write_hostname(priv->hostname_manager, hostname)) {
|
||||
error = g_error_new_literal(NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_FAILED,
|
||||
"Saving the hostname failed.");
|
||||
}
|
||||
|
||||
done:
|
||||
nm_audit_log_control_op(NM_AUDIT_OP_HOSTNAME_SAVE,
|
||||
hostname,
|
||||
!error,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue