Modify select result file path to under /run/user/ 93/92493/1
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 17 Oct 2016 07:38:21 +0000 (16:38 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 17 Oct 2016 07:41:03 +0000 (16:41 +0900)
/tmp is cleared in runtime for some environment like TV

Change-Id: I6c603fcd04c9a28f50734c39315eb07071283299
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
packaging/data-control.spec
src/data-control-internal.h
src/data-control-sql.c

index 6dd85d2..2c73d88 100644 (file)
@@ -49,8 +49,6 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 rm -rf %{buildroot}
 
 %make_install
-mkdir -p %{buildroot}/tmp/datacontrol/request
-mkdir -p %{buildroot}/tmp/datacontrol/result
 mkdir -p %{buildroot}/usr/share/license
 install LICENSE.APLv2  %{buildroot}/usr/share/license/%{name}
 
index a1cdde6..56aa5be 100755 (executable)
@@ -53,9 +53,7 @@
 #define OSP_V_LAUNCH_TYPE_DATACONTROL  "datacontrol"
 #define OSP_V_VERSION_2_1_0_3  "ver_2.1.0.3"
 #define OSP_V_CALLER_TYPE_OSP  "osp"
-
-#define DATACONTROL_REQUEST_FILE_PREFIX "/tmp/data-control/datacontrol.request."
-#define DATACONTROL_RESULT_FILE_PREFIX  "/tmp/data-control/datacontrol.result."
+#define DATACONTROL_REQUEST_FILE_PREFIX "datacontrol.request."
 
 #define MAX_REQUEST_ARGUMENT_SIZE      1048576 /* 1MB */
 #define MAX_ROW_COUNT          1024
index 781e5e0..2312a28 100755 (executable)
@@ -376,7 +376,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, resultset_cursor *curso
        LOGI("req_id : %s", req_id);
        LOGI("SELECT RESPONSE");
 
-       size = snprintf(select_map_file, REQUEST_PATH_MAX, "%s%s%s", DATACONTROL_REQUEST_FILE_PREFIX,
+       size = snprintf(select_map_file, REQUEST_PATH_MAX, "/run/user/%d/%s%s%s", getuid(), DATACONTROL_REQUEST_FILE_PREFIX,
                        (char *)bundle_get_val(kb, AUL_K_CALLER_APPID), req_id);
        if (size < 0) {
                LOGE("unable to write formatted output to select_map_file. errno = %d", errno);