X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_dbd%2Fserver.c;h=0f9f8554a45b408a49b76d62b3b152a14a085330;hp=8a418b9438007581e302fd77001602ad74f8fdb8;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/os_dbd/server.c b/src/os_dbd/server.c index 8a418b9..0f9f855 100755 --- a/src/os_dbd/server.c +++ b/src/os_dbd/server.c @@ -1,4 +1,5 @@ -/* @(#) $Id$ */ +/* @(#) $Id: ./src/os_dbd/server.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. @@ -50,14 +51,14 @@ int __DBSelectServer(char *server, DBConfig *db_config) int __DBInsertServer(char *server, char *info, DBConfig *db_config) { char sql_query[OS_SIZE_1024]; - + memset(sql_query, '\0', OS_SIZE_1024); /* Checking if the server is present */ snprintf(sql_query, OS_SIZE_1024 -1, "SELECT id from server where hostname = '%s'", server); - + /* If not present, we insert */ if(osdb_query_select(db_config->conn, sql_query) == 0) { @@ -105,10 +106,10 @@ int OS_Server_ReadInsertDB(void *db_config) int server_id = 0; char *info; - + debug1("%s: DEBUG: entering OS_Server_ReadInsertDB()", ARGV0); - + /* Getting servers hostname */ memset(__shost, '\0', 512); if(gethostname(__shost, 512 -1) != 0) @@ -138,8 +139,8 @@ int OS_Server_ReadInsertDB(void *db_config) /* Getting server id */ server_id = __DBSelectServer(__shost, (DBConfig *)db_config); - - + + return(server_id); }