Skip to content

Commit

Permalink
More code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Champ Clark III committed Oct 7, 2014
1 parent e8326df commit 3691afc
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 28 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = ${SHELL} /home/champ/code/sagan/missing aclocal-1.14
ACLOCAL = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing aclocal-1.14
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AUTOCONF = ${SHELL} /home/champ/code/sagan/missing autoconf
AUTOHEADER = ${SHELL} /home/champ/code/sagan/missing autoheader
AUTOMAKE = ${SHELL} /home/champ/code/sagan/missing automake-1.14
AUTOCONF = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing autoconf
AUTOHEADER = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing autoheader
AUTOMAKE = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing automake-1.14
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
Expand Down Expand Up @@ -231,7 +231,7 @@ LIBOBJS =
LIBS = -ldnet -llognorm -lestr -lm -lpthread -lpcre
LTLIBOBJS =
MAINT = #
MAKEINFO = ${SHELL} /home/champ/code/sagan/missing makeinfo
MAKEINFO = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing makeinfo
MKDIR_P = /bin/mkdir -p
OBJEXT = o
PACKAGE = sagan
Expand All @@ -249,10 +249,10 @@ SET_MAKE =
SHELL = /bin/sh
STRIP =
VERSION = 1.0.0-RC4
abs_builddir = /home/champ/code/sagan
abs_srcdir = /home/champ/code/sagan
abs_top_builddir = /home/champ/code/sagan
abs_top_srcdir = /home/champ/code/sagan
abs_builddir = /home/champ/code/release-1.0.0RC4/sagan
abs_srcdir = /home/champ/code/release-1.0.0RC4/sagan
abs_top_builddir = /home/champ/code/release-1.0.0RC4/sagan
abs_top_srcdir = /home/champ/code/release-1.0.0RC4/sagan
ac_ct_CC = gcc
am__include = include
am__leading_dot = .
Expand All @@ -279,7 +279,7 @@ host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/champ/code/sagan/install-sh
install_sh = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
Expand Down
14 changes: 7 additions & 7 deletions config.status
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='/home/champ/code/sagan'
ac_pwd='/home/champ/code/release-1.0.0RC4/sagan'
srcdir='.'
INSTALL='/usr/bin/install -c'
MKDIR_P='/bin/mkdir -p'
Expand Down Expand Up @@ -652,12 +652,12 @@ S["mkdir_p"]="$(MKDIR_P)"
S["MKDIR_P"]="/bin/mkdir -p"
S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
S["STRIP"]=""
S["install_sh"]="${SHELL} /home/champ/code/sagan/install-sh"
S["MAKEINFO"]="${SHELL} /home/champ/code/sagan/missing makeinfo"
S["AUTOHEADER"]="${SHELL} /home/champ/code/sagan/missing autoheader"
S["AUTOMAKE"]="${SHELL} /home/champ/code/sagan/missing automake-1.14"
S["AUTOCONF"]="${SHELL} /home/champ/code/sagan/missing autoconf"
S["ACLOCAL"]="${SHELL} /home/champ/code/sagan/missing aclocal-1.14"
S["install_sh"]="${SHELL} /home/champ/code/release-1.0.0RC4/sagan/install-sh"
S["MAKEINFO"]="${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing makeinfo"
S["AUTOHEADER"]="${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing autoheader"
S["AUTOMAKE"]="${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing automake-1.14"
S["AUTOCONF"]="${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing autoconf"
S["ACLOCAL"]="${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing aclocal-1.14"
S["PACKAGE"]="sagan"
S["CYGPATH_W"]="echo"
S["am__isrc"]=""
Expand Down
5 changes: 3 additions & 2 deletions src/output-plugins/sagan-external.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void sagan_ext_thread ( _SaganEvent *Event )
char buf[MAX_SYSLOGMSG];
char data[MAX_SYSLOGMSG];
char tmpref[2048];
int ret;
// int ret;
char tmp[6];

if ( debug->debugexternal ) Sagan_Log(S_WARN, "[%s, line %d] In sagan_ext_thread()", __FILE__, __LINE__);
Expand Down Expand Up @@ -128,7 +128,8 @@ void sagan_ext_thread ( _SaganEvent *Event )
close(out[0]);
pthread_mutex_unlock( &ext_mutex );

ret=execl(config->sagan_extern, config->sagan_extern, NULL, (char *)NULL);
//ret=execl(config->sagan_extern, config->sagan_extern, NULL, (char *)NULL);
execl(config->sagan_extern, config->sagan_extern, NULL, (char *)NULL);
Remove_Lock_File();
Sagan_Log(S_WARN, "[%s, line %d] Cannot execute %s", __FILE__, __LINE__, config->sagan_extern);
}
Expand Down
3 changes: 1 addition & 2 deletions src/sagan-classifications.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ void Load_Classifications( const char *ruleset )

char classbuf[CLASSBUF];
char *saveptr=NULL;
char *firststring=NULL;
char *tmptoken=NULL;
char *laststring=NULL;
char tmpbuf2[5];
Expand Down Expand Up @@ -94,7 +93,7 @@ void Load_Classifications( const char *ruleset )
classstruct = (_Class_Struct *) realloc(classstruct, (counters->classcount+1) * sizeof(_Class_Struct));
}

firststring = strtok_r(classbuf, ":", &saveptr);
strtok_r(classbuf, ":", &saveptr);
tmptoken = strtok_r(NULL, ":" , &saveptr);

laststring = strtok_r(tmptoken, ",", &saveptr);
Expand Down
2 changes: 1 addition & 1 deletion src/sagan-flowbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ int Sagan_Flowbit_Condition(int rule_position, char *ip_src_char, char *ip_dst_c
*
*/

if ( rulestruct[rule_position].flowbit_condition_count == flowbit_total_match || and_or == 1 && flowbit_total_match != 0 )
if ( ( rulestruct[rule_position].flowbit_condition_count == flowbit_total_match ) || ( and_or == 1 && flowbit_total_match != 0 ) )
{

if ( debug->debugflowbit)
Expand Down
5 changes: 4 additions & 1 deletion src/sagan-processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ void Sagan_Processor ( void )
sbool ignore_flag=0;

int i;
int rc;

#ifdef WITH_WEBSENSE
int rc; /* Return code for Websense */
#endif

for (;;)
{
Expand Down
3 changes: 1 addition & 2 deletions src/sagan-references.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ void Load_Reference( const char *ruleset )

char refbuf[1024];
char *saveptr=NULL;
char *firststring=NULL;
char *tmptoken=NULL;
char *laststring=NULL;

Expand Down Expand Up @@ -95,7 +94,7 @@ void Load_Reference( const char *ruleset )
refstruct = (_Ref_Struct *) realloc(refstruct, (counters->refcount+1) * sizeof(_Ref_Struct));
}

firststring = strtok_r(refbuf, ":", &saveptr);
strtok_r(refbuf, ":", &saveptr);
tmptoken = strtok_r(NULL, " " , &saveptr);

laststring = strtok_r(tmptoken, ",", &saveptr);
Expand Down
5 changes: 2 additions & 3 deletions src/sagan-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ sbool daemonize;
void Chroot(const char *username, const char *chrootdir )
{

struct passwd *pw = NULL;

pw = getpwnam(username);
// struct passwd *pw = NULL;
// pw = getpwnam(username);

printf("[*] Chroot to %s\n", chrootdir);

Expand Down
1 change: 1 addition & 0 deletions src/sagan.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,5 @@ int Sagan_Validate_HEX (const char *);
char *Sagan_Content_Pipe(char *, int, const char *);
sbool is_rfc1918 ( char * );
char *Sagan_Replace_Sagan( char *, char *);
int Sagan_Character_Count ( char *, char *);

0 comments on commit 3691afc

Please sign in to comment.