|
|
@ -1435,8 +1435,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
|
|
|
|
fprintf(stderr, "ERROR: Unit tests not enabled. Make sure to pass --enable-unittests to configure when building.\n");
|
|
|
|
fprintf(stderr, "ERROR: Unit tests not enabled. Make sure to pass --enable-unittests to configure when building.\n");
|
|
|
|
return TM_ECODE_FAILED;
|
|
|
|
return TM_ECODE_FAILED;
|
|
|
|
#endif /* UNITTESTS */
|
|
|
|
#endif /* UNITTESTS */
|
|
|
|
}
|
|
|
|
} else if (strcmp((long_opts[option_index]).name, "user") == 0) {
|
|
|
|
else if(strcmp((long_opts[option_index]).name, "user") == 0) {
|
|
|
|
|
|
|
|
#ifndef HAVE_LIBCAP_NG
|
|
|
|
#ifndef HAVE_LIBCAP_NG
|
|
|
|
SCLogError(SC_ERR_LIBCAP_NG_REQUIRED, "libcap-ng is required to"
|
|
|
|
SCLogError(SC_ERR_LIBCAP_NG_REQUIRED, "libcap-ng is required to"
|
|
|
|
" drop privileges, but it was not compiled into Suricata.");
|
|
|
|
" drop privileges, but it was not compiled into Suricata.");
|
|
|
@ -1445,8 +1444,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
|
|
|
|
suri->user_name = optarg;
|
|
|
|
suri->user_name = optarg;
|
|
|
|
suri->do_setuid = TRUE;
|
|
|
|
suri->do_setuid = TRUE;
|
|
|
|
#endif /* HAVE_LIBCAP_NG */
|
|
|
|
#endif /* HAVE_LIBCAP_NG */
|
|
|
|
}
|
|
|
|
} else if (strcmp((long_opts[option_index]).name, "group") == 0) {
|
|
|
|
else if(strcmp((long_opts[option_index]).name, "group") == 0) {
|
|
|
|
|
|
|
|
#ifndef HAVE_LIBCAP_NG
|
|
|
|
#ifndef HAVE_LIBCAP_NG
|
|
|
|
SCLogError(SC_ERR_LIBCAP_NG_REQUIRED, "libcap-ng is required to"
|
|
|
|
SCLogError(SC_ERR_LIBCAP_NG_REQUIRED, "libcap-ng is required to"
|
|
|
|
" drop privileges, but it was not compiled into Suricata.");
|
|
|
|
" drop privileges, but it was not compiled into Suricata.");
|
|
|
@ -1455,15 +1453,13 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
|
|
|
|
suri->group_name = optarg;
|
|
|
|
suri->group_name = optarg;
|
|
|
|
suri->do_setgid = TRUE;
|
|
|
|
suri->do_setgid = TRUE;
|
|
|
|
#endif /* HAVE_LIBCAP_NG */
|
|
|
|
#endif /* HAVE_LIBCAP_NG */
|
|
|
|
}
|
|
|
|
} else if (strcmp((long_opts[option_index]).name, "erf-in") == 0) {
|
|
|
|
else if (strcmp((long_opts[option_index]).name, "erf-in") == 0) {
|
|
|
|
|
|
|
|
suri->run_mode = RUNMODE_ERF_FILE;
|
|
|
|
suri->run_mode = RUNMODE_ERF_FILE;
|
|
|
|
if (ConfSetFinal("erf-file.file", optarg) != 1) {
|
|
|
|
if (ConfSetFinal("erf-file.file", optarg) != 1) {
|
|
|
|
fprintf(stderr, "ERROR: Failed to set erf-file.file\n");
|
|
|
|
fprintf(stderr, "ERROR: Failed to set erf-file.file\n");
|
|
|
|
return TM_ECODE_FAILED;
|
|
|
|
return TM_ECODE_FAILED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (strcmp((long_opts[option_index]).name, "dag") == 0) {
|
|
|
|
else if (strcmp((long_opts[option_index]).name, "dag") == 0) {
|
|
|
|
|
|
|
|
#ifdef HAVE_DAG
|
|
|
|
#ifdef HAVE_DAG
|
|
|
|
if (suri->run_mode == RUNMODE_UNKNOWN) {
|
|
|
|
if (suri->run_mode == RUNMODE_UNKNOWN) {
|
|
|
|
suri->run_mode = RUNMODE_DAG;
|
|
|
|
suri->run_mode = RUNMODE_DAG;
|
|
|
|