Correctly handle "~" in SSLCertFile

This works correctly because only the config writing/reading accesses
CZNC::m_sSSLCertFile directly, everything else goes through this getter.

This ChangeDir() call will also "sanitize" the path. E.g. "/foo//..//home///"
will be turned into "/home/" and stuff like that.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-02-20 11:05:41 +01:00
parent f69aeff3d9
commit ce10cee260

2
znc.h
View File

@@ -104,7 +104,7 @@ public:
CString GetConfPath(bool bAllowMkDir = true) const;
CString GetUserPath() const;
CString GetModPath() const;
CString GetPemLocation() const { return m_sSSLCertFile; }
CString GetPemLocation() const { return CDir::ChangeDir("", m_sSSLCertFile); }
const CString& GetConfigFile() const { return m_sConfigFile; }
bool WritePemFile();
const CString& GetISpoofFile() const { return m_sISpoofFile; }