Remove access to avoid toctou problem 56/258656/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 11:14:29 +0000 (20:14 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 11:14:29 +0000 (20:14 +0900)
Change-Id: Ife99dd9f58a3f4fd8aee73a276bbd5703c39afec
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
engine-parser/src/vc-engine-parser.c

index 16aabc1dbeb2024b6a1c5bacd575459c64bfd078..66633751834f0d7a2960e2de9e4b19f842b5f6de 100644 (file)
@@ -301,11 +301,9 @@ static int __remove_engine_info_xml(const char *pkgid, gchar *ut, uid_t uid)
 
        char path[256] = {'\0',};
        snprintf(path, 256, "%s/%s.xml", dir_engine_info, pkgid);
-       if (0 == access(path, F_OK)) {
-               LOGD("Remove engine info xml(%s)", path);
-               if (0 != remove(path)) {
-                       LOGE("[ERROR] Fail to remove engine info xml(%s)", path);
-               }
+       LOGD("Remove engine info xml(%s)", path);
+       if (0 != remove(path)) {
+               LOGE("[ERROR] Fail to remove engine info xml(%s)", path);
        }
 
        FREE(dir_engine_info)