Skip to content

Commit

Permalink
Fix help and command line arguments
Browse files Browse the repository at this point in the history
Fixes to the command line arguments and help messages in
ossec-agentlessd. This is related to the issues in ossec#207.
  • Loading branch information
awiddersheim committed Aug 24, 2014
1 parent 9de24dd commit 56da055
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/agentlessd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,25 @@
#include "agentlessd.h"
#include "config/config.h"


/* print help statement */
void help_local()
{
print_header();
print_out(" %s: -[Vhdtf] [-u user] [-g group] [-c config] [-D dir]", 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(" -u <user> Run as 'user'");
print_out(" -g <group> Run as 'group'");
print_out(" -c <config> Read the 'config' file");
print_out(" -D <dir> Chroot to 'dir'");
print_out(" ");
exit(1);
}

int main(int argc, char **argv)
{
Expand All @@ -37,7 +55,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help(ARGV0);
help_local();
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -69,7 +87,7 @@ int main(int argc, char **argv)
test_config = 1;
break;
default:
help(ARGV0);
help_local();
break;
}

Expand Down Expand Up @@ -121,7 +139,7 @@ int main(int argc, char **argv)
}


/* Privilege separation */
/* Privilege separation */
if(Privsep_SetGroup(gid) < 0)
ErrorExit(SETGID_ERROR,ARGV0,group);

Expand Down

0 comments on commit 56da055

Please sign in to comment.