Fix tmp file path, permissions 25/43525/2 accepted/tizen/mobile/20150710.080404 accepted/tizen/tv/20150710.080416 accepted/tizen/wearable/20150710.080432 submit/tizen/20150710.070244
authorSangyoon Jang <s89.jang@samsung.com>
Fri, 10 Jul 2015 02:03:31 +0000 (11:03 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Fri, 10 Jul 2015 03:11:53 +0000 (12:11 +0900)
Change-Id: Ic604f90837c27a069ade74c5ca8383ad76ea17ce
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/data-control-map.c
src/data-control-provider.c
src/data-control-sql-cursor.c
src/data-control-sql.c

index 701f4c7..70c7411 100644 (file)
@@ -163,7 +163,7 @@ datacontrol_map_get_value_list(const char *path, int count)
 
        SECURE_LOGI("The result file of GET: %s", path);
        /* TODO - shoud be changed to solve security concerns */
-       fd = open(path, O_RDONLY, 644);
+       fd = open(path, O_RDONLY, 0644);
        if (fd == -1)
        {
                SECURE_LOGE("unable to open update_map file: %d", errno);
index e419424..4c71e8d 100644 (file)
@@ -122,7 +122,7 @@ __get_data_sql(const char *path, int column_count)
        SECURE_LOGI("The request file of INSERT/UPDATE: %s", path);
 
        /* TODO - shoud be changed to solve security concerns */
-       fd = open(path, O_RDONLY, 644);
+       fd = open(path, O_RDONLY, 0644);
        if (fd == -1) {
                SECURE_LOGE("unable to open insert_map file: %d", errno);
                return b;
@@ -233,7 +233,7 @@ __set_select_result(bundle* b, const char* path, void* data)
        client_pkgid = __get_client_pkgid(b);
 
        /* TODO - shoud be changed to solve security concerns */
-       fd = open(path, O_WRONLY | O_CREAT, 644);
+       fd = open(path, O_WRONLY | O_CREAT, 0644);
        if (fd == -1) {
                SECURE_LOGE("unable to open insert_map file: %d", errno);
                free(client_pkgid);
@@ -427,7 +427,7 @@ __set_get_value_result(bundle *b, const char* path, char **value_list)
 
        client_pkgid = __get_client_pkgid(b);
        /* TODO - shoud be changed to solve security concerns */
-       fd = open(path, O_WRONLY | O_CREAT, 644);
+       fd = open(path, O_WRONLY | O_CREAT, 0644);
        if (fd == -1) {
                SECURE_LOGE("unable to open insert_map file: %d", errno);
                free(client_pkgid);
@@ -467,7 +467,7 @@ __get_result_file_path(bundle *b)
        const char *caller_req_id = bundle_get_val(b, OSP_K_REQUEST_ID);
 
        char *result_path = calloc(RESULT_PATH_MAX, sizeof(char));
-       snprintf(result_path, RESULT_PATH_MAX, "%s/%s_%s", DATACONTROL_RESULT_FILE_PREFIX, caller, caller_req_id);
+       snprintf(result_path, RESULT_PATH_MAX, "%s%s%s", DATACONTROL_RESULT_FILE_PREFIX, caller, caller_req_id);
 
        SECURE_LOGI("result file path: %s", result_path);
 
index 80b1471..f09aa34 100644 (file)
@@ -33,7 +33,7 @@ resultset_cursor* datacontrol_sql_get_cursor(const char * path)
        cursor->resultset_current_offset = 0;
        cursor->resultset_current_row_count = 0;
        /* TODO - shoud be changed to solve security concerns */
-       cursor->resultset_fd = open(path, O_RDONLY, 644);
+       cursor->resultset_fd = open(path, O_RDONLY, 0644);
        if (cursor->resultset_fd == -1)
        {
                SECURE_LOGE("unable to open resultset file(%s): %d", path, errno);
index ba17216..35a4ac0 100644 (file)
@@ -846,7 +846,7 @@ datacontrol_sql_insert(datacontrol_h provider, const bundle* insert_data, int *r
        char *provider_pkgid = __get_provider_pkgid(provider->provider_id);
 
        /* TODO - shoud be changed to solve security concerns */
-       fd = open(insert_map_file, O_WRONLY | O_CREAT, 644);
+       fd = open(insert_map_file, O_WRONLY | O_CREAT, 0644);
        if (fd == -1) {
                SECURE_LOGE("unable to open insert_map file: %d", errno);
                free(provider_pkgid);
@@ -1116,7 +1116,7 @@ datacontrol_sql_update(datacontrol_h provider, const bundle* update_data, const
        char *provider_pkgid = __get_provider_pkgid(provider->provider_id);
 
        /* TODO - shoud be changed to solve security concerns */
-       fd = open(update_map_file, O_WRONLY | O_CREAT, 644);
+       fd = open(update_map_file, O_WRONLY | O_CREAT, 0644);
        if (fd == -1)
        {
                SECURE_LOGE("unable to open update_map file: %d", errno);