schat: Require explicit path to certificate.
Don't allow using files outside of module data directory. This is the same requirement as for log path in log module.
This commit is contained in:
1 parent
a80074712a
commit
82d32429d1
1 file changed
+5
-4
+5
-4
@@ -115,12 +115,13 @@ class CSChat : public CModule {
|
||||
~CSChat() override {}
|
||||
|
||||
bool OnLoad(const CString& sArgs, CString& sMessage) override {
|
||||
m_sPemFile = sArgs;
|
||||
|
||||
if (m_sPemFile.empty()) {
|
||||
m_sPemFile = CZNC::Get().GetPemLocation();
|
||||
if (sArgs.empty()) {
|
||||
sMessage = "Argument must be path to PEM file";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_sPemFile = CDir::CheckPathPrefix(GetSavePath(), sArgs);
|
||||
|
||||
if (!CFile::Exists(m_sPemFile)) {
|
||||
sMessage = "Unable to load pem file [" + m_sPemFile + "]";
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user