summaryrefslogtreecommitdiff
path: root/src/agent.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-05-03 15:15:57 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-04 11:09:42 +0300
commit0e3a21069677342e6096441c78f2b6b2ab368a16 (patch)
tree9dc7cd93841ff037e60b9b000f6f19447d7ec7b4 /src/agent.c
parent81bd485cabb6068839f33411b59e17726ee16121 (diff)
downloadconnman-0e3a21069677342e6096441c78f2b6b2ab368a16.tar.gz
connman-0e3a21069677342e6096441c78f2b6b2ab368a16.tar.bz2
connman-0e3a21069677342e6096441c78f2b6b2ab368a16.zip
agent: Adding a parameter to give the error name to authentication callback
Diffstat (limited to 'src/agent.c')
-rw-r--r--src/agent.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/agent.c b/src/agent.c
index 511049bd..96d40caa 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -96,6 +96,7 @@ static void request_input_passphrase_reply(DBusPendingCall *call, void *user_dat
struct request_input_reply *passphrase_reply = user_data;
connman_bool_t values_received = FALSE;
connman_bool_t wps = FALSE;
+ const char *error = NULL;
char *identity = NULL;
char *passphrase = NULL;
char *wpspin = NULL;
@@ -105,8 +106,10 @@ static void request_input_passphrase_reply(DBusPendingCall *call, void *user_dat
DBusMessageIter iter, dict;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
- if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
+ if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
+ error = dbus_message_get_error_name(reply);
goto done;
+ }
values_received = TRUE;
@@ -176,7 +179,7 @@ done:
passphrase_reply->callback(passphrase_reply->service, values_received,
name, name_len,
identity, passphrase,
- wps, wpspin,
+ wps, wpspin, error,
passphrase_reply->user_data);
connman_service_unref(passphrase_reply->service);
dbus_message_unref(reply);
@@ -311,14 +314,17 @@ static void request_input_append_password(DBusMessageIter *iter,
static void request_input_login_reply(DBusPendingCall *call, void *user_data)
{
struct request_input_reply *username_password_reply = user_data;
+ const char *error = NULL;
char *username = NULL;
char *password = NULL;
char *key;
DBusMessageIter iter, dict;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
- if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
+ if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
+ error = dbus_message_get_error_name(reply);
goto done;
+ }
dbus_message_iter_init(reply, &iter);
dbus_message_iter_recurse(&iter, &dict);
@@ -355,7 +361,7 @@ done:
username_password_reply->callback(username_password_reply->service,
TRUE, NULL, 0,
username, password,
- FALSE, NULL,
+ FALSE, NULL, error,
username_password_reply->user_data);
connman_service_unref(username_password_reply->service);
dbus_message_unref(reply);