fix svace issue (TOCTTOU_SEQUENCE) 56/61656/2 accepted/tizen/common/20160311.201142 accepted/tizen/ivi/20160311.054323 accepted/tizen/mobile/20160311.054230 accepted/tizen/tv/20160311.054250 accepted/tizen/wearable/20160311.054309 submit/tizen/20160310.052028
authorHyihong Chae <hh.chae@samsung.com>
Wed, 9 Mar 2016 10:46:02 +0000 (19:46 +0900)
committerHyihong Chae <hh.chae@samsung.com>
Wed, 9 Mar 2016 10:47:58 +0000 (02:47 -0800)
Change-Id: I06b8d3775c85da8f3e4eaddcee95ad796d2d7f6d
Signed-off-by: HyiHong Chae <hh.chae@samsung.com>
packaging/mtp-initiator.spec
src/daemon/mtp_daemon_gdbus_manager.c

index 0c72633e2b5e22566f60d17138a4b24ba469a4f3..5ec678416141588450348bf21494580c11698806 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       mtp-initiator
 Summary:    mtp(media transfer protocol) initiator
-Version:    1.4.6
+Version:    1.4.7
 Release:    1
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index f1e5dab54af2849a172f8efaad0d9ab0df5a4520..d92e92cce723969a2b3c92fd3540a6abf580746a 100755 (executable)
@@ -301,14 +301,10 @@ static void __manager_get_object_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
                MTP_LOGI("device_id: %d, device: %p, dest_path: %s", device_id, device, dest_path);
 
-               /* file open */
-               if (access(dest_path, F_OK) >= 0) {
-                       MTP_LOGE("file exist - dest_path: %s", dest_path);
-
-                       if (unlink(dest_path) < 0)
-                               MTP_LOGE("remove fail - dest_path: %s", dest_path);
-               }
+               /* file remove */
+               unlink(dest_path);
 
+               /* file open */
                fd = open(dest_path, O_WRONLY | O_CREAT | O_EXCL, 0644);
 
                if (fd < 0) {
@@ -375,14 +371,10 @@ static void __manager_get_thumbnail_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
                MTP_LOGI("device_id: %d, device: %p, dest_path: %s", device_id, device, dest_path);
 
-               /* file open */
-               if (access(dest_path, F_OK) >= 0) {
-                       MTP_LOGE("file exist - dest_path: %s", dest_path);
-
-                       if (unlink(dest_path) < 0)
-                               MTP_LOGE("remove fail - dest_path: %s", dest_path);
-               }
+               /* file remove */
+               unlink(dest_path);
 
+               /* file open */
                fd = open(dest_path, O_WRONLY | O_CREAT | O_EXCL, 0644);
 
                if (fd < 0) {