Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntenore Gatta (tmow) <antenore@simbiosi.org>2022-01-10 13:02:11 +0300
committerAntenore Gatta (tmow) <antenore@simbiosi.org>2022-01-10 13:02:11 +0300
commitc45089af69508f323ab96e04abac6bf9bcf75244 (patch)
tree230abcb25a682de79e6c053c99d874b84bb9abae /src/remmina_ssh_plugin.c
parentf69915048ea76fa48eec44af8db3e416727a1c9d (diff)
Adding per plugin AUDIT traces
Diffstat (limited to 'src/remmina_ssh_plugin.c')
-rw-r--r--src/remmina_ssh_plugin.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/remmina_ssh_plugin.c b/src/remmina_ssh_plugin.c
index 13928df96..a89805031 100644
--- a/src/remmina_ssh_plugin.c
+++ b/src/remmina_ssh_plugin.c
@@ -232,6 +232,8 @@ typedef struct _RemminaPluginSshData {
pthread_t thread;
+ gboolean closed;
+
RemminaSshSearch * search_widget;
} RemminaPluginSshData;
@@ -330,6 +332,15 @@ remmina_plugin_ssh_main_thread(gpointer data)
remmina_plugin_service->protocol_plugin_set_error(gp, "%s", ssh->error);
break;
}
+ gchar *server;
+ gint port;
+ remmina_plugin_service->get_server_port(remmina_plugin_service->file_get_string(remminafile, "server"),
+ 22,
+ &server,
+ &port);
+
+ REMMINA_AUDIT(_("Connected to %s:%d via SSH"), server, port);
+ g_free(server), server = NULL;
break;
case REMMINA_SSH_AUTH_PARTIAL:
REMMINA_DEBUG("Continue with the next auth method");
@@ -892,9 +903,24 @@ remmina_plugin_ssh_eof(VteTerminal *vteterminal, RemminaProtocolWidget *gp)
TRACE_CALL(__func__);
RemminaFile *remminafile = remmina_plugin_service->protocol_plugin_get_file(gp);
+ RemminaPluginSshData *gpdata = GET_PLUGIN_DATA(gp);
+
+ if (gpdata->closed)
+ return;
if (remmina_file_get_int(remminafile, "sshlogenabled", FALSE))
remmina_plugin_ssh_vte_save_session(NULL, gp);
+
+ gchar *server;
+ gint port;
+ remmina_plugin_service->get_server_port(remmina_plugin_service->file_get_string(remminafile, "server"),
+ 22,
+ &server,
+ &port);
+
+ REMMINA_AUDIT(_("Disconnected from %s:%d via SSH"), server, port);
+ g_free(server), server = NULL;
+ gpdata->closed = TRUE;
}
/**
@@ -932,6 +958,8 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp)
gpdata = g_new0(RemminaPluginSshData, 1);
g_object_set_data_full(G_OBJECT(gp), "plugin-data", gpdata, g_free);
+ gpdata->closed = FALSE;
+
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_container_add(GTK_CONTAINER(gp), hbox);