PATH_GROUP_RW,
PATH_PUBLIC_RO,
PATH_SETTINGS_RW,
+ PATH_NPRUNTIME,
PATH_ANY_LABEL
};
}
}
+ usleep(200 * 1000); /* 200ms sleep*/
+ app2ext_print ("App2Sd info : give a delay for mount\n");
+
switch (mount_type) {
case MOUNT_TYPE_RD:
{
if (ret) {
app2ext_print("App2Sd Error : Re-mount failed\n");
err_res = APP2EXT_ERROR_MOUNT_PATH;
- goto FINISH_OFF;
+// goto FINISH_OFF;
}
} else {
/*Do re-mounting */
if (ret) {
app2ext_print("App2Sd Error : Re-mount failed\n");
err_res = APP2EXT_ERROR_MOUNT_PATH;
- goto FINISH_OFF;
+// goto FINISH_OFF;
}
}
if (ret) {
app2ext_print("App2Sd Error : copy ro content failed\n");
err_res = ret;
- goto FINISH_OFF;
+// goto FINISH_OFF;
}
ret = _app2sd_unmount_app_content(pkgid);
app2ext_print
("App2SD Error: Unable to unmount the SD application\n");
err_res = APP2EXT_ERROR_UNMOUNT;
- goto FINISH_OFF;
+// goto FINISH_OFF;
}
ret = _app2sd_remove_loopback_encryption_setup(pkgid);
if (ret) {
app2ext_print("App2SD Error: Unable to remove loopback setup\n");
err_res = APP2EXT_ERROR_DELETE_LOOPBACK_DEVICE;
- goto FINISH_OFF;
+// goto FINISH_OFF;
}
ret = _app2sd_unmount_app_content(temp_pkgid);
if (ret) {
}
return err_res;
}
+
+void _app2sd_make_result_info_file(char *pkgid, int size)
+{
+ int ret = 0;
+ FILE* file = NULL;
+ int fd = 0;
+ char buf[FILENAME_MAX] = {0};
+ const char* app_info_label = "*";
+ char info_file[FILENAME_MAX] = {'\0', };
+
+ if(pkgid == NULL)
+ return;
+
+ snprintf(info_file, FILENAME_MAX, "/tmp/%s", pkgid);
+ app2ext_print("App2SD info : File path = %s\n", info_file);
+
+ file = fopen(info_file, "w");
+ if (file == NULL) {
+ app2ext_print("App2SD Error: Couldn't open the file %s \n", info_file);
+ return;
+ }
+
+ snprintf(buf, 128, "%d\n", size);
+ fwrite(buf, 1, strlen(buf), file);
+
+ fflush(file);
+ fd = fileno(file);
+ fsync(fd);
+ fclose(file);
+
+ if(lsetxattr(info_file, "security.SMACK64", app_info_label, strlen(app_info_label), 0)) {
+ app2ext_print("App2SD Error: error(%d) in setting smack label",errno);
+ }
+ ret = chmod(info_file, 0777);
+ if (ret == -1) {
+ return;
+ }
+
+ ret = chown(info_file, 5000, 5000);
+ if (ret == -1) {
+ return;
+ }
+}