More OpenVPN stuff



Tim,

NM-OpenVPN 0.3 is working wonderfully, except for one slight issue - it
fails to remember the password, I have tracked this down to 2 issues:

1) The auth dialog is expecting 2 passwords in the keyring manager,
however only one is stored in the openvpn implementation

2) The gconf 'last_attempt_success' flag is never set to true. This is
due to the fact that it is only set via the login_banner dbus message,
however openvpn doesn't pass a login_banner in the IP4_CONFIG message. I
can't see an easy way of removing the dependancy on passing a
login_banner, perhaps someone else will be able to solve that.

Anyway, the attached patch will solve both those issues (the second
issue in a not very nice manner)

Crispin
? config.guess.cdbs-orig
? config.sub.cdbs-orig
? debian
Index: auth-dialog/main.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/vpn-daemons/openvpn/auth-dialog/main.c,v
retrieving revision 1.3
diff -u -8 -p -r1.3 main.c
--- auth-dialog/main.c	5 Dec 2005 22:34:18 -0000	1.3
+++ auth-dialog/main.c	6 Dec 2005 19:57:00 -0000
@@ -52,17 +52,17 @@ lookup_pass (const char *vpn_name, const
 						vpn_name,               /* server */
 						NULL,                   /* object */
 						vpn_service,            /* protocol */
 						NULL,                   /* authtype */
 						0,                      /* port */
 						&keyring_result) != GNOME_KEYRING_RESULT_OK)
     return FALSE;
 
-  if (keyring_result != NULL && g_list_length (keyring_result) == 2) {
+  if (keyring_result != NULL && g_list_length (keyring_result) == 1) {
     char *password;
     GnomeKeyringNetworkPasswordData *data1 = keyring_result->data;
 
     password = NULL;
 
     if (strcmp (data1->object, "password") == 0) {
       password = data1->password;
     }
Index: src/nm-openvpn-service.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/vpn-daemons/openvpn/src/nm-openvpn-service.c,v
retrieving revision 1.3
diff -u -8 -p -r1.3 nm-openvpn-service.c
--- src/nm-openvpn-service.c	5 Dec 2005 22:33:48 -0000	1.3
+++ src/nm-openvpn-service.c	6 Dec 2005 19:57:02 -0000
@@ -1169,16 +1169,17 @@ nm_openvpn_dbus_process_helper_ip4_confi
   guint32		ip4_address;
   guint32		ip4_netmask;
   guint32 *		ip4_dns;
   guint32		ip4_dns_len;
   guint32 *		ip4_nbns;
   guint32		ip4_nbns_len;
   gboolean		success = FALSE;
   char *                empty = "";
+  char *                login_banner = "Login succeeded";
 
   g_return_if_fail (data != NULL);
   g_return_if_fail (con != NULL);
   g_return_if_fail (message != NULL);
   
   /* Only accept the config info if we're in STARTING state */
   if (data->state != NM_VPN_STATE_STARTING)
     return;
@@ -1210,17 +1211,17 @@ nm_openvpn_dbus_process_helper_ip4_confi
 
       dbus_message_append_args (signal, DBUS_TYPE_UINT32, &ip4_vpn_gateway,
 				DBUS_TYPE_STRING, &tundev,
 				DBUS_TYPE_UINT32, &ip4_address,
 				DBUS_TYPE_UINT32, &ip4_netmask,
 				DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_dns, ip4_dns_len,
 				DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_nbns, ip4_nbns_len,
 				DBUS_TYPE_STRING, &empty,
-				DBUS_TYPE_STRING, &empty,
+				DBUS_TYPE_STRING, &login_banner,
 				DBUS_TYPE_INVALID);
 
       if (!dbus_connection_send (data->con, signal, NULL))
 	{
 	  nm_warning ("Could not raise the "NM_DBUS_VPN_SIGNAL_IP4_CONFIG" signal!");
 	  goto out;
 	}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]