instance: set system vs user mode

pull/3777/head
Victor Julien 7 years ago
parent 231496f165
commit 86ed5815cb

@ -492,6 +492,19 @@ int RunModeOutputFiledataEnabled(void)
return filedata_logger_count > 0; return filedata_logger_count > 0;
} }
bool IsRunModeSystem(enum RunModes run_mode_to_check)
{
switch (run_mode_to_check) {
case RUNMODE_PCAP_FILE:
case RUNMODE_ERF_FILE:
case RUNMODE_ENGINE_ANALYSIS:
return false;
break;
default:
return true;
}
}
bool IsRunModeOffline(int run_mode_to_check) bool IsRunModeOffline(int run_mode_to_check)
{ {
switch(run_mode_to_check) { switch(run_mode_to_check) {

@ -90,6 +90,7 @@ int RunModeOutputFileEnabled(void);
int RunModeOutputFiledataEnabled(void); int RunModeOutputFiledataEnabled(void);
/** bool indicating if run mode is offline */ /** bool indicating if run mode is offline */
bool IsRunModeOffline(int run_mode_to_check); bool IsRunModeOffline(int run_mode_to_check);
bool IsRunModeSystem(enum RunModes run_mode_to_check);
void RunModeEnablesBypassManager(void); void RunModeEnablesBypassManager(void);
int RunModeNeedsBypassManager(void); int RunModeNeedsBypassManager(void);

@ -2096,6 +2096,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
suri->run_mode = RUNMODE_ENGINE_ANALYSIS; suri->run_mode = RUNMODE_ENGINE_ANALYSIS;
suri->offline = IsRunModeOffline(suri->run_mode); suri->offline = IsRunModeOffline(suri->run_mode);
suri->system = IsRunModeSystem(suri->run_mode);
ret = SetBpfString(optind, argv); ret = SetBpfString(optind, argv);
if (ret != TM_ECODE_OK) if (ret != TM_ECODE_OK)

@ -150,6 +150,7 @@ typedef struct SCInstance_ {
uint32_t userid; uint32_t userid;
uint32_t groupid; uint32_t groupid;
#endif /* OS_WIN32 */ #endif /* OS_WIN32 */
bool system;
int delayed_detect; int delayed_detect;
int disabled_detect; int disabled_detect;
int daemon; int daemon;

Loading…
Cancel
Save