Name: app2sd
Summary: Application installation on external memory
-Version: 0.5
-Release: 9
+Version: 0.5.12
+Release: 1
Group: Application Framework/Application Installer
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
curr_size = _app2sd_calculate_file_size(app_path);
curr_size = (curr_size/1024)/1024;
- if (curr_size<=0) {
+ if (curr_size==0) {
app2ext_print
("App2SD Error: App Entry is not present in SD Card\n");
return APP2EXT_ERROR_LOOPBACK_DEVICE_UNAVAILABLE;
return ret;
}
+#if 0
/**
* Reserved API for forced cleanup
*
}
return ret;
}
+#endif
/* This is the plug-in load function. The plugin has to bind its functions to function pointers of handle
@param[in/out] st_interface Specifies the storage interface.
char delims[] = ":";
char *result = NULL;
char app_path[FILENAME_MAX] = { '\0' };
-
+ char dev[FILENAME_MAX] = {0,};
+ char *devnode = NULL;
snprintf(app_path, FILENAME_MAX, "%s%s", APP2SD_PATH,
pkgid);
result = (char *)_app2sd_find_associated_device(app_path);
return NULL;
}
/*process the string*/
- if (strstr(result, "/dev") == NULL) {
+ snprintf(dev, FILENAME_MAX-1, "%s", result);
+ if (strstr(dev, "/dev") == NULL) {
app2ext_print
("App2SD Error! Unable to find the associated File\n");
+
+ free(result);
return NULL;
} else {
- ret_result = strtok(result, delims);
+ ret_result = strtok(dev, delims);
+ if (ret_result)
+ devnode = strdup(ret_result);
}
-
- return ret_result;
-
+ free(result);
+ return devnode;
}
char *_app2sd_create_loopdevice_node(void)
app2ext_print("Device node candidate is %s \n", dev_path);
dev_t dev_node;
dev_node = makedev(DEV_MAJOR, count);
- if ((ret = mknod(dev_path, S_IFBLK | mode, dev_node)) < 0) {
+ ret = mknod(dev_path, S_IFBLK | mode, dev_node);
+ if (ret < 0) {
app2ext_print
("Error while creating the device node: errno is %d\n",
errno);
int ret = 0;
char *device_node = NULL;
char *old_device_node = NULL;
- char *result = NULL;
int err_res = 0;
char app_mmc_path[FILENAME_MAX] = { 0, };
char app_archive_path[FILENAME_MAX] = { 0, };
}
/*
- *@_app2sd_access_password_from_db
- *This function is to find out whther password exists for an application.
- * param[in]: pkgid: package id
- * return: On success, it will return zero , else value<0 if fail.
- */
-int _app2sd_access_password_from_db(const char *pkgid)
-{
- char query[MAX_QUERY_LEN] = { 0 };
- int access_flag = 0;
- int i;
- sqlite3_stmt *stmt = NULL;
- const char *tail = NULL;
-
- snprintf(query, MAX_QUERY_LEN,
- "select * from app2sd where pkgid LIKE '%s'", pkgid);
- app2ext_print("\n access querys is %s ", query);
-
- if (SQLITE_OK != sqlite3_prepare(app2sd_db, query,
- strlen(query), &stmt, &tail)) {
- app2ext_print("sqlite3_prepare error\n");
- return -1;
- }
- for (i = 0; SQLITE_ROW == sqlite3_step(stmt); i++) {
- app2ext_print("\n entry available in sqlite");
- access_flag = 1;
-
- }
- if (SQLITE_OK != sqlite3_finalize(stmt)) {
- app2ext_print("error : sqlite3_finalize\n");
- return -1;
- }
- if (access_flag == 1) {
- app2ext_print("\n app2sd value is accessible ");
- return APP2EXT_SUCCESS;
- } else {
- app2ext_print("\n app2sd value is not accessible ");
- return -1;
- }
-}
-
-/*
*@_app2sd_get_password_from_db
*This function is to retrive password from DB
* param[in]: pkgid: package id
close(1);
close(2);
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
if (execvp(argv[0], (char *const *)argv) < 0) {
fprintf(stderr, "execvp failed %d....%s\n", errno, strerror(errno)); /*Don't use d_msg_app2sd */
}
/* parent */
close(my_pipe[1]);
result = read(my_pipe[0], buf, FILENAME_MAX);
+ if (result < 0)
+ fprintf(stderr, "read failed %d....%s\n", errno, strerror(errno));
break;
}
close(1);
close(2);
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
if (execvp(argv[0], (char *const *)argv) < 0) {
fprintf(stderr, "execvp failed\n"); /*Don't use d_msg_app2sd */
}
/* parent */
close(my_pipe[1]);
result = read(my_pipe[0], buf, FILENAME_MAX);
+ if (result < 0)
+ fprintf(stderr, "read failed %d....%s\n", errno, strerror(errno));
break;
}
close(1);
close(2);
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
if (execvp(argv[0], (char *const *)argv) < 0) {
fprintf(stderr, "execvp failed\n"); /*Don't use d_msg_app2sd */
}
/* parent */
close(my_pipe[1]);
result = read(my_pipe[0], buf, FILENAME_MAX);
+ if (result < 0)
+ fprintf(stderr, "read failed %d....%s\n", errno, strerror(errno));
break;
}
close(1);
close(2);
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
result = dup(my_pipe[1]);
+ if (result < 0) {
+ fprintf(stderr, "dup failed %d....%s\n", errno, strerror(errno));
+ _exit(-1);
+ }
if (execvp(argv[0], (char *const *)argv) < 0) {
fprintf(stderr, "execvp failed\n"); /*Don't use d_msg_app2sd */
}
/* parent */
close(my_pipe[1]);
result = read(my_pipe[0], buf, FILENAME_MAX);
+ if (result < 0)
+ fprintf(stderr, "read failed %d....%s\n", errno, strerror(errno));
break;
}