set(DYNNSUPDATE_CONFIG_FILE "/some/config/file" CACHE FILEPATH "Choose the file dyn-nsupdate reads its configuration from (for security reasons, this is hard-coded in the binary)")
-set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions("-DCONFIG_FILE=\"${DYNNSUPDATE_CONFIG_FILE}\"")
property_tree::ptree config;
property_tree::ini_parser::read_ini(CONFIG_FILE, config);
std::string nsupdate = config.get<std::string>("nsupdate");
+ unsigned server_port = config.get<unsigned>("port", 53);
/* Given the domain, check whether the password matches */
optional<std::string> correct_password = config.get_optional<std::string>(path(domain+"/password", '/'));
exit(1);
}
/* exec nsupdate */
- execl(nsupdate.c_str(), nsupdate.c_str(), "-l", (char *)NULL);
+ execl(nsupdate.c_str(), nsupdate.c_str(), "-p", std::to_string(server_port).c_str(), "-l", (char *)NULL);
/* There was an error */
std::cerr << "There was an error executing nsupdate." << std::endl;
exit(1);