replace stat to lstat in alarm_manager_alarm_set_timezone
authorJiwoong Im <jiwoong.im@samsung.com>
Mon, 23 Jan 2017 09:01:54 +0000 (18:01 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Mon, 23 Jan 2017 09:01:54 +0000 (18:01 +0900)
- To check the link itself, user lstat instead of stat

Change-Id: I55d51621721b56ec4d442371bd635cdb0d9ffd20
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
alarm-manager.c

index 5c7a00f..f5b9774 100644 (file)
@@ -2525,13 +2525,13 @@ gboolean alarm_manager_alarm_set_timezone(AlarmManager *pObject, GDBusMethodInvo
 
        ALARM_MGR_LOG_PRINT("[TIMESTAMP]Set the timezone to %s.", tzpath_str);
 
-       if (stat(tzpath_str, &statbuf) == -1 && errno == ENOENT) {
+       if (lstat(tzpath_str, &statbuf) == -1 && errno == ENOENT) {
                ALARM_MGR_EXCEPTION_PRINT("Invalid tzpath, %s", tzpath_str);
                return_code = ERR_ALARM_INVALID_PARAM;
                goto done;
        }
 
-       retval = stat(TIMEZONE_INFO_LINK_PATH, &statbuf);
+       retval = lstat(TIMEZONE_INFO_LINK_PATH, &statbuf);
        if (retval == 0 || (retval == -1 && errno != ENOENT)) {
                /* unlink the current link */
                if (unlink(TIMEZONE_INFO_LINK_PATH) < 0) {