AC_CHECK_HEADERS([sys/time.h time.h unistd.h])
AC_CHECK_HEADERS([sys/ioctl.h linux/if_ether.h linux/if_packet.h linux/filter.h])
AC_CHECK_HEADERS([linux/ethtool.h linux/sockios.h])
- AC_CHECK_HEADER(glob.h,,[AC_ERROR(glob.h not found ...)])
+ AC_CHECK_HEADERS([glob.h])
AC_CHECK_HEADERS([dirent.h fnmatch.h])
AC_CHECK_HEADERS([sys/resource.h sys/types.h sys/un.h])
AC_CHECK_HEADERS([sys/random.h])
#include "util-mpm-ac.h"
#include "runmodes.h"
+#ifdef HAVE_GLOB_H
#include <glob.h>
+#endif
extern int rule_reload;
static int ProcessSigFiles(DetectEngineCtx *de_ctx, char *pattern,
SigFileLoaderStat *st, int *good_sigs, int *bad_sigs)
{
+ int r = 0;
+
if (pattern == NULL) {
SCLogError(SC_ERR_INVALID_ARGUMENT, "opening rule file null");
return -1;
}
+#ifdef HAVE_GLOB_H
glob_t files;
- int r = glob(pattern, 0, NULL, &files);
+ r = glob(pattern, 0, NULL, &files);
if (r == GLOB_NOMATCH) {
SCLogWarning(SC_ERR_NO_RULES, "No rule files match the pattern %s", pattern);
char *fname = files.gl_pathv[i];
if (strcmp("/dev/null", fname) == 0)
continue;
+#else
+ char *fname = pattern;
+ if (strcmp("/dev/null", fname) == 0)
+ return 0;
+#endif
SCLogConfig("Loading rule file: %s", fname);
r = DetectLoadSigFile(de_ctx, fname, good_sigs, bad_sigs);
st->good_sigs_total += *good_sigs;
st->bad_sigs_total += *bad_sigs;
+#ifdef HAVE_GLOB_H
}
-
globfree(&files);
+#endif
return r;
}