return -EPERM;
}
+ if (!block_control) {
+ if (!mapper && strncmp(data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
+ _D("Block module is disabled");
+ free_block_data(data);
+ return -EPERM;
+ }
+
+ }
+
bdev = make_block_device(data);
if (!bdev) {
_E("fail to make block device for %s", devnode);
do {
pthread_mutex_lock(&(th_manager[i].mutex));
DD_LIST_FOREACH_SAFE(th_manager[i].block_dev_list, elem, next, bdev) {
+ if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV ||
+ !strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME)))
+ continue;
if (bdev->removed == false)
break;
}
if (ret < 0)
_E("fail to register block uevent : %d", ret);
+ block_control = true;
/* if there is the attached device, try to mount */
block_init_from_udev_enumerate();
- block_control = true;
block_boot = true;
}
int id;
int ret = -EBADMSG;
+ if (!block_control) {
+ _D("Block module is disabled");
+ ret = -EPERM;
+ goto out;
+ }
+
if (!reply_handle || !msg)
goto out;
ret = -ENOENT;
goto out;
}
+
+ if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV ||
+ !strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
+ _D("Mount dbus request for extended internal storage is blocked");
+ ret = -EPERM;
+ goto out;
+ }
+
if (bdev->on_private_op != REQ_NORMAL) {
ret = -EPERM;
goto out;
int id;
int ret = -EBADMSG;
+ if (!block_control) {
+ _D("Block module is disabled");
+ ret = -EPERM;
+ goto out;
+ }
+
if (!reply_handle || !msg)
goto out;
goto out;
}
+ /* Unmount dbus call is needed when app proceeds extended internal -> portable storage */
+ if (!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
+ _D("Unmount dbus request for extended internal storage is blocked");
+ ret = -EPERM;
+ goto out;
+ }
+
if (onprivate) {
pid = get_dbus_method_sender_pid(reply_handle);
if (bdev->on_private_op == REQ_NORMAL || (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid)) {
int ret = -EBADMSG;
int prev_state;
+ if (!block_control) {
+ _D("Block module is disabled");
+ ret = -EPERM;
+ goto out;
+ }
+
if (!reply_handle || !msg)
goto out;
goto out;
}
+ if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV ||
+ !strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
+ _D("Format dbus request for extended internal storage is blocked");
+ ret = -EPERM;
+ goto out;
+ }
+
pid = get_dbus_method_sender_pid(reply_handle);
if (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid) {
_E("Failed to format on private state");
int ret = -EBADMSG;
int prev_state;
+ if (!block_control) {
+ _D("Block module is disabled");
+ ret = -EPERM;
+ goto out;
+ }
+
if (!reply_handle || !msg)
goto out;
goto out;
}
+ /* FormatwithType dbus call is needed when app proceeds extended internal -> portable storage */
+ if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV) {
+ _D("FormatwithType dbus request for extended internal storage is blocked");
+ ret = -EPERM;
+ goto out;
+ }
+
pid = get_dbus_method_sender_pid(reply_handle);
if (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid) {
_E("Failed to format on private state");
static int block_start(void *data)
{
- int ret;
-
if (!block_boot) {
_E("Cannot be started. Booting is not ready");
return -ENODEV;
return 0;
}
- /* register mmc uevent control routine */
- ret = register_udev_uevent_control(&uh);
- if (ret < 0)
- _E("fail to register block uevent : %d", ret);
+ block_control = true;
block_init_from_udev_enumerate();
- block_control = true;
-
_I("start");
return 0;
}
return 0;
}
- /* unregister mmc uevent control routine */
- unregister_udev_uevent_control(&uh);
-
/* remove the existing blocks */
remove_whole_block_device();