Skip to content

Commit

Permalink
Description: Added -V switch to all daemons
Browse files Browse the repository at this point in the history
Reviewed by: Daniel Cid, coded by Meir Michanie
Bug:
  • Loading branch information
meirm committed Sep 4, 2006
1 parent 1855103 commit aeb3d57
Show file tree
Hide file tree
Showing 13 changed files with 391 additions and 10 deletions.
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/addagent/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ int main(int argc, char **argv)
case 'Q':
printf(EXIT);
exit(0);
case 'V':
print_version();
break;
default:
printf("\n ** Invalid Action ** \n\n");
break;
Expand Down
5 changes: 4 additions & 1 deletion src/analysisd/analysisd.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ int main(int argc, char **argv)
memset(prev_month, '\0', 4);
hourly_alerts = 0;

while((c = getopt(argc, argv, "tdhu:g:D:c:")) != -1){
while((c = getopt(argc, argv, "Vtdhu:g:D:c:")) != -1){
switch(c){
case 'V':
print_version();
break;
case 'h':
help();
break;
Expand Down
5 changes: 4 additions & 1 deletion src/client-agent/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ int main(int argc, char **argv)
OS_SetName(ARGV0);


while((c = getopt(argc, argv, "tdhu:g:D:")) != -1){
while((c = getopt(argc, argv, "Vtdhu:g:D:")) != -1){
switch(c){
case 'V':
print_version();
break;
case 'h':
help();
break;
Expand Down
8 changes: 6 additions & 2 deletions src/headers/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@

/* Some Global names */
#define __name "OSSEC HIDS"
#define __version "v0.9-1"
#define __version "v0.9-1b"
#define __author "Daniel B. Cid"
#define __contact "[email protected]"
#define __site "http://www.ossec.net"

#define __license "\
This program is free software; you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
the Free Software Foundation; either version 2 of the License, or\n\
(at your option) any later version.\n"

/* Maximum allowed PID */
#ifdef SOLARIS
Expand Down
1 change: 1 addition & 0 deletions src/headers/help.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@

#define __HELP_H
void help();
void print_version();

#endif
5 changes: 4 additions & 1 deletion src/logcollector/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ int main(int argc, char **argv)
OS_SetName(ARGV0);


while((c = getopt(argc, argv, "tdhD:c:")) != -1)
while((c = getopt(argc, argv, "VtdhD:c:")) != -1)
{
switch(c)
{
case 'V':
print_version();
break;
case 'h':
help();
break;
Expand Down
5 changes: 4 additions & 1 deletion src/monitord/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ int main(int argc, char **argv)
OS_SetName(ARGV0);


while((c = getopt(argc, argv, "dhtu:g:D:c:")) != -1){
while((c = getopt(argc, argv, "Vdhtu:g:D:c:")) != -1){
switch(c){
case 'V':
print_version();
break;
case 'h':
help();
break;
Expand Down
5 changes: 4 additions & 1 deletion src/os_maild/maild.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ int main(int argc, char **argv)
OS_SetName(ARGV0);


while((c = getopt(argc, argv, "dhtu:g:D:c:")) != -1){
while((c = getopt(argc, argv, "Vdhtu:g:D:c:")) != -1){
switch(c){
case 'V':
print_version();
break;
case 'h':
help();
break;
Expand Down
5 changes: 4 additions & 1 deletion src/remoted/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ int main(int argc, char **argv)
OS_SetName(ARGV0);


while((c = getopt(argc, argv, "dthu:g:D:")) != -1){
while((c = getopt(argc, argv, "Vdthu:g:D:")) != -1){
switch(c){
case 'V':
print_version();
break;
case 'h':
help();
break;
Expand Down
5 changes: 4 additions & 1 deletion src/rootcheck/rootcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ int rootcheck_init(int test_config)
#ifndef OSSECHIDS
rootcheck.notify = SYSLOG;
rootcheck.daemon = 0;
while((c = getopt(argc, argv, "strdhD:c:")) != -1)
while((c = getopt(argc, argv, "VstrdhD:c:")) != -1)
{
switch(c)
{
case 'V':
print_version();
break;
case 'h':
rootcheck_help();
break;
Expand Down
10 changes: 10 additions & 0 deletions src/shared/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void help()
{
print_out("");
print_out(" %s: -[thd] [-u user] [-g group] [-c config]",daemons[i]);
print_out(" -V Version and license message");
print_out(" -h This help message");
print_out(" -d Execute in debug mode");
print_out(" -t Test configuration");
Expand All @@ -45,4 +46,13 @@ void help()
exit(1);
}

void print_version()
{
print_out("");
print_out("%s %s - %s", __name, __version, __author);
print_out("");
print_out("%s",__license);
exit(1);
}

/* EOF */
5 changes: 4 additions & 1 deletion src/syscheckd/syscheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ int main(int argc, char **argv)
OS_SetName(ARGV0);


while((c = getopt(argc, argv, "tSsdhD:c:")) != -1)
while((c = getopt(argc, argv, "VtSsdhD:c:")) != -1)
{
switch(c)
{
case 'V':
print_version();
break;
case 's':
init = 1;
break;
Expand Down

0 comments on commit aeb3d57

Please sign in to comment.