X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=blobdiff_plain;f=src%2Fremoted%2Fmain.c;h=e02f9bfd6ae604943e1a270aa0289aa656c82bd3;hb=927951d1c1ad45ba9e7325f07d996154a91c911b;hp=008eacd61ceca29e9de8d1e8f4712ee4bfbf21ee;hpb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;p=ossec-hids.git diff --git a/src/remoted/main.c b/src/remoted/main.c index 008eacd..e02f9bf 100755 --- a/src/remoted/main.c +++ b/src/remoted/main.c @@ -20,6 +20,7 @@ int main(int argc, char **argv) { int i = 0,c = 0; int uid = 0, gid = 0; + int debug_level = 0; int test_config = 0,run_foreground = 0; char *cfg = DEFAULTCPATH; @@ -42,6 +43,7 @@ int main(int argc, char **argv) break; case 'd': nowDebug(); + debug_level = 1; break; case 'f': run_foreground = 1; @@ -55,7 +57,7 @@ int main(int argc, char **argv) if(!optarg) ErrorExit("%s: -g needs an argument",ARGV0); group = optarg; - break; + break; case 't': test_config = 1; break; @@ -68,9 +70,25 @@ int main(int argc, char **argv) if(!optarg) ErrorExit("%s: -D needs an argument",ARGV0); dir = optarg; + break; + } + } + + /* Check current debug_level + * Command line setting takes precedence + */ + if (debug_level == 0) + { + /* Getting debug level */ + debug_level = getDefine_Int("remoted", "debug", 0, 2); + while(debug_level != 0) + { + nowDebug(); + debug_level--; } } + debug1(STARTED_MSG,ARGV0); @@ -122,7 +140,7 @@ int main(int argc, char **argv) /* Starting the signal manipulation */ - StartSIG(ARGV0); + StartSIG(ARGV0); /* Creating some randoness */