diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2015-07-14 10:19:19 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2015-08-04 09:32:12 +0200 |
commit | 9ce005da342113077c680c20309ea33953247124 (patch) | |
tree | 7109c70bd08089fc29890f97cb2d7cc354261c94 /src/devices/nm-device.c | |
parent | e49cc5dfcdbfadc6fc873eac163fb457ff08e0ab (diff) | |
download | NetworkManager-9ce005da342113077c680c20309ea33953247124.tar.gz |
device: add audit support
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r-- | src/devices/nm-device.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 2f21d6f409..d983d7a5ed 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -66,6 +66,7 @@ #include "nm-default-route-manager.h" #include "nm-route-manager.h" #include "sd-ipv4ll.h" +#include "nm-audit-manager.h" #include "nm-device-logging.h" _LOG_DECLARE_SELF (NMDevice); @@ -6177,6 +6178,7 @@ delete_on_deactivate_check_and_schedule (NMDevice *self, int ifindex) static void disconnect_cb (NMDevice *self, DBusGMethodInvocation *context, + NMAuthSubject *subject, GError *error, gpointer user_data) { @@ -6185,6 +6187,7 @@ disconnect_cb (NMDevice *self, if (error) { dbus_g_method_return_error (context, error); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, FALSE, subject, error->message); return; } @@ -6194,6 +6197,7 @@ disconnect_cb (NMDevice *self, NM_DEVICE_ERROR_NOT_ACTIVE, "Device is not active"); dbus_g_method_return_error (context, local); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, FALSE, subject, local->message); g_error_free (local); } else { nm_device_set_autoconnect (self, FALSE); @@ -6202,6 +6206,7 @@ disconnect_cb (NMDevice *self, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_USER_REQUESTED); dbus_g_method_return (context); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, TRUE, subject, NULL); } } @@ -6245,17 +6250,20 @@ impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context) static void delete_cb (NMDevice *self, DBusGMethodInvocation *context, + NMAuthSubject *subject, GError *error, gpointer user_data) { if (error) { dbus_g_method_return_error (context, error); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DELETE, self, FALSE, subject, error->message); return; } /* Authorized */ nm_platform_link_delete (NM_PLATFORM_GET, nm_device_get_ifindex (self)); dbus_g_method_return (context); + nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DELETE, self, TRUE, subject, NULL); } static void |