mirror of
https://github.com/znc/znc.git
synced 2026-08-08 09:52:55 +02:00
Add support to connect to server via unix socket
The syntax for AddServer command and config is chosen to be unix:/path or unix:ssl:/path For security reasons, only admins can add such servers, to prevent users from poking around the file system.
This commit is contained in:
@@ -114,6 +114,8 @@ class CIRCNetwork : private CCoreTranslationMixin {
|
||||
CServer* FindServer(const CString& sName) const;
|
||||
bool DelServer(const CString& sName, unsigned short uPort,
|
||||
const CString& sPass);
|
||||
bool DelServer(const CServer& Server);
|
||||
bool AddServer(CServer Server);
|
||||
bool AddServer(const CString& sName);
|
||||
bool AddServer(const CString& sName, unsigned short uPort,
|
||||
const CString& sPass = "", bool bSSL = false);
|
||||
|
||||
+10
-1
@@ -23,13 +23,21 @@
|
||||
class CServer {
|
||||
public:
|
||||
CServer(const CString& sName, unsigned short uPort = 6667,
|
||||
const CString& sPass = "", bool bSSL = false);
|
||||
const CString& sPass = "", bool bSSL = false,
|
||||
bool bUnixSocket = false);
|
||||
~CServer();
|
||||
|
||||
// TODO: use C++20's =default and <=>
|
||||
bool operator==(const CServer&) const;
|
||||
bool operator<(const CServer&) const;
|
||||
|
||||
static CServer Parse(CString sLine);
|
||||
|
||||
const CString& GetName() const;
|
||||
unsigned short GetPort() const;
|
||||
const CString& GetPass() const;
|
||||
bool IsSSL() const;
|
||||
bool IsUnixSocket() const;
|
||||
CString GetString(bool bIncludePassword = true) const;
|
||||
static bool IsValidHostName(const CString& sHostName);
|
||||
|
||||
@@ -39,6 +47,7 @@ class CServer {
|
||||
unsigned short m_uPort;
|
||||
CString m_sPass;
|
||||
bool m_bSSL;
|
||||
bool m_bUnixSocket;
|
||||
};
|
||||
|
||||
#endif // !ZNC_SERVER_H
|
||||
|
||||
Reference in New Issue
Block a user