Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug789 v1.2 part2 #443

Closed
wants to merge 16 commits into from
Closed
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
Empty file added config.rpath
Empty file.
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#TODO A better place for default CFLAGS?

AC_INIT(configure.ac)

AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(suricata, 2.0dev)
AC_INIT([suricata], [2.0dev])
AC_CONFIG_SRCDIR([src/suricata.c])
AM_INIT_AUTOMAKE

AC_LANG_C
AC_PROG_CC_C99
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ runmode-nfq.c runmode-nfq.h \
runmode-pcap.c runmode-pcap.h \
runmode-pcap-file.c runmode-pcap-file.h \
runmode-pfring.c runmode-pfring.h \
runmode-unittests.c runmode-unittests.h \
runmode-unix-socket.c runmode-unix-socket.h \
runmodes.c runmodes.h \
source-af-packet.c source-af-packet.h \
Expand Down Expand Up @@ -259,6 +260,7 @@ util-byte.c util-byte.h \
util-checksum.c util-checksum.h \
util-cidr.c util-cidr.h \
util-classification-config.c util-classification-config.h \
util-conf.c util-conf.h \
util-coredump-config.c util-coredump-config.h \
util-cpu.c util-cpu.h \
util-crypt.c util-crypt.h \
Expand Down Expand Up @@ -315,6 +317,7 @@ util-ringbuffer.c util-ringbuffer.h \
util-rohash.c util-rohash.h \
util-rule-vars.c util-rule-vars.h \
util-runmodes.c util-runmodes.h \
util-running-modes.c util-running-modes.h \
util-signal.c util-signal.h \
util-spm-bm.c util-spm-bm.h \
util-spm-bs2bm.c util-spm-bs2bm.h \
Expand All @@ -338,8 +341,7 @@ win32-syslog.h
EXTRA_DIST = util-mpm-ac-cuda-kernel.cu ptxdump.py

# set the include path found by configure
INCLUDES= $(all_includes)

AM_CPPFLAGS = $(all_includes)

# the library search path.
suricata_LDFLAGS = $(all_libraries)
Expand Down
3 changes: 1 addition & 2 deletions src/alert-pcapinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ static int AlertPcapInfoOpenFileCtx(LogFileCtx *file_ctx, const char *filename,
char log_path[PATH_MAX];
char *log_dir;

if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();

snprintf(log_path, PATH_MAX, "%s/%s", log_dir, filename);

Expand Down
3 changes: 1 addition & 2 deletions src/alert-unified2-alert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,7 @@ int Unified2AlertOpenFileCtx(LogFileCtx *file_ctx, const char *prefix)

/* create the filename to use */
char *log_dir;
if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();

snprintf(filename, PATH_MAX, "%s/%s.%" PRIu32, log_dir, prefix, (uint32_t)ts.tv_sec);

Expand Down
3 changes: 1 addition & 2 deletions src/counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ static char *SCPerfGetLogFilename(ConfNode *stats)
char *log_filename = NULL;
const char* filename = NULL;

if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();

if ( (log_filename = SCMalloc(PATH_MAX)) == NULL) {
return NULL;
Expand Down
3 changes: 2 additions & 1 deletion src/detect-csum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,7 @@ int DetectCsumICMPV6ValidArgsTestParse03(void) {
int DetectCsumICMPV6Test01(void)
{
int result = 0;
DetectEngineCtx *de_ctx = NULL;

Packet *p = PacketGetFromAlloc();
if (p == NULL) {
Expand Down Expand Up @@ -1520,7 +1521,7 @@ int DetectCsumICMPV6Test01(void)
StreamTcpInitConfig(TRUE);
FlowInitConfig(FLOW_QUIET);

DetectEngineCtx *de_ctx = DetectEngineCtxInit();
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
printf("DetectEngineCtxInit failure\n");
goto end;
Expand Down
6 changes: 2 additions & 4 deletions src/detect-engine-analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ int SetupFPAnalyzer(void)
return 0;

char *log_dir;
if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();
snprintf(log_path, sizeof(log_path), "%s/%s", log_dir,
"rules_fast_pattern.txt");

Expand Down Expand Up @@ -243,8 +242,7 @@ int SetupRuleAnalyzer(void)
}
if (enabled) {
char *log_dir;
if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();
snprintf(log_path, sizeof(log_path), "%s/%s", log_dir, "rules_analysis.txt");
rule_engine_analysis_FD = fopen(log_path, "w");
if (rule_engine_analysis_FD == NULL) {
Expand Down
3 changes: 1 addition & 2 deletions src/log-filestore.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,7 @@ static OutputCtx *LogFilestoreLogInitCtx(ConfNode *conf)
output_ctx->DeInit = LogFilestoreLogDeInitCtx;

char *s_default_log_dir = NULL;
if (ConfGet("default-log-dir", &s_default_log_dir) != 1)
s_default_log_dir = DEFAULT_LOG_DIR;
s_default_log_dir = GetLogDirectory();

const char *s_base_dir = NULL;
s_base_dir = ConfNodeLookupChildValue(conf, "log-dir");
Expand Down
6 changes: 2 additions & 4 deletions src/log-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,7 @@ OutputCtx *PcapLogInitCtx(ConfNode *conf)
exit(EXIT_FAILURE);
} else {
char *log_dir = NULL;
if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();

strlcpy(pl->dir,
log_dir, sizeof(pl->dir));
Expand All @@ -476,8 +475,7 @@ OutputCtx *PcapLogInitCtx(ConfNode *conf)
s_dir, sizeof(pl->dir));
} else {
char *log_dir = NULL;
if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
log_dir = GetLogDirectory();

snprintf(pl->dir, sizeof(pl->dir), "%s/%s",
log_dir, s_dir);
Expand Down
3 changes: 1 addition & 2 deletions src/log-tlslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,7 @@ OutputCtx *LogTlsLogInitCtx(ConfNode *conf)
}

char *s_default_log_dir = NULL;
if (ConfGet("default-log-dir", &s_default_log_dir) != 1)
s_default_log_dir = DEFAULT_LOG_DIR;
s_default_log_dir = GetLogDirectory();

const char *s_base_dir = NULL;
s_base_dir = ConfNodeLookupChildValue(conf, "certs-log-dir");
Expand Down
Loading