mirror of
https://github.com/znc/znc.git
synced 2026-07-04 17:01:23 +02:00
Only read from stdin if stdin is a TTY
This fixes an endless loop on rehash. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@952 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -1275,8 +1275,9 @@ bool CZNC::DoRehash(CString& sError)
|
||||
sError = "Unable to locate pem file: [" + sPemFile + "]";
|
||||
CUtils::PrintStatus(false, sError);
|
||||
|
||||
#warning what if we closed stdin already?
|
||||
if (CUtils::GetBoolInput("Would you like to create a new pem file?", true)) {
|
||||
// If stdin is e.g. /dev/null and we call GetBoolInput(),
|
||||
// we are stuck in an endless loop!
|
||||
if (isatty(0) && CUtils::GetBoolInput("Would you like to create a new pem file?", true)) {
|
||||
sError.clear();
|
||||
WritePemFile();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user