diff --git a/src/config/syscheck-config.h b/src/config/syscheck-config.h index a56ad8065..29e3ff082 100755 --- a/src/config/syscheck-config.h +++ b/src/config/syscheck-config.h @@ -55,7 +55,6 @@ typedef struct _config int *opts; /* attributes set in the tag element */ - char *workdir; /* set to the DEFAULTDIR (/var/ossec) */ char *remote_db; char *db; diff --git a/src/syscheckd/syscheck.c b/src/syscheckd/syscheck.c index 11a1ada6e..8b5195262 100755 --- a/src/syscheckd/syscheck.c +++ b/src/syscheckd/syscheck.c @@ -102,10 +102,6 @@ int Start_win32_Syscheck() debug1(STARTED_MSG, ARGV0); - /* Zeroing the structure */ - syscheck.workdir = DEFAULTDIR; - - /* Checking if the configuration is present */ if(File_DateofChange(cfg) < 0) ErrorExit(NO_CONFIG, ARGV0, cfg); @@ -191,7 +187,22 @@ int Start_win32_Syscheck() } #endif - +/* print help statement */ +void help_local() +{ + print_header(); + print_out(" %s: -[Vhdtf] [-c config]", ARGV0); + print_out(" -V Version and license message"); + print_out(" -h This help message"); + print_out(" -d Execute in debug mode. This parameter"); + print_out(" can be specified multiple times"); + print_out(" to increase the debug level."); + print_out(" -t Test configuration"); + print_out(" -f Run in foreground"); + print_out(" -c Read the 'config' file"); + print_out(" "); + exit(1); +} /* Syscheck unix main. */ @@ -205,15 +216,11 @@ int main(int argc, char **argv) char *cfg = DEFAULTCPATH; - /* Zeroing the structure */ - syscheck.workdir = NULL; - - /* Setting the name */ OS_SetName(ARGV0); - while((c = getopt(argc, argv, "VtdhfD:c:")) != -1) + while((c = getopt(argc, argv, "Vtdhfc:")) != -1) { switch(c) { @@ -221,7 +228,7 @@ int main(int argc, char **argv) print_version(); break; case 'h': - help(ARGV0); + help_local(); break; case 'd': nowDebug(); @@ -230,11 +237,6 @@ int main(int argc, char **argv) case 'f': run_foreground = 1; break; - case 'D': - if(!optarg) - ErrorExit("%s: -D needs an argument",ARGV0); - syscheck.workdir = optarg; - break; case 'c': if(!optarg) ErrorExit("%s: -c needs an argument",ARGV0); @@ -244,7 +246,7 @@ int main(int argc, char **argv) test_config = 1; break; default: - help(ARGV0); + help_local(); break; } } @@ -305,11 +307,6 @@ int main(int argc, char **argv) exit(0); - /* Setting default values */ - if(syscheck.workdir == NULL) - syscheck.workdir = DEFAULTDIR; - - /* Setup libmagic */ #ifdef USE_MAGIC init_magic(&magic_cookie);