main: Finish processing program arguments before setting up SSL/sqlite

This commit is contained in:
Tim Wojtulewicz 2019-08-26 10:29:43 -07:00
parent 0699b28893
commit 7edebe179f

View file

@ -660,6 +660,9 @@ int main(int argc, char** argv)
break;
}
if ( interfaces.length() > 0 && read_files.length() > 0 )
usage(1);
atexit(atexit_handler);
set_processing_status("INITIALIZING", "main");
@ -688,17 +691,14 @@ int main(int argc, char** argv)
SSL_library_init();
SSL_load_error_strings();
int r = sqlite3_initialize();
if ( r != SQLITE_OK )
reporter->Error("Failed to initialize sqlite3: %s", sqlite3_errstr(r));
// FIXME: On systems that don't provide /dev/urandom, OpenSSL doesn't
// seed the PRNG. We should do this here (but at least Linux, FreeBSD
// and Solaris provide /dev/urandom).
if ( interfaces.length() > 0 && read_files.length() > 0 )
usage(1);
int r = sqlite3_initialize();
if ( r != SQLITE_OK )
reporter->Error("Failed to initialize sqlite3: %s", sqlite3_errstr(r));
#ifdef USE_IDMEF
char* libidmef_dtd_path_cstr = new char[libidmef_dtd_path.length() + 1];