service: User cannot modify immutable service
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Tue, 12 Mar 2013 14:41:59 +0000 (16:41 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 14 Mar 2013 18:29:30 +0000 (11:29 -0700)
If the service is provisioned via .config file, then user is only
able to set the AutoConnect status of the service. All the other
settings must be set from the .config file.

Fixes BMC#25984

src/service.c

index 53a839c..e0bf409 100644 (file)
@@ -3099,6 +3099,9 @@ static DBusMessage *set_property(DBusConnection *conn,
                int index;
                const char *gw;
 
+               if (service->immutable == TRUE)
+                       return __connman_error_not_supported(msg);
+
                if (type != DBUS_TYPE_ARRAY)
                        return __connman_error_invalid_arguments(msg);
 
@@ -3162,6 +3165,9 @@ static DBusMessage *set_property(DBusConnection *conn,
                GSList *list = NULL;
                int count = 0;
 
+               if (service->immutable == TRUE)
+                       return __connman_error_not_supported(msg);
+
                if (type != DBUS_TYPE_ARRAY)
                        return __connman_error_invalid_arguments(msg);
 
@@ -3203,6 +3209,9 @@ static DBusMessage *set_property(DBusConnection *conn,
                DBusMessageIter entry;
                GString *str;
 
+               if (service->immutable == TRUE)
+                       return __connman_error_not_supported(msg);
+
                if (type != DBUS_TYPE_ARRAY)
                        return __connman_error_invalid_arguments(msg);
 
@@ -3239,6 +3248,9 @@ static DBusMessage *set_property(DBusConnection *conn,
        } else if (g_str_equal(name, "Proxy.Configuration") == TRUE) {
                int err;
 
+               if (service->immutable == TRUE)
+                       return __connman_error_not_supported(msg);
+
                if (type != DBUS_TYPE_ARRAY)
                        return __connman_error_invalid_arguments(msg);
 
@@ -3261,6 +3273,9 @@ static DBusMessage *set_property(DBusConnection *conn,
                        CONNMAN_IPCONFIG_TYPE_UNKNOWN;
                int err = 0;
 
+               if (service->immutable == TRUE)
+                       return __connman_error_not_supported(msg);
+
                DBG("%s", name);
 
                if (service->ipconfig_ipv4 == NULL &&