Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/addagent/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <stdlib.h>

/* Prototypes */
static void helpmsg(void) __attribute__((noreturn));
static void helpmsg(int status) __attribute__((noreturn));
static void print_banner(void);
#ifndef WIN32
static void manage_shutdown(int sig) __attribute__((noreturn));
Expand All @@ -34,7 +34,7 @@ static int setenv(const char *name, const char *val, __attribute__((unused)) int
}
#endif

static void helpmsg()
static void helpmsg(int status)
{
print_header();
print_out(" %s: -[Vhlj] [-a <ip> -n <name>] [-d sec] [-e id] [-r id] [-i id] [-f file]", ARGV0);
Expand All @@ -52,7 +52,7 @@ static void helpmsg()
print_out(" -f <file> Bulk generate client keys from file (Manager only)");
print_out(" <file> contains lines in IP,NAME format");
print_out(" <file> should also exist within /var/ossec due to manage_agents chrooting");
exit(1);
exit(status);
}

static void print_banner()
Expand Down Expand Up @@ -117,7 +117,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
helpmsg();
helpmsg(0);
break;
case 'e':
#ifdef CLIENT
Expand Down Expand Up @@ -195,7 +195,7 @@ int main(int argc, char **argv)
setenv("OSSEC_REMOVE_DUPLICATED", optarg, 1);
break;
default:
helpmsg();
helpmsg(1);
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/agentlessd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include "config/config.h"

/* Prototypes */
static void help_agentlessd(void) __attribute__((noreturn));
static void help_agentlessd(int status) __attribute__((noreturn));


/* Print help statement */
static void help_agentlessd()
static void help_agentlessd(int status)
{
print_header();
print_out(" %s: -[Vhdtf] [-u user] [-g group] [-c config] [-D dir]", ARGV0);
Expand All @@ -32,7 +32,7 @@ static void help_agentlessd()
print_out(" -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
print_out(" -D <dir> Directory to chroot into (default: %s)", DEFAULTDIR);
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand All @@ -54,7 +54,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_agentlessd();
help_agentlessd(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -90,7 +90,7 @@ int main(int argc, char **argv)
test_config = 1;
break;
default:
help_agentlessd();
help_agentlessd(1);
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/analysisd/analysisd.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int hourly_firewall;

/* Print help statement */
__attribute__((noreturn))
static void help_analysisd(void)
static void help_analysisd(int status)
{
print_header();
print_out(" %s: -[Vhdtf] [-u user] [-g group] [-c config] [-D dir]", ARGV0);
Expand All @@ -105,7 +105,7 @@ static void help_analysisd(void)
print_out(" -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
print_out(" -D <dir> Directory to chroot into (default: %s)", DEFAULTDIR);
print_out(" ");
exit(1);
exit(status);
}

#ifndef TESTRULE
Expand Down Expand Up @@ -148,7 +148,7 @@ int main_analysisd(int argc, char **argv)
print_version();
break;
case 'h':
help_analysisd();
help_analysisd(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -185,7 +185,7 @@ int main_analysisd(int argc, char **argv)
test_config = 1;
break;
default:
help_analysisd();
help_analysisd(1);
break;
}

Expand Down
8 changes: 4 additions & 4 deletions src/analysisd/makelists.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GeoIP *geoipdb;

/* print help statement */
__attribute__((noreturn))
static void help_makelists(void)
static void help_makelists(int status)
{
print_header();
print_out(" %s: -[VhdtF] [-u user] [-g group] [-c config] [-D dir]", ARGV0);
Expand All @@ -54,7 +54,7 @@ static void help_makelists(void)
print_out(" -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
print_out(" -D <dir> Directory to chroot into (default: %s)", DEFAULTDIR);
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand Down Expand Up @@ -84,7 +84,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_makelists();
help_makelists(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -120,7 +120,7 @@ int main(int argc, char **argv)
test_config = 1;
break;
default:
help_makelists();
help_makelists(1);
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/analysisd/testrule.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void DecodeEvent(Eventinfo *lf);

/* Print help statement */
__attribute__((noreturn))
static void help_logtest(void)
static void help_logtest(int status)
{
print_header();
print_out(" %s: -[Vhdtva] [-c config] [-D dir] [-U rule:alert:decoder]", ARGV0);
Expand All @@ -54,7 +54,7 @@ static void help_logtest(void)
print_out(" -D <dir> Directory to chroot into (default: %s)", DEFAULTDIR);
print_out(" -U <rule:alert:decoder> Unit test. Refer to contrib/ossec-testing/runtests.py");
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand Down Expand Up @@ -96,7 +96,7 @@ int main(int argc, char **argv)
test_config = 1;
break;
case 'h':
help_logtest();
help_logtest(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -129,7 +129,7 @@ int main(int argc, char **argv)
full_output = 1;
break;
default:
help_logtest();
help_logtest(1);
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/client-agent/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#endif

/* Prototypes */
static void help_agentd(void) __attribute((noreturn));
static void help_agentd(int status) __attribute((noreturn));


/* Print help statement */
static void help_agentd()
static void help_agentd(int status)
{
print_header();
print_out(" %s: -[Vhdtf] [-u user] [-g group] [-c config] [-D dir]", ARGV0);
Expand All @@ -37,7 +37,7 @@ static void help_agentd()
print_out(" -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
print_out(" -D <dir> Directory to chroot into (default: %s)", DEFAULTDIR);
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand Down Expand Up @@ -65,7 +65,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_agentd();
help_agentd(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -102,7 +102,7 @@ int main(int argc, char **argv)
cfg = optarg;
break;
default:
help_agentd();
help_agentd(1);
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/logcollector/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include "logcollector.h"

/* Prototypes */
static void help_logcollector(void) __attribute__((noreturn));
static void help_logcollector(int status) __attribute__((noreturn));


/* Print help statement */
static void help_logcollector()
static void help_logcollector(int status)
{
print_header();
print_out(" %s: -[Vhdtf] [-c config]", ARGV0);
Expand All @@ -40,7 +40,7 @@ static void help_logcollector()
print_out(" -f Run in foreground");
print_out(" -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand All @@ -63,7 +63,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_logcollector();
help_logcollector(0);
break;
case 'd':
nowDebug();
Expand All @@ -82,7 +82,7 @@ int main(int argc, char **argv)
test_config = 1;
break;
default:
help_logcollector();
help_logcollector(1);
break;
}

Expand Down
10 changes: 5 additions & 5 deletions src/monitord/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include "os_net/os_net.h"

/* Prototypes */
static void help_monitord(void) __attribute__((noreturn));
static void help_monitord(int status) __attribute__((noreturn));


/* Print help statement */
static void help_monitord()
static void help_monitord(int status)
{
print_header();
print_out(" %s: -[Vhdtf] [-u user] [-g group] [-c config] [-D dir]", ARGV0);
Expand All @@ -33,7 +33,7 @@ static void help_monitord()
print_out(" -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
print_out(" -D <dir> Directory to chroot into (default: %s)", DEFAULTDIR);
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand All @@ -58,7 +58,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_monitord();
help_monitord(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -94,7 +94,7 @@ int main(int argc, char **argv)
test_config = 1;
break;
default:
help_monitord();
help_monitord(1);
break;
}

Expand Down
10 changes: 5 additions & 5 deletions src/os_auth/main-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ int main()
#include <openssl/ssl.h>
#include "auth.h"

static void help_agent_auth(void) __attribute__((noreturn));
static void help_agent_auth(int status) __attribute__((noreturn));

/* Print help statement */
static void help_agent_auth()
static void help_agent_auth(int status)
{
print_header();
print_out(" %s: -[Vhdt] [-g group] [-D dir] [-m IP address] [-p port] [-A name] [-c ciphers] [-v path] [-x path] [-k path]", ARGV0);
Expand All @@ -64,7 +64,7 @@ static void help_agent_auth()
print_out(" -k <path> Full path to agent key");
print_out(" -P <path> Authorization password file [default: /var/ossec/etc/authd.pass");
print_out(" ");
exit(1);
exit(status);
}

int main(int argc, char **argv)
Expand Down Expand Up @@ -109,7 +109,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_agent_auth();
help_agent_auth(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -183,7 +183,7 @@ int main(int argc, char **argv)
authenticate++;
break;
default:
help_agent_auth();
help_agent_auth(1);
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/os_auth/main-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
#define POOL_SIZE 512

/* Prototypes */
static void help_authd(void) __attribute((noreturn));
static void help_authd(int status) __attribute((noreturn));
static int ssl_error(const SSL *ssl, int ret);
static void clean_exit(SSL_CTX *ctx, int sock) __attribute__((noreturn));


/* Print help statement */
static void help_authd()
static void help_authd(int status)
{
print_header();
print_out(" %s: -[Vhdti] [-g group] [-D dir] [-p port] [-c ciphers] [-v path] [-x path] [-k path]", ARGV0);
Expand All @@ -57,7 +57,7 @@ static void help_authd()
print_out(" -x <path> Full path to server certificate");
print_out(" -k <path> Full path to server key");
print_out(" ");
exit(1);
exit(status);
}

/* Generates a random and temporary shared pass to be used by the agents. */
Expand Down Expand Up @@ -187,7 +187,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help_authd();
help_authd(0);
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -257,7 +257,7 @@ int main(int argc, char **argv)
server_key = optarg;
break;
default:
help_authd();
help_authd(1);
break;
}
}
Expand Down
Loading