From 75970f6e60689bccb502f0977a482b8a9233bae1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 5 Apr 2009 19:19:07 +0200 Subject: [PATCH] Add error checking for service methods --- src/profile.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/profile.c b/src/profile.c index ce26c7a..86b78f1 100644 --- a/src/profile.c +++ b/src/profile.c @@ -146,12 +146,22 @@ static DBusMessage *get_properties(DBusConnection *conn, static DBusMessage *connect_service(DBusConnection *conn, DBusMessage *msg, void *data) { + struct connman_group *group = data; + + if (group->type == CONNMAN_SERVICE_TYPE_ETHERNET) + return __connman_error_not_supported(msg); + return __connman_error_not_implemented(msg); } static DBusMessage *disconnect_service(DBusConnection *conn, DBusMessage *msg, void *data) { + struct connman_group *group = data; + + if (group->type == CONNMAN_SERVICE_TYPE_ETHERNET) + return __connman_error_not_supported(msg); + return __connman_error_not_implemented(msg); } @@ -160,6 +170,9 @@ static DBusMessage *remove_service(DBusConnection *conn, { struct connman_group *group = data; + if (group->type == CONNMAN_SERVICE_TYPE_ETHERNET) + return __connman_error_not_supported(msg); + group->favorite = FALSE; return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); @@ -168,12 +181,22 @@ static DBusMessage *remove_service(DBusConnection *conn, static DBusMessage *move_before(DBusConnection *conn, DBusMessage *msg, void *data) { + struct connman_group *group = data; + + if (group->favorite == FALSE) + return __connman_error_not_supported(msg); + return __connman_error_not_implemented(msg); } static DBusMessage *move_after(DBusConnection *conn, DBusMessage *msg, void *data) { + struct connman_group *group = data; + + if (group->favorite == FALSE) + return __connman_error_not_supported(msg); + return __connman_error_not_implemented(msg); } -- 2.7.4