diff options
author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-11-23 18:03:42 +0300 |
---|---|---|
committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-11-23 18:24:57 +0300 |
commit | d833a1eee22f3e5dc46208947bc88e2062ccb5a6 (patch) | |
tree | ce8cebb6801e7d3a35949eacf63ebf4f773a7886 | |
parent | ef7e91e1acf715367598c54be8589205b6d65135 (diff) |
x2go_plugin.c: Ensure that pyhoca-cli will never ask interactively for a password.
-rw-r--r-- | plugins/x2go/x2go_plugin.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/plugins/x2go/x2go_plugin.c b/plugins/x2go/x2go_plugin.c index 3b71ed75b..dc8fdf729 100644 --- a/plugins/x2go/x2go_plugin.c +++ b/plugins/x2go/x2go_plugin.c @@ -1028,6 +1028,12 @@ static gboolean rmplugin_x2go_pyhoca_terminate_session(X2GoCustomUserData *custo return G_SOURCE_REMOVE; } + if (FEATURE_AVAILABLE(gpdata, "NO_INTERACTIVE")) { + argv[argc++] = g_strdup("--no-interactive"); + } else { + REMMINA_PLUGIN_WARNING("%s", FEATURE_NOT_AVAIL_STR("NO_INTERACTIVE")); + } + argv[argc++] = NULL; GError* error = NULL; @@ -1595,16 +1601,22 @@ static gchar* rmplugin_x2go_get_pyhoca_sessions(RemminaProtocolWidget* gp, GErro } } else { g_set_error(error, 1, 1, FEATURE_NOT_AVAIL_STR("USERNAME")); - REMMINA_PLUGIN_WARNING("%s", FEATURE_NOT_AVAIL_STR("USERNAME")); + REMMINA_PLUGIN_CRITICAL("%s", FEATURE_NOT_AVAIL_STR("USERNAME")); return NULL; } + if (FEATURE_AVAILABLE(gpdata, "NO_INTERACTIVE")) { + argv[argc++] = g_strdup("--no-interactive"); + } else { + REMMINA_PLUGIN_WARNING("%s", FEATURE_NOT_AVAIL_STR("NO_INTERACTIVE")); + } + if (password && FEATURE_AVAILABLE(gpdata, "PASSWORD")) { if (FEATURE_AVAILABLE(gpdata, "AUTH_ATTEMPTS")) { argv[argc++] = g_strdup("--auth-attempts"); argv[argc++] = g_strdup_printf ("%i", 0); } else { - REMMINA_PLUGIN_DEBUG("%s", FEATURE_NOT_AVAIL_STR("AUTH_ATTEMPTS")); + REMMINA_PLUGIN_WARNING("%s", FEATURE_NOT_AVAIL_STR("AUTH_ATTEMPTS")); } if (strlen(password) > 0) { argv[argc++] = g_strdup("--force-password"); @@ -1613,7 +1625,7 @@ static gchar* rmplugin_x2go_get_pyhoca_sessions(RemminaProtocolWidget* gp, GErro } } else if (!password) { g_set_error(error, 1, 1, FEATURE_NOT_AVAIL_STR("PASSWORD")); - REMMINA_PLUGIN_WARNING("%s", FEATURE_NOT_AVAIL_STR("PASSWORD")); + REMMINA_PLUGIN_CRITICAL("%s", FEATURE_NOT_AVAIL_STR("PASSWORD")); return NULL; } @@ -2051,6 +2063,12 @@ static gboolean rmplugin_x2go_exec_x2go(gchar *host, REMMINA_PLUGIN_DEBUG("%s", FEATURE_NOT_AVAIL_STR("AUTH_ATTEMPTS")); } + if (FEATURE_AVAILABLE(gpdata, "NO_INTERACTIVE")) { + argv[argc++] = g_strdup("--no-interactive"); + } else { + REMMINA_PLUGIN_WARNING("%s", FEATURE_NOT_AVAIL_STR("NO_INTERACTIVE")); + } + if (FEATURE_AVAILABLE(gpdata, "COMMAND")) { argv[argc++] = g_strdup("-c"); // FIXME: pyhoca-cli is picky about multiple quotes around |