diff options
author | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2022-01-07 11:30:51 +0300 |
---|---|---|
committer | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2022-01-07 11:30:51 +0300 |
commit | 8272aeb7c79872a38e845d1c87edc9517bcb6754 (patch) | |
tree | ed337547b8cbaf9d4d5a93d53116aef0ac78f157 /plugins/rdp | |
parent | e5f27de6ad23f85dd1cfcd0ec560b2c54234c58a (diff) |
Auditing facility
This patch add a macro to log auditing traces, this traces will be
shown when the audit is enabled in the general preferences (security):
- in the linux journal if available
- if Remmina has been started with the Remmina Desktop file
- if started from the terminal
- from the terminal if G_MESSAGES_DEBUG=all is set (always).
Signed-off-by: Antenore Gatta (tmow) <antenore@simbiosi.org>
Diffstat (limited to 'plugins/rdp')
-rw-r--r-- | plugins/rdp/rdp_channels.c | 3 | ||||
-rw-r--r-- | plugins/rdp/rdp_event.c | 3 | ||||
-rw-r--r-- | plugins/rdp/rdp_plugin.c | 7 | ||||
-rw-r--r-- | plugins/rdp/rdp_plugin.h | 27 |
4 files changed, 34 insertions, 6 deletions
diff --git a/plugins/rdp/rdp_channels.c b/plugins/rdp/rdp_channels.c index 96dd0f540..f5089b7c1 100644 --- a/plugins/rdp/rdp_channels.c +++ b/plugins/rdp/rdp_channels.c @@ -79,7 +79,8 @@ void remmina_rdp_OnChannelConnectedEventHandler(rdpContext* context, ChannelConn if (rfi->scale == REMMINA_PROTOCOL_WIDGET_SCALE_MODE_DYNRES) { remmina_rdp_event_send_delayed_monitor_layout(rfi->protocol_widget); } - }REMMINA_PLUGIN_DEBUG("Channel %s has been opened", e->name); + } + REMMINA_PLUGIN_DEBUG("Channel %s has been opened", e->name); } void remmina_rdp_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e) diff --git a/plugins/rdp/rdp_event.c b/plugins/rdp/rdp_event.c index 91eb3a6a2..251f9ae0d 100644 --- a/plugins/rdp/rdp_event.c +++ b/plugins/rdp/rdp_event.c @@ -1112,6 +1112,9 @@ static void remmina_rdp_event_connected(RemminaProtocolWidget *gp, RemminaPlugin remmina_rdp_event_update_scale(gp); remmina_plugin_service->protocol_plugin_signal_connection_opened(gp); + const gchar *host = freerdp_settings_get_string (rfi->settings, FreeRDP_ServerHostname); + // TRANSLATORS: the placeholder may be either an IP/FQDN or a server hostname + REMMINA_PLUGIN_AUDIT(_("Connected to %s via RDP"), host); } static void remmina_rdp_event_reconnect_progress(RemminaProtocolWidget *gp, RemminaPluginRdpUiObject *ui) diff --git a/plugins/rdp/rdp_plugin.c b/plugins/rdp/rdp_plugin.c index 6cadfae5c..01354f67e 100644 --- a/plugins/rdp/rdp_plugin.c +++ b/plugins/rdp/rdp_plugin.c @@ -1022,6 +1022,9 @@ static void remmina_rdp_main_loop(RemminaProtocolWidget *gp) break; } } + const gchar *host = freerdp_settings_get_string (rfi->settings, FreeRDP_ServerHostname); + // TRANSLATORS: the placeholder may be either an IP/FQDN or a server hostname + REMMINA_PLUGIN_AUDIT(_("Disconnected from %s via RDP"), host); freerdp_disconnect(rfi->instance); REMMINA_PLUGIN_DEBUG("RDP client disconnected"); } @@ -1305,14 +1308,14 @@ static gchar *remmina_get_rdp_kbd_remap(const gchar *keymap) rdp_kbd_remap = g_malloc0(512); display = XOpenDisplay(0); for (i = 0; table[i] > 0; i += 2) { - g_snprintf(keys, sizeof(keys), "0x%02x=0x%02x", freerdp_keyboard_get_rdp_scancode_from_x11_keycode(XKeysymToKeycode(display, table[i])), + g_snprintf(keys, sizeof(keys), "0x%02x=0x%02x", freerdp_keyboard_get_rdp_scancode_from_x11_keycode(XKeysymToKeycode(display, table[i])), freerdp_keyboard_get_rdp_scancode_from_x11_keycode(XKeysymToKeycode(display, table[i + 1]))); if (i > 0) g_strlcat(rdp_kbd_remap, ",", 512); g_strlcat(rdp_kbd_remap, keys, 512); } XCloseDisplay(display); - + return rdp_kbd_remap; } diff --git a/plugins/rdp/rdp_plugin.h b/plugins/rdp/rdp_plugin.h index 9702bafce..bb26c3fe5 100644 --- a/plugins/rdp/rdp_plugin.h +++ b/plugins/rdp/rdp_plugin.h @@ -62,7 +62,6 @@ * * Returns: %TRUE if FREERDP headers are new enough */ - #define FREERDP_CHECK_VERSION(major,minor,revision) \ (FREERDP_VERSION_MAJOR > (major) || \ (FREERDP_VERSION_MAJOR == (major) && FREERDP_VERSION_MINOR > (minor)) || \ @@ -82,7 +81,9 @@ typedef struct rf_context rfContext; #define GET_PLUGIN_DATA(gp) (rfContext *)g_object_get_data(G_OBJECT(gp), "plugin-data") -/* Performance Flags, from freerdp source +/** + * Performance Flags, from freerdp source + * * PERF_FLAG_NONE 0x00000000 * PERF_DISABLE_WALLPAPER 0x00000001 * PERF_DISABLE_FULLWINDOWDRAG 0x00000002 @@ -103,7 +104,27 @@ typedef struct rf_context rfContext; #define DEFAULT_QUALITY_9 0x80 extern RemminaPluginService *remmina_plugin_service; -#define REMMINA_PLUGIN_DEBUG(fmt, ...) remmina_plugin_service->_remmina_debug(__func__, fmt, ##__VA_ARGS__) + +#define REMMINA_PLUGIN_INFO(fmt, ...) \ + remmina_plugin_service->_remmina_info(__func__, fmt, ##__VA_ARGS__) + +#define REMMINA_PLUGIN_MESSAGE(fmt, ...) \ + remmina_plugin_service->_remmina_message(__func, fmt, ##__VA_ARGS__) + +#define REMMINA_PLUGIN_DEBUG(fmt, ...) \ + remmina_plugin_service->_remmina_debug(__func__, fmt, ##__VA_ARGS__) + +#define REMMINA_PLUGIN_WARNING(fmt, ...) \ + remmina_plugin_service->_remmina_warning(__func__, fmt, ##__VA_ARGS__) + +/* This will intentionally crash Remmina */ +#define REMMINA_PLUGIN_ERROR(fmt, ...) \ + remmina_plugin_service->_remmina_error(__func__, fmt, ##__VA_ARGS__) + +#define REMMINA_PLUGIN_CRITICAL(fmt, ...) \ + remmina_plugin_service->_remmina_critical(__func__, fmt, ##__VA_ARGS__) +#define REMMINA_PLUGIN_AUDIT(fmt, ...) \ + remmina_plugin_service->_remmina_audit(__func__, fmt, ##__VA_ARGS__) struct rf_clipboard { rfContext * rfi; |