- /* Change permissions */
- if (run_cmd(cmd, hwnd))
- {
- MessageBox(hwnd, "Unable to set permissions on new configuration file.",
- "Error -- Failure Setting IP",MB_OK);
-
- /* Remove config */
- if(unlink(NEWCONFIG))
- {
- MessageBox(hwnd, "Unable to remove new configuration file.",
- "Error -- Failure Setting IP",MB_OK);
+ /* Read the XML. Print error and line number. */
+ if (OS_WriteXML(CONFIG, tmp_path, xml_pt, NULL, ip) != 0) {
+ MessageBox(hwnd, "Unable to set OSSEC Server IP Address.\r\n"
+ "(Internal error on the XML Write).",
+ "Error -- Failure Setting IP", MB_OK);
+
+ if (unlink(tmp_path)) {
+ MessageBox(hwnd, "Could not delete temporary file.",
+ "Error -- Failure Deleting Temporary File", MB_OK);