syslog warning fix

This commit is contained in:
wt committed 2024-07-17 02:10:28 +07:00
1 parent f8f0a22f85
commit 0da818838c
13 files changed
+19 -19

No files matched your search

+2 -2
View File
@@ -60,11 +60,11 @@ namespace settings {
if (new_dns_enabled == "0") {
system("rc stop dnsmasq");
system("rc del dnsmasq");
syslog(LOG_INFO, "DNS is disabled");
syslog(LOG_INFO, "%s", "DNS is disabled");
} else {
system("rc restart dnsmasq");
system("rc add dnsmasq");
syslog(LOG_INFO, "DNS is enabled");
syslog(LOG_INFO, "%s", "DNS is enabled");
}
dnsfileout << stoi(new_dns_enabled);
dnsfileout.close();
@@ -74,7 +74,7 @@ namespace settings {
}
domainsfile.close();
system("rc restart dnsmasq");
syslog(LOG_INFO, "DNS local domains changed");
syslog(LOG_INFO, "%s", "DNS local domains changed");
std::string responsedata = R"({"success":"true"})";
response.set_content(responsedata, JSON_TYPE);
return;
+2 -2
View File
@@ -61,7 +61,7 @@ namespace settings {
if (authenticate(json_body["token"])) {
std::ofstream dnsserversfile("/etc/dnsmasq.conf.d/resolv.conf");
nlohmann::json servers = json_body["servers"];
for (const nlohmann::json_abi_v3_11_3::json server : servers) {
for (const nlohmann::json_abi_v3_11_3::json &server : servers) {
std::string srv = server;
if (server.empty()) {
continue;
@@ -70,7 +70,7 @@ namespace settings {
}
dnsserversfile.close();
system("rc restart dnsmasq");
syslog(LOG_INFO, "DNS servers changed");
syslog(LOG_INFO, "%s", "DNS servers changed");
std::string responsedata = R"({"success":"true"})";
response.set_content(responsedata, JSON_TYPE);
return;
+2 -2
View File
@@ -60,11 +60,11 @@ namespace settings {
if (new_ftp_enabled == "0") {
system("rc stop ftp");
system("rc del ftp");
syslog(LOG_INFO, "Ftp is disabled");
syslog(LOG_INFO, "%s", "Ftp is disabled");
} else {
system("rc start ftp");
system("rc add ftp");
syslog(LOG_INFO, "Ftp is enabled");
syslog(LOG_INFO, "%s", "Ftp is enabled");
}
ftpfileout << stoi(new_ftp_enabled);
ftpfileout.close();
+1 -1
View File
@@ -70,7 +70,7 @@ namespace settings {
}
keysfile.close();
system("rc restart ssh");
syslog(LOG_INFO, "SSH keys changed");
syslog(LOG_INFO, "%s", "SSH keys changed");
std::string responsedata = R"({"success":"true"})";
response.set_content(responsedata, JSON_TYPE);
return;
+1 -1
View File
@@ -74,7 +74,7 @@ namespace settings {
system(systemrequest.str().c_str());
system("rc restart ssh");
std::string syslogstring = "SSH port changed to " + new_ssh_port;
syslog(LOG_INFO, syslogstring.c_str());
syslog(LOG_INFO, "%s", syslogstring.c_str());
std::ifstream sshportfile(SSH_PORT_PATH);
int ssh_port;
sshportfile >> ssh_port;
+2 -2
View File
@@ -60,11 +60,11 @@ namespace settings {
if (new_ssh_status == "0") {
system("rc stop ssh");
system("rc del ssh");
syslog(LOG_INFO, "SSH is disabled");
syslog(LOG_INFO, "%s", "SSH is disabled");
} else {
system("rc start ssh");
system("rc add ssh");
syslog(LOG_INFO, "SSH is enabled");
syslog(LOG_INFO, "%s", "SSH is enabled");
}
sshfileout << stoi(new_ssh_status);
sshfileout.close();
+2 -2
View File
@@ -64,11 +64,11 @@ namespace settings {
if (new_telnet_enabled == "0") {
system("rc stop telnet");
system("rc del telnet");
syslog(LOG_INFO, "Telnet is disabled");
syslog(LOG_INFO, "%s", "Telnet is disabled");
} else {
system("rc start telnet");
system("rc add telnet");
syslog(LOG_INFO, "Telnet is enabled");
syslog(LOG_INFO, "%s", "Telnet is enabled");
}
telnetfileout << stoi(new_telnet_enabled);
telnetfileout.close();
+1 -1
View File
@@ -65,7 +65,7 @@ namespace settings {
telnetportfileout.close();
system("rc restart telnet");
std::string syslogstring = "Telnet port changed to " + new_telnet_port;
syslog(LOG_INFO, syslogstring.c_str());
syslog(LOG_INFO, "%s", syslogstring.c_str());
std::ifstream telnetportfile("/etc/openrouter/telnet/port");
int telnet_port;
telnetportfile >> telnet_port;
+1 -1
View File
@@ -84,7 +84,7 @@ namespace settings {
system(systemrequest.str().c_str());
system("rc restart hostapd");
std::string syslogstring = "WIFI channel changed to " + new_channel;
syslog(LOG_INFO, syslogstring.c_str());
syslog(LOG_INFO, "%s", syslogstring.c_str());
std::ifstream changedwifisettingsfile(WIFI_SETTINGS_PATH);
std::string wifi_channel;
+1 -1
View File
@@ -84,7 +84,7 @@ namespace settings {
system(systemrequest.str().c_str());
system("rc restart hostapd");
std::string syslogstring = "WIFI name changed to " + new_wifi_name;
syslog(LOG_INFO, syslogstring.c_str());
syslog(LOG_INFO, "%s", syslogstring.c_str());
std::ifstream changedwifisettingsfile(WIFI_SETTINGS_PATH);
std::string wifi_name;
+1 -1
View File
@@ -93,7 +93,7 @@ namespace settings {
system(systemrequest.str().c_str());
system("rc restart hostapd");
std::string syslogstring = "WIFI password changed";
syslog(LOG_INFO, syslogstring.c_str());
syslog(LOG_INFO, "%s", syslogstring.c_str());
std::stringstream responsedata;
responsedata << R"({"success":"ok"})";
response.set_content(responsedata.str(), JSON_TYPE);
+2 -2
View File
@@ -59,11 +59,11 @@ namespace settings {
if (new_wifi_status == "0") {
system("rc stop hostapd");
system("rc del hostapd");
syslog(LOG_INFO, "WIFI is disabled");
syslog(LOG_INFO, "%s", "WIFI is disabled");
} else {
system("rc start hostapd");
system("rc add hostapd");
syslog(LOG_INFO, "WIFI is enabled");
syslog(LOG_INFO, "%s", "WIFI is enabled");
}
wififileout << stoi(new_wifi_status);
wififileout.close();