2007-09-20 Dan Williams <dcbw@redhat.com>

* src/nm-device-802-11-wireless.c
	  src/nm-manager.c
	  src/nm-manager.h
		- Pass an NMDeviceInterface into nm_manager_get_connection_secrets()
			so that the device can be deactivated if secrets are wrong



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2830 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-09-20 11:25:47 +00:00
parent 174d339a34
commit 117cd4d076
4 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2007-09-20 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c
src/nm-manager.c
src/nm-manager.h
- Pass an NMDeviceInterface into nm_manager_get_connection_secrets()
so that the device can be deactivated if secrets are wrong
2007-09-20 Dan Williams <dcbw@redhat.com>
* introspection/nm-settings-connection.xml

View file

@ -2478,7 +2478,10 @@ real_act_stage2_config (NMDevice *dev)
iface, s_connection->name);
nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH);
nm_manager_get_connection_secrets (manager, connection, setting_name);
nm_manager_get_connection_secrets (manager,
NM_DEVICE_INTERFACE (self),
connection,
setting_name);
return NM_ACT_STAGE_RETURN_POSTPONE;
} else {
nm_info ("Activation (%s/wireless): connection '%s' has security"

View file

@ -1005,6 +1005,7 @@ nm_manager_update_connections (NMManager *manager,
typedef struct GetSecretsInfo {
NMManager *manager;
NMConnection *connection;
NMDeviceInterface *device;
char *setting_name;
} GetSecretsInfo;
@ -1016,6 +1017,7 @@ free_get_secrets_info (gpointer data)
g_free (info->setting_name);
if (info->connection)
g_object_unref (info->connection);
g_object_unref (info->device);
g_slice_free (GetSecretsInfo, info);
}
@ -1030,15 +1032,14 @@ get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
g_return_if_fail (info->manager);
g_return_if_fail (info->connection);
g_return_if_fail (info->setting_name);
g_return_if_fail (info->device);
if (!dbus_g_proxy_end_call (proxy, call, &err,
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &secrets,
G_TYPE_INVALID)) {
nm_warning ("Couldn't get connection secrets: %s.", err->message);
g_error_free (err);
// FIXME: do we need to propagate the error back up to the device?
// Otherwise device spins in the NEED_AUTH state until something
// kicks it or it gets a different activation
nm_device_interface_deactivate (info->device);
return;
}
@ -1054,6 +1055,7 @@ get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
void
nm_manager_get_connection_secrets (NMManager *manager,
NMDeviceInterface *device,
NMConnection *connection,
const char *setting_name)
{
@ -1083,6 +1085,7 @@ nm_manager_get_connection_secrets (NMManager *manager,
info->connection = g_object_ref (connection);
info->manager = manager;
info->device = g_object_ref (device);
if (!dbus_g_proxy_begin_call (proxy, "GetSecrets",
get_secrets_cb,

View file

@ -5,6 +5,7 @@
#include <glib-object.h>
#include <dbus/dbus-glib.h>
#include "nm-device.h"
#include "nm-device-interface.h"
#define NM_TYPE_MANAGER (nm_manager_get_type ())
#define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager))
@ -77,6 +78,7 @@ const char * nm_manager_get_connection_dbus_path (NMManager *manager,
NMConnection *connection);
void nm_manager_get_connection_secrets (NMManager *manager,
NMDeviceInterface *device,
NMConnection *connection,
const char * setting_name);