vpn-provider: SetProperty and ClearProperty do not work if immutable
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Tue, 5 Mar 2013 14:06:22 +0000 (16:06 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 8 Mar 2013 11:09:35 +0000 (13:09 +0200)
Immutable VPN connection settings cannot be changed by SetProperty or
ClearProperty dbus API.

vpn/vpn-provider.c

index 7bb3d81..5dd18d6 100644 (file)
@@ -408,6 +408,9 @@ static DBusMessage *set_property(DBusConnection *conn, DBusMessage *msg,
 
        DBG("conn %p", conn);
 
+       if (provider->immutable == TRUE)
+               return __connman_error_not_supported(msg);
+
        if (dbus_message_iter_init(msg, &iter) == FALSE)
                return __connman_error_invalid_arguments(msg);
 
@@ -458,6 +461,9 @@ static DBusMessage *clear_property(DBusConnection *conn, DBusMessage *msg,
 
        DBG("conn %p", conn);
 
+       if (provider->immutable == TRUE)
+               return __connman_error_not_supported(msg);
+
        dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &name,
                                                        DBUS_TYPE_INVALID);