diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-03-04 00:21:22 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-03-04 18:05:12 +0100 |
commit | 9be7cbe220bad088bc538574c98ec647b3d293dc (patch) | |
tree | 6257307b3de4176e03526542f98dbc79ec363a29 | |
parent | 5b0aa20df2d8462b98d2d630a597782733190027 (diff) | |
download | NetworkManager-bg/bond-reapply-rh1348198-new.tar.gz |
device: add list of changed properties to reapply audit logbg/bond-reapply-rh1348198-new
-rw-r--r-- | src/devices/nm-device.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index aa3f7c3977..0d6c2432fb 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -8523,6 +8523,7 @@ reapply_connection (NMDevice *self, NMConnection *con_old, NMConnection *con_new * the current settings connection * @version_id: either zero, or the current version id for the applied * connection. + * @audit_args: on return, a string representing the changes * @error: the error if %FALSE is returned * * Change configuration of an already configured device if possible. @@ -8534,6 +8535,7 @@ static gboolean check_and_reapply_connection (NMDevice *self, NMConnection *connection, guint64 version_id, + char **audit_args, GError **error) { NMDeviceClass *klass = NM_DEVICE_GET_CLASS (self); @@ -8560,6 +8562,9 @@ check_and_reapply_connection (NMDevice *self, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, &diffs); + if (nm_audit_manager_audit_enabled (nm_audit_manager_get ())) + *audit_args = nm_utils_format_con_diff_for_audit (diffs); + /************************************************************************** * check for unsupported changes and reject to reapply *************************************************************************/ @@ -8670,6 +8675,7 @@ reapply_cb (NMDevice *self, guint64 version_id = 0; gs_unref_object NMConnection *connection = NULL; GError *local = NULL; + gs_free char *audit_args = NULL; if (reapply_data) { connection = reapply_data->connection; @@ -8686,12 +8692,13 @@ reapply_cb (NMDevice *self, if (!check_and_reapply_connection (self, connection ? : (NMConnection *) nm_device_get_settings_connection (self), version_id, + &audit_args, &local)) { - nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_REAPPLY, self, FALSE, NULL, subject, local->message); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_REAPPLY, self, FALSE, audit_args, subject, local->message); g_dbus_method_invocation_take_error (context, local); local = NULL; } else { - nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_REAPPLY, self, TRUE, NULL, subject, NULL); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_REAPPLY, self, TRUE, audit_args, subject, NULL); g_dbus_method_invocation_return_value (context, NULL); } } |