From: Sangyoon Jang Date: Fri, 10 Jul 2015 02:03:31 +0000 (+0900) Subject: Fix tmp file path, permissions X-Git-Tag: accepted/tizen/mobile/20150710.080404^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bb9e02b99ddc5767fc64a4ba3e92f037364d0f5;p=platform%2Fcore%2Fappfw%2Fdata-control.git Fix tmp file path, permissions Change-Id: Ic604f90837c27a069ade74c5ca8383ad76ea17ce Signed-off-by: Sangyoon Jang --- diff --git a/src/data-control-map.c b/src/data-control-map.c index 701f4c7..70c7411 100644 --- a/src/data-control-map.c +++ b/src/data-control-map.c @@ -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); diff --git a/src/data-control-provider.c b/src/data-control-provider.c index e419424..4c71e8d 100644 --- a/src/data-control-provider.c +++ b/src/data-control-provider.c @@ -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); diff --git a/src/data-control-sql-cursor.c b/src/data-control-sql-cursor.c index 80b1471..f09aa34 100644 --- a/src/data-control-sql-cursor.c +++ b/src/data-control-sql-cursor.c @@ -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); diff --git a/src/data-control-sql.c b/src/data-control-sql.c index ba17216..35a4ac0 100644 --- a/src/data-control-sql.c +++ b/src/data-control-sql.c @@ -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);