]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/radius/config.h
Apply owner/group/mode settings to a UNIX socket.
[stg.git] / projects / stargazer / plugins / other / radius / config.h
index 28da964e930320269be5e507e7bbee01bfbe3391..c70c7b0f2c94d67663bfb0a3d00e3850c56947c8 100644 (file)
@@ -28,6 +28,9 @@
 #include <map>
 #include <string>
 
+#include <unistd.h> // uid_t, gid_t
+#include <sys/stat.h> // mode_t
+
 namespace STG
 {
 
@@ -37,12 +40,24 @@ struct Config
     typedef std::pair<std::string, std::string> Pair;
     enum Type { UNIX, TCP };
 
+    struct Section
+    {
+        Section() {}
+        Section(const Pairs& ma, const Pairs& mo, const Pairs& re)
+            : match(ma), modify(mo), reply(re) {}
+        Pairs match;
+        Pairs modify;
+        Pairs reply;
+    };
+
     Config() {}
     Config(const MODULE_SETTINGS& settings);
 
-    Pairs match;
-    Pairs modify;
-    Pairs reply;
+    Section autz;
+    Section auth;
+    Section postauth;
+    Section preacct;
+    Section acct;
 
     bool verbose;
 
@@ -52,6 +67,10 @@ struct Config
     std::string portStr;
     uint16_t port;
     std::string key;
+
+    uid_t sockUID;
+    gid_t sockGID;
+    mode_t sockMode;
 };
 
 } // namespace STG