aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5fd9e26..236dbd4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -37,6 +37,7 @@
#include <poll.h>
#include <signal.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include <unistd.h>
#include "Log.h"
@@ -527,6 +528,12 @@ void Main::init_rc()
if (ret == -1) {
throw runtime_error("RC socket bind failed " + string(strerror(errno)));
}
+
+ // Allow user and group to write
+ ret = chmod(rc_socket_name.c_str(), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
+ if (ret == -1) {
+ throw runtime_error("RC socket chmod failed " + string(strerror(errno)));
+ }
}
bool Main::handle_rc_request()