From 44c3a04462350a70220f7a02bde430839368df21 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 7 Sep 2014 14:39:03 +0200 Subject: [PATCH 1/7] makeconf: one server is enough to get started Webadmin is more convenient and enabled by default since 7387f00. --- src/znc.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/znc.cpp b/src/znc.cpp index 913e0af8..27f416df 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -721,28 +721,22 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { vsLines.push_back(""); CUtils::PrintMessage(""); - CUtils::PrintMessage("-- IRC Servers --"); - CUtils::PrintMessage("Only add servers from the same IRC network."); - CUtils::PrintMessage("If a server from the list can't be reached, another server will be used."); + CUtils::PrintMessage("-- IRC Server --"); CUtils::PrintMessage(""); - do { - CString sHost, sPass; - bool bSSL = false; - unsigned int uServerPort = 0; + CString sHost, sPass; + bool bSSL = false; + unsigned int uServerPort = 0; - while (!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ; - while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)) ; - CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); + while (!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ; + while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)) ; + CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); #ifdef HAVE_LIBSSL - bSSL = CUtils::GetBoolInput("Does this server use SSL?", uServerPort == 6697); + bSSL = CUtils::GetBoolInput("Does this server use SSL?", uServerPort == 6697); #endif - vsLines.push_back("\t\tServer = " + sHost + ((bSSL) ? " +" : " ") + CString(uServerPort) + " " + sPass); - - CUtils::PrintMessage(""); - } while (CUtils::GetBoolInput("Would you like to add another server for this IRC network?", false)); + vsLines.push_back("\t\tServer = " + sHost + ((bSSL) ? " +" : " ") + CString(uServerPort) + " " + sPass); vsLines.push_back(""); CUtils::PrintMessage(""); From bc2c7d0c98c7bd7cac81c796ffe88fd51e08e4b0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 7 Sep 2014 23:50:25 +0200 Subject: [PATCH 2/7] makeconf: one network is enough to get started Webadmin is more convenient and enabled by default since 7387f00. --- src/znc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/znc.cpp b/src/znc.cpp index 27f416df..221efbcd 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -699,9 +699,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { CUtils::PrintMessage("Enabled the default user modules [" + CString(", ").Join(vsUserModNames.begin(), vsUserModNames.end()) + "]"); CUtils::PrintMessage(""); - CString sAAnother = "a"; - while (CUtils::GetBoolInput("Would you like to set up " + sAAnother + " network?", false)) { - sAAnother = "another"; + if (CUtils::GetBoolInput("Would you like to set up a network?", true)) { vsLines.push_back(""); do { From b1451a28c49ddc3f934d1a3724de252beed3bbb3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 7 Sep 2014 23:54:11 +0200 Subject: [PATCH 3/7] makeconf: one admin user is enough to get started Webadmin is more convenient and enabled by default since 7387f00. --- src/znc.cpp | 169 +++++++++++++++++++++++++--------------------------- 1 file changed, 80 insertions(+), 89 deletions(-) diff --git a/src/znc.cpp b/src/znc.cpp index 221efbcd..8e348751 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -651,117 +651,108 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { // User CUtils::PrintMessage(""); - CUtils::PrintMessage("Now we need to set up a user..."); + CUtils::PrintMessage("Now we need to set up an admin user..."); CUtils::PrintMessage(""); - bool bFirstUser = true; - + vsLines.push_back(""); + CString sNick; do { + CUtils::GetInput("Username", sUser, "", "AlphaNumeric"); + } while (!CUser::IsValidUserName(sUser)); + + vsLines.push_back(""); + CString sSalt; + sAnswer = CUtils::GetSaltedHashPass(sSalt); + vsLines.push_back("\tPass = " + CUtils::sDefaultHash + "#" + sAnswer + "#" + sSalt + "#"); + + vsLines.push_back("\tAdmin = true"); + + CUtils::GetInput("Nick", sNick, CUser::MakeCleanUserName(sUser)); + vsLines.push_back("\tNick = " + sNick); + CUtils::GetInput("Alt Nick", sAnswer, sNick + "_"); + if (!sAnswer.empty()) { + vsLines.push_back("\tAltNick = " + sAnswer); + } + CUtils::GetInput("Ident", sAnswer, sUser); + vsLines.push_back("\tIdent = " + sAnswer); + CUtils::GetInput("Real Name", sAnswer, "Got ZNC?"); + vsLines.push_back("\tRealName = " + sAnswer); + CUtils::GetInput("Bind Host", sAnswer, "", "optional"); + if (!sAnswer.empty()) { + vsLines.push_back("\tBindHost = " + sAnswer); + } + + set ssUserMods; + GetModules().GetDefaultMods(ssUserMods, CModInfo::UserModule); + vector vsUserModNames; + for (set::const_iterator it = ssUserMods.begin(); it != ssUserMods.end(); ++it) { + vsUserModNames.push_back(it->GetName()); + vsLines.push_back("\tLoadModule = " + it->GetName()); + } + CUtils::PrintMessage("Enabled the default user modules [" + CString(", ").Join(vsUserModNames.begin(), vsUserModNames.end()) + "]"); + + CUtils::PrintMessage(""); + if (CUtils::GetBoolInput("Would you like to set up a network?", true)) { vsLines.push_back(""); - CString sNick; + do { - CUtils::GetInput("Username", sUser, "", "AlphaNumeric"); - } while (!CUser::IsValidUserName(sUser)); + CUtils::GetInput("Network", sNetwork, "", "e.g. `freenode' or `efnet'"); + } while (!CIRCNetwork::IsValidNetwork(sNetwork)); - vsLines.push_back(""); - CString sSalt; - sAnswer = CUtils::GetSaltedHashPass(sSalt); - vsLines.push_back("\tPass = " + CUtils::sDefaultHash + "#" + sAnswer + "#" + sSalt + "#"); + vsLines.push_back("\t"); - if (CUtils::GetBoolInput("Would you like this user to be an admin?", bFirstUser)) { - vsLines.push_back("\tAdmin = true"); - } else { - vsLines.push_back("\tAdmin = false"); + set ssNetworkMods; + GetModules().GetDefaultMods(ssNetworkMods, CModInfo::NetworkModule); + vector vsNetworkModNames; + for (set::const_iterator it = ssNetworkMods.begin(); it != ssNetworkMods.end(); ++it) { + vsNetworkModNames.push_back(it->GetName()); + vsLines.push_back("\t\tLoadModule = " + it->GetName()); } + CUtils::PrintMessage("Enabled the default network modules [" + CString(", ").Join(vsNetworkModNames.begin(), vsNetworkModNames.end()) + "]"); - CUtils::GetInput("Nick", sNick, CUser::MakeCleanUserName(sUser)); - vsLines.push_back("\tNick = " + sNick); - CUtils::GetInput("Alt Nick", sAnswer, sNick + "_"); - if (!sAnswer.empty()) { - vsLines.push_back("\tAltNick = " + sAnswer); - } - CUtils::GetInput("Ident", sAnswer, sUser); - vsLines.push_back("\tIdent = " + sAnswer); - CUtils::GetInput("Real Name", sAnswer, "Got ZNC?"); - vsLines.push_back("\tRealName = " + sAnswer); - CUtils::GetInput("Bind Host", sAnswer, "", "optional"); - if (!sAnswer.empty()) { - vsLines.push_back("\tBindHost = " + sAnswer); - } - - set ssUserMods; - GetModules().GetDefaultMods(ssUserMods, CModInfo::UserModule); - vector vsUserModNames; - for (set::const_iterator it = ssUserMods.begin(); it != ssUserMods.end(); ++it) { - vsUserModNames.push_back(it->GetName()); - vsLines.push_back("\tLoadModule = " + it->GetName()); - } - CUtils::PrintMessage("Enabled the default user modules [" + CString(", ").Join(vsUserModNames.begin(), vsUserModNames.end()) + "]"); - + vsLines.push_back(""); + CUtils::PrintMessage(""); + CUtils::PrintMessage("-- IRC Server --"); CUtils::PrintMessage(""); - if (CUtils::GetBoolInput("Would you like to set up a network?", true)) { - vsLines.push_back(""); - do { - CUtils::GetInput("Network", sNetwork, "", "e.g. `freenode' or `efnet'"); - } while (!CIRCNetwork::IsValidNetwork(sNetwork)); + CString sHost, sPass; + bool bSSL = false; + unsigned int uServerPort = 0; - vsLines.push_back("\t"); - - set ssNetworkMods; - GetModules().GetDefaultMods(ssNetworkMods, CModInfo::NetworkModule); - vector vsNetworkModNames; - for (set::const_iterator it = ssNetworkMods.begin(); it != ssNetworkMods.end(); ++it) { - vsNetworkModNames.push_back(it->GetName()); - vsLines.push_back("\t\tLoadModule = " + it->GetName()); - } - CUtils::PrintMessage("Enabled the default network modules [" + CString(", ").Join(vsNetworkModNames.begin(), vsNetworkModNames.end()) + "]"); - - vsLines.push_back(""); - CUtils::PrintMessage(""); - CUtils::PrintMessage("-- IRC Server --"); - CUtils::PrintMessage(""); - - CString sHost, sPass; - bool bSSL = false; - unsigned int uServerPort = 0; - - while (!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ; - while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)) ; - CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); + while (!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ; + while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)) ; + CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); #ifdef HAVE_LIBSSL - bSSL = CUtils::GetBoolInput("Does this server use SSL?", uServerPort == 6697); + bSSL = CUtils::GetBoolInput("Does this server use SSL?", uServerPort == 6697); #endif - vsLines.push_back("\t\tServer = " + sHost + ((bSSL) ? " +" : " ") + CString(uServerPort) + " " + sPass); + vsLines.push_back("\t\tServer = " + sHost + ((bSSL) ? " +" : " ") + CString(uServerPort) + " " + sPass); - vsLines.push_back(""); - CUtils::PrintMessage(""); - CUtils::PrintMessage("-- Channels --"); - CUtils::PrintMessage(""); + vsLines.push_back(""); + CUtils::PrintMessage(""); + CUtils::PrintMessage("-- Channels --"); + CUtils::PrintMessage(""); - CString sArg = "a"; - CString sPost = " for ZNC to automatically join?"; - bool bDefault = true; + CString sArg = "a"; + CString sPost = " for ZNC to automatically join?"; + bool bDefault = true; - while (CUtils::GetBoolInput("Would you like to add " + sArg + " channel" + sPost, bDefault)) { - while (!CUtils::GetInput("Channel name", sAnswer)) ; - vsLines.push_back("\t\t"); - vsLines.push_back("\t\t"); - sArg = "another"; - sPost = "?"; - bDefault = false; - } - - vsLines.push_back("\t"); + while (CUtils::GetBoolInput("Would you like to add " + sArg + " channel" + sPost, bDefault)) { + while (!CUtils::GetInput("Channel name", sAnswer)) ; + vsLines.push_back("\t\t"); + vsLines.push_back("\t\t"); + sArg = "another"; + sPost = "?"; + bDefault = false; } - vsLines.push_back(""); + vsLines.push_back("\t"); + } - CUtils::PrintMessage(""); - bFirstUser = false; - } while (CUtils::GetBoolInput("Would you like to set up another user?", false)); + vsLines.push_back(""); + + CUtils::PrintMessage(""); // !User CFile File; From 1c72af7d2d9737b65d87b596046070859e86bb3c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 8 Sep 2014 00:23:28 +0200 Subject: [PATCH 4/7] makeconf: change the channel input loop to a one-liner The "would you like to add a channel?" ... "would you like to add another channel?" loop is very verbose and slow to use. This proposal makes it a simple one-liner where the user can enter a bunch of chans using any combination of space/comma/semi-colon as a separator, or just hit enter to proceed without channels... --- src/znc.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/znc.cpp b/src/znc.cpp index 8e348751..813ece32 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -731,20 +731,17 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { vsLines.push_back(""); CUtils::PrintMessage(""); - CUtils::PrintMessage("-- Channels --"); - CUtils::PrintMessage(""); - CString sArg = "a"; - CString sPost = " for ZNC to automatically join?"; - bool bDefault = true; - - while (CUtils::GetBoolInput("Would you like to add " + sArg + " channel" + sPost, bDefault)) { - while (!CUtils::GetInput("Channel name", sAnswer)) ; - vsLines.push_back("\t\t"); - vsLines.push_back("\t\t"); - sArg = "another"; - sPost = "?"; - bDefault = false; + CString sChans; + if (CUtils::GetInput("Initial channels", sChans)) { + VCString vsChans; + sChans.Replace(",", " "); + sChans.Replace(";", " "); + sChans.Split(" ", vsChans, false, "", "", true, true); + for (const CString& sChan : vsChans) { + vsLines.push_back("\t\t"); + vsLines.push_back("\t\t"); + } } vsLines.push_back("\t"); From 2d868a892c50c181dffd9ea023048421ca17e4bd Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 8 Sep 2014 00:04:43 +0200 Subject: [PATCH 5/7] makeconf: offer freenode by default --- src/znc.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/znc.cpp b/src/znc.cpp index 813ece32..a3918090 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -696,7 +696,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { vsLines.push_back(""); do { - CUtils::GetInput("Network", sNetwork, "", "e.g. `freenode' or `efnet'"); + CUtils::GetInput("Name", sNetwork, "freenode"); } while (!CIRCNetwork::IsValidNetwork(sNetwork)); vsLines.push_back("\t"); @@ -715,12 +715,18 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { CUtils::PrintMessage("-- IRC Server --"); CUtils::PrintMessage(""); - CString sHost, sPass; + CString sHost, sPass, sHint; bool bSSL = false; unsigned int uServerPort = 0; - while (!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ; - while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)) ; + if (sNetwork.Equals("freenode")) { + sHost = "chat.freenode.net"; + } else { + sHint = "host only"; + } + + while (!CUtils::GetInput("IRC server", sHost, sHost, sHint) || !CServer::IsValidHostName(sHost)); + while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)); CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); #ifdef HAVE_LIBSSL From fec4d20ace17ed08c2a71f61101a00884f91a542 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 8 Sep 2014 00:29:06 +0200 Subject: [PATCH 6/7] makeconf: revise the output and reduce the noise Long "would you like ZNC to..." questions are slow to read. Use short and pithy prompts, and try to fit the line width to less than 80 characters. Furthermore, Remove Word Capitalization. --- src/znc.cpp | 60 ++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/znc.cpp b/src/znc.cpp index a3918090..50142f06 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -572,7 +572,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { } CUtils::PrintMessage(""); - CUtils::PrintMessage("First let's start with some global settings..."); + CUtils::PrintMessage("-- Global settings --"); CUtils::PrintMessage(""); // Listen @@ -590,22 +590,26 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { do { bSuccess = true; while (true) { - if (!CUtils::GetNumInput("What port would you like ZNC to listen on?", uListenPort, 1025, 65535)) { + if (!CUtils::GetNumInput("Listen on port", uListenPort, 1025, 65535)) { continue; } - if (uListenPort == 6667 && !CUtils::GetBoolInput("Warning: Some web browsers reject port 6667. If you intend to use ZNC's web interface, you might want to use another port. Proceed with port 6667 anyway?", true)) { - continue; + if (uListenPort == 6667) { + CUtils::PrintStatus(false, "WARNING: Some web browsers reject port 6667. If you intend to"); + CUtils::PrintStatus(false, "use ZNC's web interface, you might want to use another port."); + if (!CUtils::GetBoolInput("Proceed with port 6667 anyway?", true)) { + continue; + } } break; } #ifdef HAVE_LIBSSL - bListenSSL = CUtils::GetBoolInput("Would you like ZNC to listen using SSL?", bListenSSL); + bListenSSL = CUtils::GetBoolInput("Listen using SSL", bListenSSL); #endif #ifdef HAVE_IPV6 - b6 = CUtils::GetBoolInput("Would you like ZNC to listen using both IPv4 and IPv6?", b6); + b6 = CUtils::GetBoolInput("Listen using both IPv4 and IPv6", b6); #endif // Don't ask for listen host, it may be configured later if needed. @@ -647,17 +651,17 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { vsGlobalModNames.push_back(it->GetName()); vsLines.push_back("LoadModule = " + it->GetName()); } - CUtils::PrintMessage("Enabled the default global modules [" + CString(", ").Join(vsGlobalModNames.begin(), vsGlobalModNames.end()) + "]"); + CUtils::PrintMessage("Enabled global modules [" + CString(", ").Join(vsGlobalModNames.begin(), vsGlobalModNames.end()) + "]"); // User CUtils::PrintMessage(""); - CUtils::PrintMessage("Now we need to set up an admin user..."); + CUtils::PrintMessage("-- Admin user settings --"); CUtils::PrintMessage(""); vsLines.push_back(""); CString sNick; do { - CUtils::GetInput("Username", sUser, "", "AlphaNumeric"); + CUtils::GetInput("Username", sUser, "", "alphanumeric"); } while (!CUser::IsValidUserName(sUser)); vsLines.push_back(""); @@ -669,15 +673,15 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { CUtils::GetInput("Nick", sNick, CUser::MakeCleanUserName(sUser)); vsLines.push_back("\tNick = " + sNick); - CUtils::GetInput("Alt Nick", sAnswer, sNick + "_"); + CUtils::GetInput("Alternate nick", sAnswer, sNick + "_"); if (!sAnswer.empty()) { vsLines.push_back("\tAltNick = " + sAnswer); } CUtils::GetInput("Ident", sAnswer, sUser); vsLines.push_back("\tIdent = " + sAnswer); - CUtils::GetInput("Real Name", sAnswer, "Got ZNC?"); + CUtils::GetInput("Real name", sAnswer, "Got ZNC?"); vsLines.push_back("\tRealName = " + sAnswer); - CUtils::GetInput("Bind Host", sAnswer, "", "optional"); + CUtils::GetInput("Bind host", sAnswer, "", "optional"); if (!sAnswer.empty()) { vsLines.push_back("\tBindHost = " + sAnswer); } @@ -689,12 +693,16 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { vsUserModNames.push_back(it->GetName()); vsLines.push_back("\tLoadModule = " + it->GetName()); } - CUtils::PrintMessage("Enabled the default user modules [" + CString(", ").Join(vsUserModNames.begin(), vsUserModNames.end()) + "]"); + CUtils::PrintMessage("Enabled user modules [" + CString(", ").Join(vsUserModNames.begin(), vsUserModNames.end()) + "]"); CUtils::PrintMessage(""); - if (CUtils::GetBoolInput("Would you like to set up a network?", true)) { + if (CUtils::GetBoolInput("Set up a network?", true)) { vsLines.push_back(""); + CUtils::PrintMessage(""); + CUtils::PrintMessage("-- Network settings --"); + CUtils::PrintMessage(""); + do { CUtils::GetInput("Name", sNetwork, "freenode"); } while (!CIRCNetwork::IsValidNetwork(sNetwork)); @@ -708,12 +716,6 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { vsNetworkModNames.push_back(it->GetName()); vsLines.push_back("\t\tLoadModule = " + it->GetName()); } - CUtils::PrintMessage("Enabled the default network modules [" + CString(", ").Join(vsNetworkModNames.begin(), vsNetworkModNames.end()) + "]"); - - vsLines.push_back(""); - CUtils::PrintMessage(""); - CUtils::PrintMessage("-- IRC Server --"); - CUtils::PrintMessage(""); CString sHost, sPass, sHint; bool bSSL = false; @@ -721,25 +723,25 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { if (sNetwork.Equals("freenode")) { sHost = "chat.freenode.net"; +#ifdef HAVE_LIBSSL + bSSL = true; +#endif } else { sHint = "host only"; } - while (!CUtils::GetInput("IRC server", sHost, sHost, sHint) || !CServer::IsValidHostName(sHost)); - while (!CUtils::GetNumInput("[" + sHost + "] Port", uServerPort, 1, 65535, 6667)); - CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); - + while (!CUtils::GetInput("Server host", sHost, sHost, sHint) || !CServer::IsValidHostName(sHost)); #ifdef HAVE_LIBSSL - bSSL = CUtils::GetBoolInput("Does this server use SSL?", uServerPort == 6697); + bSSL = CUtils::GetBoolInput("Server uses SSL?", bSSL); #endif + while (!CUtils::GetNumInput("Server port", uServerPort, 1, 65535, bSSL ? 6697 : 6667)); + CUtils::GetInput("Server password (probably empty)", sPass); vsLines.push_back("\t\tServer = " + sHost + ((bSSL) ? " +" : " ") + CString(uServerPort) + " " + sPass); - vsLines.push_back(""); - CUtils::PrintMessage(""); - CString sChans; if (CUtils::GetInput("Initial channels", sChans)) { + vsLines.push_back(""); VCString vsChans; sChans.Replace(",", " "); sChans.Replace(";", " "); @@ -750,6 +752,8 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { } } + CUtils::PrintMessage("Enabled network modules [" + CString(", ").Join(vsNetworkModNames.begin(), vsNetworkModNames.end()) + "]"); + vsLines.push_back("\t"); } From e45aa48a91b34e5d8e50eadf92f9f9e30ee89970 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 8 Sep 2014 23:58:18 +0200 Subject: [PATCH 7/7] makeconf: limit the upper bound for allowed port to 65534 Safari/WebKit: "Not allowed to use restricted network port" --- src/znc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/znc.cpp b/src/znc.cpp index 50142f06..9734c799 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -590,7 +590,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { do { bSuccess = true; while (true) { - if (!CUtils::GetNumInput("Listen on port", uListenPort, 1025, 65535)) { + if (!CUtils::GetNumInput("Listen on port", uListenPort, 1025, 65534)) { continue; } if (uListenPort == 6667) {