checksum = g_checksum_new(G_CHECKSUM_MD5);
g_checksum_update(checksum, (const guchar *)source_name, strlen(source_name));
temp_string = (char *)g_checksum_get_string(checksum);
- _D("temp_string(%s)", temp_string);
new_name = strdup(temp_string);
g_checksum_free(checksum);
- _D("new_name(%s)", new_name);
-
return new_name;
}
#if !defined(TIZEN_FEATURE_APP2SD_DMCRYPT_ENCRYPTION)
char *devi = NULL;
#endif
- char *result = NULL;
char application_path[FILENAME_MAX] = { 0, };
char loopback_device[FILENAME_MAX] = { 0, };
char *encoded_id = NULL;
return ret;
}
- /* check same loopback_device existence */
- result = (char *)_app2sd_find_associated_device(loopback_device);
- if (result != NULL) {
- _E("there is same associated File (%s)", loopback_device);
- return APP2EXT_ERROR_SAME_LOOPBACK_DEVICE_EXISTS;
- }
-
/* create a loopback device */
ret = _app2sd_create_loopback_device(pkgid, loopback_device,
(reqd_disk_size + PKG_BUF_SIZE));
{
char *device_name = NULL;
char application_path[FILENAME_MAX] = { 0, };
+ char application_mmc_path[FILENAME_MAX] = { 0, };
char loopback_device[FILENAME_MAX] = { 0, };
char *encoded_id = NULL;
int ret = APP2EXT_SUCCESS;
tzplatform_reset_user();
}
free(encoded_id);
+ snprintf(application_mmc_path, FILENAME_MAX - 1, "%s/.mmc",
+ application_path);
/* get the associated device node for SD card applicationer */
#ifdef TIZEN_FEATURE_APP2SD_DMCRYPT_ENCRYPTION
if (ret)
_E("unable to delete info");
- ret = _app2sd_delete_directory(application_path);
+ ret = _app2sd_delete_directory(application_mmc_path);
if (ret)
_E("unable to delete the directory (%s)", application_path);
} else {
int app2sd_usr_post_app_uninstall(const char *pkgid, uid_t uid)
{
char application_path[FILENAME_MAX] = { 0, };
+ char application_mmc_path[FILENAME_MAX] = { 0, };
char loopback_device[FILENAME_MAX] = { 0, };
char *encoded_id = NULL;
int ret = APP2EXT_SUCCESS;
tzplatform_reset_user();
}
free(encoded_id);
+ snprintf(application_mmc_path, FILENAME_MAX - 1, "%s/.mmc",
+ application_path);
/* unmount the loopback encrypted pseudo device from
* the application installation path
goto END;
}
- ret = _app2sd_delete_directory(application_path);
+ ret = _app2sd_delete_directory(application_mmc_path);
if (ret) {
_E("unable to delete the directory (%s)",
application_path);
ret = _app2sd_delete_directory(path);
if (ret) {
- _E("unable to delete (%s)", path);
+ _E("unable to delete (%s), errno(%d)", path, errno);
return APP2EXT_ERROR_DELETE_DIRECTORY;
}
pkgid, dir_list, uid);
}
- /* change lost+found permission */
- snprintf(temp_path, FILENAME_MAX - 1, "%s/lost+found",
- application_mmc_path);
- ret = _app2sd_make_directory(temp_path, uid);
- if (ret) {
- _E("create directory(%s) failed", temp_path);
- return APP2EXT_ERROR_CREATE_DIRECTORY;
+ if (mount_type != MOUNT_TYPE_RD &&
+ mount_type != MOUNT_TYPE_RD_REMOUNT) {
+ /* change lost+found permission */
+ snprintf(temp_path, FILENAME_MAX - 1, "%s/lost+found",
+ application_mmc_path);
+ ret = _app2sd_make_directory(temp_path, uid);
+ if (ret) {
+ _E("create directory(%s) failed", temp_path);
+ return APP2EXT_ERROR_CREATE_DIRECTORY;
+ }
}
return ret;
#define APP2SD_DB_FILE tzplatform_mkpath(TZ_SYS_DB, ".app2sd.db")
sqlite3 *app2sd_db;
#define QUERY_CREATE_TABLE_APP2SD "CREATE TABLE IF NOT EXISTS app2sd_info " \
- "(pkgid TEXT PRIMARY KEY NOT NULL, password TEXT NOT NULL, " \
- "filename TEXT NOT NULL, uid INTEGER)"
+ "(pkgid TEXT NOT NULL, password TEXT NOT NULL, " \
+ "filename TEXT NOT NULL, uid INTEGER, PRIMARY KEY(pkgid, uid))"
int _app2sd_initialize_db()
{