-/* @(#) $Id: common.c,v 1.13 2009/06/24 18:53:10 dcid Exp $ */
+/* @(#) $Id: ./src/win32/ui/common.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
- * License (version 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation.
*
- * License details at the LICENSE file included with OSSEC or
+ * License details at the LICENSE file included with OSSEC or
* online at: http://www.ossec.net/en/licensing.html
*/
int gen_server_info(HWND hwnd)
{
memset(ui_server_info, '\0', 2048 +1);
- snprintf(ui_server_info, 2048,
+ snprintf(ui_server_info, 2048,
"Agent: %s (%s) - %s\r\n\r\n"
"Status: %s",
- config_inst.agentname,
- config_inst.agentid,
+ config_inst.agentname,
+ config_inst.agentid,
config_inst.agentip,
config_inst.status);
SetDlgItemText(hwnd, UI_SERVER_TOP, config_inst.version);
SetDlgItemText(hwnd, UI_SERVER_INFO, ui_server_info);
}
-
+
/* Initializing auth key */
SetDlgItemText(hwnd, UI_SERVER_AUTH, config_inst.key);
/* Initializing server ip */
SetDlgItemText(hwnd, UI_SERVER_TEXT, config_inst.server);
- SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"http://www.ossec.net");
+ SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"http://www.ossec.net");
return(0);
}
}
- /* Testing for permission - this is a vista thing.
+ /* Testing for permission - this is a vista thing.
* For some reason vista is not reporting the return codes
* properly.
*/
{
config_inst.admin_access = 0;
}
-
+
fclose(fp);
/* trying to open it to read. */
{
config_inst.admin_access = 0;
}
-
+
if(unlink(".test-file.tst"))
{
config_inst.admin_access = 0;
{
char *tmp_str;
-
+
/* Clearing config */
config_clear();
/* Getting version/install date */
- config_inst.version = cat_file(VERSION_FILE, NULL);
+ config_inst.version = cat_file(VERSION_FILE, NULL);
if(config_inst.version)
{
config_inst.install_date = strchr(config_inst.version, '-');
/* Getting number of messages sent */
- tmp_str = cat_file(SENDER_FILE, NULL);
+ tmp_str = cat_file(SENDER_FILE, NULL);
if(tmp_str)
{
unsigned long int tmp_val = 0;
/* Getting server ip */
if(!get_ossec_server())
{
- if(config_inst.status == ST_MISSING_IMPORT)
+ if(strcmp(config_inst.status, ST_MISSING_IMPORT) == 0)
{
config_inst.status = ST_MISSING_ALL;
}
free(str);
str = NULL;
}
-
+
str = OS_GetOneContentforElement(&xml, xml_serverhost);
if(str)
{
/* Setting up final server name when not available */
config_inst.server = strdup(FL_NOSERVER);
-
+
OS_ClearXML(&xml);
return(0);
char **xml_pt = NULL;
char *(xml_serverip[])={"ossec_config","client","server-ip", NULL};
char *(xml_serverhost[])={"ossec_config","client","server-hostname", NULL};
-
+
/* Verifying IP Address */
if(OS_IsValidIP(ip, NULL) != 1)
/* Reading the XML. Printing error and line number */
- if(OS_WriteXML(CONFIG, NEWCONFIG, xml_pt,
+ if(OS_WriteXML(CONFIG, NEWCONFIG, xml_pt,
NULL, NULL, ip, 0) != 0)
{
MessageBox(hwnd, "Unable to set OSSEC Server IP Address.\r\n"