2007-12-05 Dan Williams <dcbw@redhat.com>

Patch from Casey Harkins <caseyharkins@gmail.com>

	* src/nm-openvpn-service-openvpn-helper.c
	  src/nm-openvpn-service.c
	  properties/nm-openvpn.c
	  auth-dialog/main.c
		- Fix up so it mostly works



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3140 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-12-05 22:50:54 +00:00
parent 775a223fda
commit 260002e3e3
5 changed files with 53 additions and 35 deletions

View file

@ -1,3 +1,13 @@
2007-12-05 Dan Williams <dcbw@redhat.com>
Patch from Casey Harkins <caseyharkins@gmail.com>
* src/nm-openvpn-service-openvpn-helper.c
src/nm-openvpn-service.c
properties/nm-openvpn.c
auth-dialog/main.c
- Fix up so it mostly works
2007-11-23 Tim Niemueller <tim@niemueller.de>
* configure.in: raise version number to 0.7.0 to reflect the

View file

@ -264,7 +264,7 @@ get_password_types (PasswordsInfo *info)
return FALSE;
for (iter = conf_list; iter; iter = iter->next) {
key = g_strconcat ((char *) iter->data, "connection/type", NULL);
key = g_strconcat ((char *) iter->data, "/connection/type", NULL);
str = gconf_client_get_string (gconf_client, key, NULL);
g_free (key);
@ -273,7 +273,7 @@ get_password_types (PasswordsInfo *info)
continue;
}
key = g_strconcat ((char *) iter->data, "connection/name", NULL);
key = g_strconcat ((char *) iter->data, "/connection/id", NULL);
str = gconf_client_get_string (gconf_client, key, NULL);
g_free (key);
@ -293,7 +293,7 @@ get_password_types (PasswordsInfo *info)
if (connection_path) {
int connection_type;
key = g_strconcat (connection_path, "vpn-properties/connection-type", NULL);
key = g_strconcat (connection_path, "/vpn-properties/connection-type", NULL);
connection_type = gconf_client_get_int (gconf_client, key, NULL);
g_free (key);
@ -304,7 +304,7 @@ get_password_types (PasswordsInfo *info)
case NM_OPENVPN_CONTYPE_X509:
success = TRUE;
key = g_strconcat (connection_path, "vpn-properties/", NM_OPENVPN_KEY_KEY, NULL);
key = g_strconcat (connection_path, "/vpn-properties/", NM_OPENVPN_KEY_KEY, NULL);
str = gconf_client_get_string (gconf_client, key, NULL);
g_free (key);
if (str) {
@ -324,9 +324,6 @@ get_password_types (PasswordsInfo *info)
break;
}
info->need_password = TRUE;
info->need_certpass = TRUE;
g_free (connection_path);
}
@ -394,9 +391,9 @@ main (int argc, char *argv[])
if (get_passwords (&info, retry)) {
if (info.need_password)
printf ("%s\n", info.password);
printf ("%s\n%s\n", NM_OPENVPN_KEY_PASSWORD, info.password);
if (info.need_certpass)
printf ("%s\n", info.certpass);
printf ("%s\n%s\n", NM_OPENVPN_KEY_CERTPASS, info.certpass);
}
printf ("\n\n");
/* for good measure, flush stdout since Kansas is going Bye-Bye */

View file

@ -331,7 +331,7 @@ impl_fill_connection (NetworkManagerVpnUI *self, NMConnection *connection)
else
dir = "";
g_hash_table_insert (properties, NM_OPENVPN_KEY_TA, str_to_gvalue (dir));
g_hash_table_insert (properties, NM_OPENVPN_KEY_TA_DIR, str_to_gvalue (dir));
}
}
@ -1637,6 +1637,36 @@ impl_get_object (void)
impl->last_fc_dir = NULL;
/* advanced settings */
glade_file = g_strdup_printf ("%s/%s", GLADEDIR, "nm-openvpn-dialog.glade");
impl->xml = glade_xml_new (glade_file, "nm-openvpn-advanced-dialog", GETTEXT_PACKAGE);
g_free( glade_file );
if (impl->xml == NULL)
goto error;
impl->advanced = GTK_DIALOG (glade_xml_get_widget(impl->xml, "nm-openvpn-advanced-dialog"));
impl->w_port = GTK_ENTRY (glade_xml_get_widget (impl->xml, "openvpn-port"));
impl->w_use_routes = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-routes"));
impl->w_routes = GTK_ENTRY (glade_xml_get_widget (impl->xml, "openvpn-routes"));
impl->w_use_lzo = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-lzo"));
impl->w_use_tap = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-tap"));
impl->w_use_tcp = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-tcp"));
impl->w_use_cipher = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-cipher"));
impl->w_cipher = GTK_COMBO_BOX( glade_xml_get_widget( impl->xml, "openvpn-cipher" ) );
populate_cipher(impl->w_cipher);
impl->w_use_ta = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-ta"));
impl->w_ta = GTK_ENTRY( glade_xml_get_widget( impl->xml, "openvpn-ta" ) );
impl->w_button_ta = GTK_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-but-ta" ) );
impl->w_ta_dir_label = GTK_LABEL( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-label" ) );
impl->w_ta_dir_none = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-none" ) );
impl->w_ta_dir_zero = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-zero" ) );
impl->w_ta_dir_one = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-one" ) );
/* normal settings */
glade_file = g_strdup_printf ("%s/%s", GLADEDIR, "nm-openvpn-dialog.glade");
impl->xml = glade_xml_new (glade_file, "nm-openvpn-widget", GETTEXT_PACKAGE);
g_free( glade_file );
@ -1646,18 +1676,13 @@ impl_get_object (void)
impl->widget = glade_xml_get_widget(impl->xml, "nm-openvpn-widget");
g_object_ref_sink (impl->widget);
impl->advanced = GTK_DIALOG (glade_xml_get_widget(impl->xml, "nm-openvpn-advanced-dialog"));
impl->w_connection_name = GTK_ENTRY (glade_xml_get_widget (impl->xml, "openvpn-connection-name"));
impl->w_remote = GTK_ENTRY (glade_xml_get_widget (impl->xml, "openvpn-remote"));
impl->w_port = GTK_ENTRY (glade_xml_get_widget (impl->xml, "openvpn-port"));
impl->w_use_routes = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-routes"));
impl->w_routes = GTK_ENTRY (glade_xml_get_widget (impl->xml, "openvpn-routes"));
impl->w_opt_info_expander = GTK_EXPANDER (glade_xml_get_widget (impl->xml,
"openvpn-optional-information-expander"));
impl->w_advanced_button = GTK_BUTTON (glade_xml_get_widget (impl->xml,
"openvpn-advanced-button"));
impl->w_import_button = GTK_BUTTON (glade_xml_get_widget (impl->xml,
"openvpn-import-button"));
@ -1669,10 +1694,6 @@ impl_get_object (void)
impl->w_button_cert = GTK_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-but-cert" ) );
impl->w_button_key = GTK_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-but-key" ) );
impl->w_use_lzo = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-lzo"));
impl->w_use_tap = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-tap"));
impl->w_use_tcp = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-tcp"));
impl->w_connection_type = GTK_COMBO_BOX (glade_xml_get_widget (impl->xml, "openvpn-connection-type"));
impl->w_settings_notebook = GTK_NOTEBOOK (glade_xml_get_widget (impl->xml, "openvpn-settings"));
@ -1694,18 +1715,6 @@ impl_get_object (void)
impl->w_button_x509userpass_cert = GTK_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-x509userpass-but-cert" ) );
impl->w_button_x509userpass_key = GTK_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-x509userpass-but-key" ) );
impl->w_use_cipher = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-cipher"));
impl->w_cipher = GTK_COMBO_BOX( glade_xml_get_widget( impl->xml, "openvpn-cipher" ) );
populate_cipher(impl->w_cipher);
impl->w_use_ta = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-ta"));
impl->w_ta = GTK_ENTRY( glade_xml_get_widget( impl->xml, "openvpn-ta" ) );
impl->w_button_ta = GTK_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-but-ta" ) );
impl->w_ta_dir_label = GTK_LABEL( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-label" ) );
impl->w_ta_dir_none = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-none" ) );
impl->w_ta_dir_zero = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-zero" ) );
impl->w_ta_dir_one = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-one" ) );
impl->callback = NULL;

View file

@ -212,7 +212,7 @@ main (int argc, char *argv[])
helper_failed (connection, "Tunnel Device");
/* IP address */
val = addr_to_gvalue (getenv ("ipconfig_local"));
val = addr_to_gvalue (getenv ("ifconfig_local"));
if (val)
g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, val);
else

View file

@ -99,6 +99,8 @@ static ValidProperty valid_properties[] = {
{ NM_OPENVPN_KEY_TA, G_TYPE_STRING },
{ NM_OPENVPN_KEY_TA_DIR, G_TYPE_STRING },
{ NM_OPENVPN_KEY_USERNAME, G_TYPE_STRING },
{ NM_OPENVPN_KEY_PASSWORD, G_TYPE_STRING },
{ NM_OPENVPN_KEY_CERTPASS, G_TYPE_STRING },
{ NULL, G_TYPE_NONE }
};
@ -386,7 +388,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin, GHashTable *properties
tmp = g_hash_table_lookup (properties, NM_OPENVPN_KEY_REMOTE);
if (tmp) {
g_ptr_array_add (openvpn_argv, (gpointer) "--remote");
g_ptr_array_add (openvpn_argv, tmp);
g_ptr_array_add (openvpn_argv, (gpointer) g_value_get_string ((GValue *) tmp));
}
tmp = g_hash_table_lookup (properties, NM_OPENVPN_KEY_COMP_LZO);
@ -635,7 +637,7 @@ real_connect (NMVPNPlugin *plugin,
NM_VPN_PLUGIN_ERROR,
NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
"%s",
"Could not start vpnc binary.");
"Could not start openvpn binary.");
goto out;
}