Moț Posted January 5, 2018 at 07:52 PM Share Posted January 5, 2018 at 07:52 PM Config.cpp Search: TOKEN("adminpage_ip") { FN_add_adminpageIP(value_string); //g_stAdminPageIP[0] = value_string; } TOKEN("adminpage_ip1") { FN_add_adminpageIP(value_string); //g_stAdminPageIP[0] = value_string; } TOKEN("adminpage_ip2") { FN_add_adminpageIP(value_string); //g_stAdminPageIP[1] = value_string; } TOKEN("adminpage_ip3") { FN_add_adminpageIP(value_string); //g_stAdminPageIP[2] = value_string; } TOKEN("adminpage_password") { g_stAdminPagePassword = value_string; } Paste: // TOKEN("adminpage_ip") // { // FN_add_adminpageIP(value_string); // //g_stAdminPageIP[0] = value_string; // } // TOKEN("adminpage_ip1") // { // FN_add_adminpageIP(value_string); // //g_stAdminPageIP[0] = value_string; // } // TOKEN("adminpage_ip2") // { // FN_add_adminpageIP(value_string); // //g_stAdminPageIP[1] = value_string; // } // TOKEN("adminpage_ip3") // { // FN_add_adminpageIP(value_string); // //g_stAdminPageIP[2] = value_string; // } // TOKEN("adminpage_password") // { // g_stAdminPagePassword = value_string; // } Search: static void FN_add_adminpageIP(char *line) { char *last; const char *delim = " \t\r\n"; char *v = strtok_r(line, delim, &last); while (v) { g_stAdminPageIP.push_back(v); v = strtok_r(NULL, delim, &last); } } static void FN_log_adminpage() { itertype(g_stAdminPageIP) iter = g_stAdminPageIP.begin(); while (iter != g_stAdminPageIP.end()) { dev_log(LOG_DEB0, "ADMIN_PAGE_IP = %s", (*iter).c_str()); ++iter; } dev_log(LOG_DEB0, "ADMIN_PAGE_PASSWORD = %s", g_stAdminPagePassword.c_str()); } And paste: static void FN_add_adminpageIP(char *line) // { // char *last; // const char *delim = " \t\r\n"; // char *v = strtok_r(line, delim, &last); // while (v) // { // g_stAdminPageIP.push_back(v); // v = strtok_r(NULL, delim, &last); // } // } // static void FN_log_adminpage() // { // itertype(g_stAdminPageIP) iter = g_stAdminPageIP.begin(); // while (iter != g_stAdminPageIP.end()) // { // dev_log(LOG_DEB0, "ADMIN_PAGE_IP = %s", (*iter).c_str()); // ++iter; // } // dev_log(LOG_DEB0, "ADMIN_PAGE_PASSWORD = %s", g_stAdminPagePassword.c_str()); // } S FN_log_adminpage(); And paste: //FN_log_adminpage(); Search: std::vector<std::string> g_stAdminPageIP; std::string g_stAdminPagePassword = "SHOWMETHEMONEY"; Paste //std::vector<std::string> g_stAdminPageIP; //std::string g_stAdminPagePassword = "SHOWMETHEMONEY"; In config.h Search: extern std::vector<std::string> g_stAdminPageIP; extern std::string g_stAdminPagePassword; Paste : //extern std::vector<std::string> g_stAdminPageIP; //extern std::string g_stAdminPagePassword; Input.cpp Search: else if (stBuf == g_stAdminPagePassword) { if (!IsEmptyAdminPage()) { if (!IsAdminPage(inet_ntoa(d->GetAddr().sin_addr))) { char szTmp[64]; snprintf(szTmp, sizeof(szTmp), "WEBADMIN : Wrong Connector : %s", inet_ntoa(d->GetAddr().sin_addr)); stResult += szTmp; } else { d->SetAdminMode(); stResult = "UNKNOWN"; } } else { d->SetAdminMode(); stResult = "UNKNOWN"; } } Paste: // else if (stBuf == g_stAdminPagePassword) // { // if (!IsEmptyAdminPage()) // { // if (!IsAdminPage(inet_ntoa(d->GetAddr().sin_addr))) // { // char szTmp[64]; // snprintf(szTmp, sizeof(szTmp), "WEBADMIN : Wrong Connector : %s", inet_ntoa(d->GetAddr().sin_addr)); // stResult += szTmp; // } // else // { // d->SetAdminMode(); // stResult = "UNKNOWN"; // } // } // else // { // d->SetAdminMode(); // stResult = "UNKNOWN"; // } // } Building source and done ! Link to comment Share on other sites More sharing options...
GODSPEED Posted January 5, 2018 at 08:50 PM Share Posted January 5, 2018 at 08:50 PM You could add more information about this api, to explain what does this fix, fixes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now