]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/radius/radius.cpp
Apply owner/group/mode settings to a UNIX socket.
[stg.git] / projects / stargazer / plugins / other / radius / radius.cpp
index 6e026fe700f585f35e771e6de6d9a66aa2817bb9..376e427860fd18e7eb5d07d501fbba57e498c935 100644 (file)
@@ -176,6 +176,9 @@ int RADIUS::createUNIX() const
         m_logger(m_error);
         return 0;
     }
+    chown(m_config.bindAddress.c_str(), m_config.sockUID, m_config.sockGID);
+    if (m_config.sockMode != static_cast<mode_t>(-1))
+        chmod(m_config.bindAddress.c_str(), m_config.sockMode);
     return fd;
 }
 
@@ -233,6 +236,7 @@ int RADIUS::createTCP() const
 void RADIUS::runImpl()
 {
     m_running = true;
+    m_stopped = false;
 
     while (m_running) {
         fd_set fds;