summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-03-27 21:57:25 +0200
committerGuido Günther <agx@sigxcpu.org>2012-03-27 21:57:25 +0200
commitddf432a6c1702283497af3876b88cf2ae297e86d (patch)
tree4d969c7137bb167d4b2fd33863280678b99a20ab
parent693f4a6413c126a9576ec6a6eb0bc143a51b3eb5 (diff)
parentfe51938087074b9a4ada8a08c27ee112ed5593df (diff)
Merge tag 'v0.0.3' into debian/sid
v0.0.3
-rw-r--r--Makefile.am2
-rw-r--r--NEWS11
-rw-r--r--auth-dialog/main.c2
-rw-r--r--auth-dialog/vpn-password-dialog.c93
-rw-r--r--configure.ac2
-rw-r--r--m4/compiler_warnings.m411
-rw-r--r--network-manager-iodine.doap4
-rw-r--r--po/LINGUAS2
-rw-r--r--po/pl.po129
-rw-r--r--properties/nm-iodine-dialog.ui3
-rw-r--r--src/nm-iodine-service.c64
11 files changed, 198 insertions, 125 deletions
diff --git a/Makefile.am b/Makefile.am
index 794cc01..9b35207 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,8 @@ nmvpnservice_DATA = nm-iodine-service.name
nm-iodine-service.name: $(srcdir)/nm-iodine-service.name.in
sed -e 's|[@]LIBEXECDIR[@]|$(libexecdir)|g' $< >$@
+DISTCHECK_CONFIGURE_FLAGS = --enable-more-warnings=yes
+
EXTRA_DIST = nm-iodine-service.name.in \
$(dbusservice_DATA) \
$(desktop_in_files) \
diff --git a/NEWS b/NEWS
index a7e43a7..d2ed44a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,15 @@
=============
+Version 0.0.3
+=============
+* Pass the password via stdin
+* Distinguish login failures from other errors
+* Drop unused code
+* More flexible build-time warnings [Dan Williams]
+* UI translations:
+ Piotr Drąg (pl)
+* Many thanks to Dan Williams for the review!
+
+=============
Version 0.0.2
=============
* Pass the password via the environment
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index a7f127b..fe6f8ae 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -132,8 +132,6 @@ get_secrets (const char *vpn_uuid,
vpn_password_dialog_new (_("Authenticate VPN"), prompt, NULL);
g_free (prompt);
- vpn_password_dialog_set_show_password_secondary (dialog, FALSE);
-
/* pre-fill dialog with the password */
if (pw && !(pw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED))
vpn_password_dialog_set_password (dialog, pw);
diff --git a/auth-dialog/vpn-password-dialog.c b/auth-dialog/vpn-password-dialog.c
index 6c976a3..28ce19b 100644
--- a/auth-dialog/vpn-password-dialog.c
+++ b/auth-dialog/vpn-password-dialog.c
@@ -38,11 +38,9 @@ G_DEFINE_TYPE (VpnPasswordDialog, vpn_password_dialog, GTK_TYPE_DIALOG)
typedef struct {
/* Attributes */
gboolean show_password;
- gboolean show_password_secondary;
/* Internal widgetry and flags */
GtkWidget *password_entry;
- GtkWidget *password_entry_secondary;
GtkWidget *show_passwords_checkbox;
GtkWidget *table_alignment;
@@ -50,7 +48,6 @@ typedef struct {
GtkSizeGroup *group;
char *primary_password_label;
- char *secondary_password_label;
} VpnPasswordDialogPrivate;
/* VpnPasswordDialogClass methods */
@@ -67,11 +64,9 @@ finalize (GObject *object)
VpnPasswordDialogPrivate *priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (object);
g_object_unref (priv->password_entry);
- g_object_unref (priv->password_entry_secondary);
g_object_unref (priv->group);
g_free (priv->primary_password_label);
- g_free (priv->secondary_password_label);
G_OBJECT_CLASS (vpn_password_dialog_parent_class)->finalize (object);
}
@@ -93,8 +88,6 @@ vpn_password_dialog_init (VpnPasswordDialog *dialog)
priv->show_password = TRUE;
priv->primary_password_label = g_strdup ( _("_Password:") );
- priv->show_password_secondary = TRUE;
- priv->secondary_password_label = g_strdup ( _("_Secondary Password:") );
}
/* GtkDialog callbacks */
@@ -106,8 +99,6 @@ dialog_show_callback (GtkWidget *widget, gpointer callback_data)
if (gtk_widget_get_visible (priv->password_entry))
gtk_widget_grab_focus (priv->password_entry);
- else if (gtk_widget_get_visible (priv->password_entry_secondary))
- gtk_widget_grab_focus (priv->password_entry_secondary);
}
static void
@@ -151,8 +142,6 @@ add_table_rows (VpnPasswordDialog *dialog)
row = 0;
if (priv->show_password)
add_row (priv->table, row++, priv->primary_password_label, priv->password_entry);
- if (priv->show_password_secondary)
- add_row (priv->table, row++, priv->secondary_password_label, priv->password_entry_secondary);
gtk_table_attach_defaults (GTK_TABLE (priv->table), priv->show_passwords_checkbox, 1, 2, row, row + 1);
@@ -169,7 +158,6 @@ show_passwords_toggled_cb (GtkWidget *widget, gpointer user_data)
visible = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry), visible);
- gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry_secondary), visible);
}
/* Public VpnPasswordDialog methods */
@@ -205,9 +193,6 @@ vpn_password_dialog_new (const char *title,
action_area = GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog)));
/* Setup the dialog */
-#if !GTK_CHECK_VERSION (2,22,0)
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (content, 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
@@ -234,24 +219,18 @@ vpn_password_dialog_new (const char *title,
gtk_container_add (GTK_CONTAINER (priv->table_alignment), priv->table);
priv->password_entry = gtk_entry_new ();
- priv->password_entry_secondary = gtk_entry_new ();
priv->show_passwords_checkbox = gtk_check_button_new_with_mnemonic (_("Sh_ow passwords"));
/* We want to hold on to these during the table rearrangement */
g_object_ref_sink (priv->password_entry);
- g_object_ref_sink (priv->password_entry_secondary);
g_object_ref_sink (priv->show_passwords_checkbox);
gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry), FALSE);
- gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry_secondary), FALSE);
g_signal_connect_swapped (priv->password_entry, "activate",
G_CALLBACK (gtk_window_activate_default),
dialog);
- g_signal_connect_swapped (priv->password_entry_secondary, "activate",
- G_CALLBACK (gtk_window_activate_default),
- dialog);
g_signal_connect (priv->show_passwords_checkbox, "toggled",
G_CALLBACK (show_passwords_toggled_cb),
@@ -330,19 +309,6 @@ vpn_password_dialog_set_password (VpnPasswordDialog *dialog,
}
void
-vpn_password_dialog_set_password_secondary (VpnPasswordDialog *dialog,
- const char *password_secondary)
-{
- VpnPasswordDialogPrivate *priv;
-
- g_return_if_fail (VPN_IS_PASSWORD_DIALOG (dialog));
-
- priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
- gtk_entry_set_text (GTK_ENTRY (priv->password_entry_secondary),
- password_secondary ? password_secondary : "");
-}
-
-void
vpn_password_dialog_set_show_password (VpnPasswordDialog *dialog, gboolean show)
{
VpnPasswordDialogPrivate *priv;
@@ -360,24 +326,6 @@ vpn_password_dialog_set_show_password (VpnPasswordDialog *dialog, gboolean show)
}
void
-vpn_password_dialog_set_show_password_secondary (VpnPasswordDialog *dialog,
- gboolean show)
-{
- VpnPasswordDialogPrivate *priv;
-
- g_return_if_fail (dialog != NULL);
- g_return_if_fail (VPN_IS_PASSWORD_DIALOG (dialog));
-
- priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-
- show = !!show;
- if (priv->show_password_secondary != show) {
- priv->show_password_secondary = show;
- add_table_rows (dialog);
- }
-}
-
-void
vpn_password_dialog_focus_password (VpnPasswordDialog *dialog)
{
VpnPasswordDialogPrivate *priv;
@@ -390,19 +338,6 @@ vpn_password_dialog_focus_password (VpnPasswordDialog *dialog)
gtk_widget_grab_focus (priv->password_entry);
}
-void
-vpn_password_dialog_focus_password_secondary (VpnPasswordDialog *dialog)
-{
- VpnPasswordDialogPrivate *priv;
-
- g_return_if_fail (dialog != NULL);
- g_return_if_fail (VPN_IS_PASSWORD_DIALOG (dialog));
-
- priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
- if (priv->show_password_secondary)
- gtk_widget_grab_focus (priv->password_entry_secondary);
-}
-
const char *
vpn_password_dialog_get_password (VpnPasswordDialog *dialog)
{
@@ -414,17 +349,6 @@ vpn_password_dialog_get_password (VpnPasswordDialog *dialog)
return gtk_entry_get_text (GTK_ENTRY (priv->password_entry));
}
-const char *
-vpn_password_dialog_get_password_secondary (VpnPasswordDialog *dialog)
-{
- VpnPasswordDialogPrivate *priv;
-
- g_return_val_if_fail (VPN_IS_PASSWORD_DIALOG (dialog), NULL);
-
- priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
- return gtk_entry_get_text (GTK_ENTRY (priv->password_entry_secondary));
-}
-
void vpn_password_dialog_set_password_label (VpnPasswordDialog *dialog,
const char *label)
{
@@ -442,20 +366,3 @@ void vpn_password_dialog_set_password_label (VpnPasswordDialog *dialog,
add_table_rows (dialog);
}
-void vpn_password_dialog_set_password_secondary_label (VpnPasswordDialog *dialog,
- const char *label)
-{
- VpnPasswordDialogPrivate *priv;
-
- g_return_if_fail (dialog != NULL);
- g_return_if_fail (VPN_IS_PASSWORD_DIALOG (dialog));
-
- priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-
- g_free (priv->secondary_password_label);
- priv->secondary_password_label = g_strdup (label);
-
- if (priv->show_password_secondary)
- add_table_rows (dialog);
-}
-
diff --git a/configure.ac b/configure.ac
index eb42601..be7ea64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ(2.52)
-AC_INIT(NetworkManager-iodine, 0.0.2, agx@sigxcpu.org, NetworkManager-iodine)
+AC_INIT(NetworkManager-iodine, 0.0.3, agx@sigxcpu.org, NetworkManager-iodine)
AM_INIT_AUTOMAKE([subdir-objects no-dist-gzip dist-xz])
AM_MAINTAINER_MODE
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
index 6cea2f7..12bd26a 100644
--- a/m4/compiler_warnings.m4
+++ b/m4/compiler_warnings.m4
@@ -1,11 +1,11 @@
AC_DEFUN([NM_COMPILER_WARNINGS],
[AC_ARG_ENABLE(more-warnings,
- AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
- set_more_warnings="$enableval",set_more_warnings=yes)
-AC_MSG_CHECKING(for more warnings, including -Werror)
+ AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
+ set_more_warnings="$enableval",set_more_warnings=error)
+AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
- CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
+ CFLAGS="-Wall -std=gnu89 $CFLAGS"
for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
-Wdeclaration-after-statement -Wstrict-prototypes \
@@ -25,6 +25,9 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
unset SAVE_CFLAGS
done
unset option
+ if test "x$set_more_warnings" = xerror; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
else
AC_MSG_RESULT(no)
fi
diff --git a/network-manager-iodine.doap b/network-manager-iodine.doap
index a50b26d..19be840 100644
--- a/network-manager-iodine.doap
+++ b/network-manager-iodine.doap
@@ -8,9 +8,9 @@
<name xml:lang="en">network-manager-iodine</name>
<shortdesc xml:lang="en">Iodine support for NetworkManager</shortdesc>
- <homepage rdf:resource="http://honk.sigxcpu.org/piki/projects//network-manager-iodine/" />
+ <homepage rdf:resource="http://honk.sigxcpu.org/piki/projects/network-manager-iodine/" />
<category rdf:resource="http://api.gnome.org/doap-extensions#development" />
- <download-page rdf:resource="http://download.gnome.org/sources/krb5-auth-dialog/" />
+ <download-page rdf:resource="http://honk.sigxcpu.org/projects/network-manager-iodine/tarballs/" />
<maintainer>
<foaf:Person>
diff --git a/po/LINGUAS b/po/LINGUAS
index bc8cbb0..932f713 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -1,2 +1,2 @@
# please keep this list sorted alphabetically
-#
+pl
diff --git a/po/pl.po b/po/pl.po
new file mode 100644
index 0000000..05c7ba4
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,129 @@
+# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+# Aviary.pl
+# Jeśli masz jakiekolwiek uwagi odnoszące się do tłumaczenia lub chcesz
+# pomóc w jego rozwijaniu i pielęgnowaniu, napisz do nas:
+# gnomepl@aviary.pl
+# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+msgid ""
+msgstr ""
+"Project-Id-Version: network-manager-iodine\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-18 17:28+0100\n"
+"PO-Revision-Date: 2012-02-18 17:30+0100\n"
+"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
+"Language-Team: Polish <gnomepl@aviary.pl>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2;\n"
+"X-Poedit-Language: Polish\n"
+"X-Poedit-Country: Poland\n"
+
+#. Otherwise, we have no saved password, or the password flags indicated
+#. * that the password should never be saved.
+#.
+#: ../auth-dialog/main.c:129
+#, c-format
+msgid "You need to authenticate to access the Virtual Private Network '%s'."
+msgstr ""
+"Aby uzyskać dostęp do wirtualnej sieci prywatnej \"%s\", należy się "
+"uwierzytelnić."
+
+#: ../auth-dialog/main.c:132
+msgid "Authenticate VPN"
+msgstr "Uwierzytelnianie VPN"
+
+#: ../auth-dialog/vpn-password-dialog.c:95
+#: ../properties/nm-iodine-dialog.ui.h:9
+msgid "_Password:"
+msgstr "_Hasło:"
+
+#: ../auth-dialog/vpn-password-dialog.c:97
+msgid "_Secondary Password:"
+msgstr "Hasło _dodatkowe:"
+
+#: ../auth-dialog/vpn-password-dialog.c:239
+msgid "Sh_ow passwords"
+msgstr "Wyświ_etlanie haseł"
+
+#: ../properties/nm-iodine.c:46
+msgid "Iodine DNS Tunnel"
+msgstr "Tunel DNS Iodine"
+
+#: ../properties/nm-iodine.c:47
+msgid "Tunnel connections via DNS."
+msgstr "Połączenia tunelowe przez DNS."
+
+#: ../properties/nm-iodine-dialog.ui.h:1
+msgid "<b>General</b>"
+msgstr "<b>Ogólne</b>"
+
+#: ../properties/nm-iodine-dialog.ui.h:2
+msgid "<b>Optional</b>"
+msgstr "<b>Opcjonalne</b>"
+
+#: ../properties/nm-iodine-dialog.ui.h:3
+msgid "Always ask"
+msgstr "Pytanie za każdym razem"
+
+#: ../properties/nm-iodine-dialog.ui.h:4
+msgid "Not required"
+msgstr "Niewymagane"
+
+#: ../properties/nm-iodine-dialog.ui.h:5
+msgid "Saved"
+msgstr "Zapisane"
+
+#: ../properties/nm-iodine-dialog.ui.h:6
+msgid "Show password"
+msgstr "Wyświetlanie hasła"
+
+#: ../properties/nm-iodine-dialog.ui.h:7
+msgid "_Fragment Size:"
+msgstr "_Rozmiar fragmentu:"
+
+#: ../properties/nm-iodine-dialog.ui.h:8
+msgid "_Nameserver:"
+msgstr "Serwer _nazw:"
+
+#: ../properties/nm-iodine-dialog.ui.h:10
+msgid "_Toplevel Domain:"
+msgstr "_Domena najwyższego poziomu:"
+
+#: ../src/nm-iodine-service.c:132
+#, c-format
+msgid "invalid integer property '%s' or out of range [%d -> %d]"
+msgstr ""
+"nieprawidłowa własność liczby całkowitej \"%s\" lub jest poza zakresem [%d -"
+"> %d]"
+
+#: ../src/nm-iodine-service.c:143
+#, c-format
+msgid "invalid boolean property '%s' (not yes or no)"
+msgstr ""
+"nieprawidłowa własność zmiennej logicznej \"%s\" (nie wynosi \"yes\" lub \"no"
+"\")"
+
+#: ../src/nm-iodine-service.c:150
+#, c-format
+msgid "unhandled property '%s' type %s"
+msgstr "nieobsługiwana własność \"%s\" typu \"%s\""
+
+#: ../src/nm-iodine-service.c:164
+#, c-format
+msgid "property '%s' invalid or not supported"
+msgstr "własność \"%s\" jest nieprawidłowa lub nieobsługiwana"
+
+#: ../src/nm-iodine-service.c:180
+msgid "No VPN configuration options."
+msgstr "Brak opcji konfiguracji VPN."
+
+#: ../src/nm-iodine-service.c:199
+msgid "No VPN secrets!"
+msgstr "Brak haseł VPN."
+
+#: ../src/nm-iodine-service.c:451
+msgid "Could not find iodine binary."
+msgstr "Nie można odnaleźć pliku binarnego iodine."
diff --git a/properties/nm-iodine-dialog.ui b/properties/nm-iodine-dialog.ui
index f362c6c..b84af9b 100644
--- a/properties/nm-iodine-dialog.ui
+++ b/properties/nm-iodine-dialog.ui
@@ -13,9 +13,6 @@
<row>
<col id="0" translatable="yes">Always ask</col>
</row>
- <row>
- <col id="0" translatable="yes">Not required</col>
- </row>
</data>
</object>
<object class="GtkVBox" id="iodine-vbox">
diff --git a/src/nm-iodine-service.c b/src/nm-iodine-service.c
index ead8908..03012f8 100644
--- a/src/nm-iodine-service.c
+++ b/src/nm-iodine-service.c
@@ -52,6 +52,7 @@ G_DEFINE_TYPE (NMIODINEPlugin, nm_iodine_plugin, NM_TYPE_VPN_PLUGIN)
typedef struct {
GPid pid;
+ NMVPNPluginFailure failure;
GHashTable *ip4config;
} NMIODINEPluginPrivate;
@@ -271,13 +272,23 @@ value_destroy (gpointer data)
g_slice_free (GValue, val);
}
-static gboolean
-iodine_parse_stderr_line (const char* line, GHashTable *ip4config)
+static gint
+iodine_parse_stderr_line (NMVPNPlugin *plugin,
+ const char* line,
+ GHashTable *ip4config)
{
- gchar **split;
+ NMIODINEPluginPrivate *priv = NM_IODINE_PLUGIN_GET_PRIVATE (plugin);
+ gchar **split = NULL;
GValue *val;
gint len;
- gint ret = TRUE;
+ gint ret = 1;
+
+ if (g_str_has_prefix(line, "Bad password")) {
+ g_debug ("Login failure");
+ priv->failure = NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED;
+ ret = -1;
+ goto out;
+ }
split = g_strsplit (line, " ", 0);
len = g_strv_length (split);
@@ -340,7 +351,7 @@ iodine_parse_stderr_line (const char* line, GHashTable *ip4config)
g_hash_table_insert (ip4config,
NM_VPN_PLUGIN_IP4_CONFIG_PREFIX,
val);
- ret = FALSE;
+ ret = 0; /* success */
} else
g_debug("%s", line);
@@ -369,7 +380,7 @@ iodine_stderr_cb (GIOChannel *source, GIOCondition condition, gpointer plugin)
if (l)
line[l-1] = '\0';
- ret = iodine_parse_stderr_line(line, priv->ip4config);
+ ret = iodine_parse_stderr_line(plugin, line, priv->ip4config);
if (!ret) {
g_debug("Parsing done, sending IP4 config");
nm_vpn_plugin_set_ip4_config(plugin, priv->ip4config);
@@ -406,8 +417,10 @@ iodine_watch_cb (GPid pid, gint status, gpointer user_data)
waitpid (priv->pid, NULL, WNOHANG);
priv->pid = 0;
- /* Must be after data->state is set since signals use data->state */
- if (error) {
+ if (priv->failure >= 0) {
+ nm_vpn_plugin_failure (NM_VPN_PLUGIN (plugin),
+ priv->failure);
+ } else if (error) {
nm_vpn_plugin_failure (NM_VPN_PLUGIN (plugin),
NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED);
}
@@ -422,6 +435,22 @@ has_user(const char* user)
return (getpwnam(user) == NULL) ? FALSE : TRUE;
}
+
+static void
+send_password(gint fd, NMSettingVPN *s_vpn)
+{
+ const char *passwd;
+
+ passwd = nm_setting_vpn_get_secret (s_vpn, NM_IODINE_KEY_PASSWORD);
+ /* Don't send an empty password since this makes iodine block */
+ if (!passwd || !strlen(passwd))
+ passwd = "<none>";
+
+ write (fd, passwd, strlen(passwd));
+ write (fd, "\n", 1);
+}
+
+
static gint
nm_iodine_start_iodine_binary(NMIODINEPlugin *plugin,
NMSettingVPN *s_vpn,
@@ -433,7 +462,7 @@ nm_iodine_start_iodine_binary(NMIODINEPlugin *plugin,
GSource *iodine_watch;
GIOChannel *stderr_channel;
gint stdin_fd, stderr_fd;
- const char *props_topdomain, *props_fragsize, *props_nameserver, *passwd;
+ const char *props_topdomain, *props_fragsize, *props_nameserver;
/* Find iodine */
iodine_binary = iodine_binary_paths;
@@ -458,12 +487,6 @@ nm_iodine_start_iodine_binary(NMIODINEPlugin *plugin,
NM_IODINE_KEY_NAMESERVER);
props_topdomain = nm_setting_vpn_get_data_item (s_vpn,
NM_IODINE_KEY_TOPDOMAIN);
-
- passwd = nm_setting_vpn_get_secret (s_vpn, NM_IODINE_KEY_PASSWORD);
-
- if (passwd && strlen(passwd))
- g_setenv("IODINE_PASS", passwd, TRUE);
-
iodine_argv = g_ptr_array_new ();
g_ptr_array_add (iodine_argv, (gpointer) (*iodine_binary));
/* Run in foreground */
@@ -505,7 +528,9 @@ nm_iodine_start_iodine_binary(NMIODINEPlugin *plugin,
g_ptr_array_free (iodine_argv, TRUE);
g_message ("iodine started with pid %d", pid);
- close(stdin_fd);
+
+ send_password (stdin_fd, s_vpn);
+ close (stdin_fd);
stderr_channel = g_io_channel_unix_new (stderr_fd);
g_io_add_watch(stderr_channel,
@@ -531,7 +556,7 @@ real_connect (NMVPNPlugin *plugin,
GError **error)
{
NMSettingVPN *s_vpn;
- gint iodine_fd = -1;
+ gint ret = -1;
s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection,
NM_TYPE_SETTING_VPN));
@@ -542,9 +567,9 @@ real_connect (NMVPNPlugin *plugin,
if (!nm_iodine_secrets_validate (s_vpn, error))
goto out;
- iodine_fd = nm_iodine_start_iodine_binary (NM_IODINE_PLUGIN (plugin),
+ ret = nm_iodine_start_iodine_binary (NM_IODINE_PLUGIN (plugin),
s_vpn, error);
- if (!iodine_fd)
+ if (!ret)
return TRUE;
out:
@@ -622,6 +647,7 @@ nm_iodine_plugin_init (NMIODINEPlugin *plugin)
g_str_equal,
NULL,
value_destroy);
+ priv->failure = -1;
}
static void