{
DBusMessageIter iter, value;
const char *name;
+ int type;
DBG("conn %p", conn);
CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0)
return __connman_error_permission_denied(msg);
+ type = dbus_message_iter_get_arg_type(&value);
+
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
struct connman_device *device = data;
DBusMessageIter iter, value;
const char *name;
+ int type;
DBG("conn %p", conn);
CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0)
return __connman_error_permission_denied(msg);
+ type = dbus_message_iter_get_arg_type(&value);
+
if (g_str_equal(name, "Powered") == TRUE) {
connman_bool_t powered;
int err;
+ if (type != DBUS_TYPE_BOOLEAN)
+ return __connman_error_invalid_arguments(msg);
+
dbus_message_iter_get_basic(&value, &powered);
if (device->powered == powered)
const char *str;
int err;
+ if (type != DBUS_TYPE_STRING)
+ return __connman_error_invalid_arguments(msg);
+
dbus_message_iter_get_basic(&value, &str);
policy = string2policy(str);
if (policy == CONNMAN_DEVICE_POLICY_UNKNOWN)
} else if (g_str_equal(name, "Priority") == TRUE) {
connman_uint8_t priority;
+ if (type != DBUS_TYPE_BYTE)
+ return __connman_error_invalid_arguments(msg);
+
dbus_message_iter_get_basic(&value, &priority);
device->priority = priority;
struct connman_network *network = data;
DBusMessageIter iter, value;
const char *name;
+ int type;
DBG("conn %p", conn);
CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0)
return __connman_error_permission_denied(msg);
+ type = dbus_message_iter_get_arg_type(&value);
+
if (g_str_equal(name, "Remember") == TRUE) {
connman_bool_t remember;
+ if (type != DBUS_TYPE_BOOLEAN)
+ return __connman_error_invalid_arguments(msg);
+
dbus_message_iter_get_basic(&value, &remember);
if (network->remember == remember)
} else if (g_str_equal(name, "WiFi.Passphrase") == TRUE) {
const char *passphrase;
+ if (type != DBUS_TYPE_STRING)
+ return __connman_error_invalid_arguments(msg);
+
if (__connman_security_check_privilege(msg,
CONNMAN_SECURITY_PRIVILEGE_SECRET) < 0)
return __connman_error_permission_denied(msg);
} else if (g_str_equal(name, "Priority") == TRUE) {
connman_uint8_t priority;
+ if (type != DBUS_TYPE_BYTE)
+ return __connman_error_invalid_arguments(msg);
+
dbus_message_iter_get_basic(&value, &priority);
network->priority = priority;