Limit permissions of the lock file for non-owner 31/309931/1 accepted/tizen/unified/20240423.164622
authorYonggoo Kang <ygace.kang@samsung.com>
Thu, 18 Apr 2024 07:53:28 +0000 (16:53 +0900)
committerYonggoo Kang <ygace.kang@samsung.com>
Thu, 18 Apr 2024 07:53:28 +0000 (16:53 +0900)
Change-Id: I230ba7b9467c04e83f5cf48630055b174faded1f

srcs/common/file-lock.cpp

index 0f910ae2c5ace41cd80f47738c2b0d4ee06a1a41..e9a6d0d038a672fc4e064d2dd47a84389acb6fef 100644 (file)
@@ -43,7 +43,7 @@ FileLocker::FileLocker(const std::string &lockFile, bool blocking)
         ThrowMsg(FileLockerException::LockFailed,
                  "File name can not be empty.");
     }
-    m_lockFileFd = open(lockFile.c_str(), O_RDWR | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
+    m_lockFileFd = open(lockFile.c_str(), O_RDWR | O_CREAT, S_IRWXU | S_IRGRP | S_IROTH);
     if (m_lockFileFd == -1) {
         LogError("Lock file cannot be opened " << lockFile);
         ThrowMsg(FileLockerException::LockFailed,