X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fwin32%2Fsetup-syscheck.c;fp=src%2Fwin32%2Fsetup-syscheck.c;h=e07fc647b244cae00833ff89269c90aa372d2c80;hp=6c230b4f6a696c89552d7d3481cfecd8c02adf5d;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/win32/setup-syscheck.c b/src/win32/setup-syscheck.c old mode 100755 new mode 100644 index 6c230b4..e07fc64 --- a/src/win32/setup-syscheck.c +++ b/src/win32/setup-syscheck.c @@ -1,6 +1,3 @@ -/* @(#) $Id: ./src/win32/setup-syscheck.c, 2011/09/08 dcid Exp $ - */ - /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * @@ -10,68 +7,54 @@ * Foundation */ - #include "setup-shared.h" #include "os_xml/os_xml.h" #define OSSEC_CONFIG_TMP ".tmp.ossec.conf" -/* Enable Syscheck.*/ +/* Enable Syscheck */ int main(int argc, char **argv) { char *status; - const char *(xml_syscheck_status[])={"ossec_config","syscheck","disabled", NULL}; + const char *(xml_syscheck_status[]) = {"ossec_config", "syscheck", "disabled", NULL}; - if(argc < 3) - { + if (argc < 3) { printf("%s: Invalid syntax.\n", argv[0]); printf("Try: '%s [enable|disable]'\n\n", argv[0]); - return(0); + return (0); } - /* Checking for directory. */ - if(chdir(argv[1]) != 0) - { + /* Check for directory */ + if (chdir(argv[1]) != 0) { printf("%s: Invalid directory: '%s'.\n", argv[0], argv[1]); - return(0); + return (0); } - - /* Checking if ossec was installed already */ - if(!fileexist(OSSECCONF)) - { + /* Check if OSSEC-HIDS was installed already */ + if (!fileexist(OSSECCONF)) { printf("%s: OSSEC not installed yet. Exiting.\n", argv[0]); - return(0); + return (0); } - - /* Checking status. */ - if(strcmp(argv[2], "enable") == 0) - { + /* Check status */ + if (strcmp(argv[2], "enable") == 0) { status = "no"; - } - else - { + } else { status = "yes"; } - - /* Writing to the XML. */ - if(OS_WriteXML(OSSECCONF, OSSEC_CONFIG_TMP, xml_syscheck_status, - "no", status) != 0) - { + /* Write to the config file */ + if (OS_WriteXML(OSSECCONF, OSSEC_CONFIG_TMP, xml_syscheck_status, + "no", status) != 0) { printf("%s: Error writing to the Config file. Exiting.\n", argv[0]); - return(0); + return (0); } - /* Renaming config files */ + /* Rename config files */ unlink(OSSECLAST); rename(OSSECCONF, OSSECLAST); rename(OSSEC_CONFIG_TMP, OSSECCONF); - return(0); + return (0); } - - -/* EOF */