suricata: can't use -l and unix socket runmode

It is not possible to use simultaneously -l and unix socket
runmode because setting the log directory make it final so
not modifable by other call.

It is a implementation limitation but it does not make sense
to set logging directory to have it overwritten by the first
directory specified 'by pcap-file'. So it seems correct to
only trigger an error if this both options are used at the same
time.
pull/1799/head
Eric Leblond 10 years ago committed by Victor Julien
parent 2002b37e30
commit 93642a0d1d

@ -1108,6 +1108,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
int build_info = 0;
int conf_test = 0;
int engine_analysis = 0;
int set_log_directory = 0;
int ret = TM_ECODE_OK;
#ifdef UNITTESTS
@ -1580,6 +1581,8 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
"exist. Shutting down the engine.", optarg, optarg);
return TM_ECODE_FAILED;
}
set_log_directory = 1;
break;
case 'q':
#ifdef NFQ
@ -1714,6 +1717,11 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
return TM_ECODE_FAILED;
}
if ((suri->run_mode == RUNMODE_UNIX_SOCKET) && set_log_directory) {
SCLogError(SC_ERR_INITIALIZATION, "can't use -l and unix socket runmode at the same time");
return TM_ECODE_FAILED;
}
if (list_app_layer_protocols)
suri->run_mode = RUNMODE_LIST_APP_LAYERS;
if (list_cuda_cards)

Loading…
Cancel
Save