Skip to content

Commit

Permalink
Merge branch 'master' into r_3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goruklu authored Jun 6, 2022
2 parents a391c4e + 41cc044 commit 1681da5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion daemon/lib/source/DobbyLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int DobbyLogger::createUnixSocket(const std::string path)

// This will probably fail since the socket should be deleted when Dobby
// exits, but in case of crash clean up before we start
unlink(mSocketPath.c_str());
unlink(path.c_str());

// Create a file descriptor for the socket
int sockFd;
Expand All @@ -151,6 +151,14 @@ int DobbyLogger::createUnixSocket(const std::string path)
return -1;
}

// Change permissions
if (chmod(path.c_str(), 0644) != 0)
{
AI_LOG_SYS_ERROR(errno, "Failed to set permissions for socket");
// As previously we didn't change permissions I don't believe
// we should fail just because permission change failed
}

// Put the socket into listening state ready to accept connections
if (listen(sockFd, 1) < 0)
{
Expand Down

0 comments on commit 1681da5

Please sign in to comment.