The std::filesystem::exists uses stat() internally. The read permission
is needed to use stat(). It can cause the smack issues.
This patch changes the implementation to using access() with F_OK option.
Change-Id: I367487b010c7abf50015004e86c3bb6ad88aa0e6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
try {
std::string path = "/run/aul/apps/" + std::to_string(getuid()) + "/" +
std::to_string(getpid());
- ServerSocket socket;
- if (!fs::exists(path))
+ if (access(path.c_str(), F_OK) != 0)
fs::create_directory(path);
path += "/.app-sock";
+ ServerSocket socket;
socket.Bind(path);
socket.Listen(128);
socket.SetReceiveBufferSize(Socket::kSocketMaxBufferSize);