From a5292a6ef642fd3c6f4ac50c9cfecb74da51ffcd Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Fri, 21 May 2021 19:05:47 +0900 Subject: [PATCH] Remove access to avoid toctou problem Change-Id: I67a58159cc453ec7c60dd685663f7d03424af5d7 Signed-off-by: Suyeon Hwang --- engine-parser/src/stt-engine-parser.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/engine-parser/src/stt-engine-parser.c b/engine-parser/src/stt-engine-parser.c index 260f59f..6ecbbfc 100644 --- a/engine-parser/src/stt-engine-parser.c +++ b/engine-parser/src/stt-engine-parser.c @@ -300,11 +300,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) -- 2.7.4