mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
admindebug: Enforce need of TTY to turn on debug mode
Fix #1580 Close #1581
This commit is contained in:
committed by
Alexey Sokolov
parent
8f2269083a
commit
d7e94d7ac5
@@ -54,6 +54,11 @@ class CAdminDebugMod : public CModule {
|
||||
}
|
||||
|
||||
bool ToggleDebug(bool bEnable, CString sEnabledBy) {
|
||||
if (!CDebug::StdoutIsTTY()) {
|
||||
PutModule(t_s("Failure. We need to be running with a TTY. (is ZNC running with --foreground?)"));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bValue = CDebug::Debug();
|
||||
|
||||
if (bEnable == bValue) {
|
||||
@@ -77,7 +82,7 @@ class CAdminDebugMod : public CModule {
|
||||
);
|
||||
m_sEnabledBy = sEnabledBy;
|
||||
} else {
|
||||
m_sEnabledBy = nullptr;
|
||||
m_sEnabledBy = "";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user