forked from osmocom/wireshark
Drop privileges even earlier.
Do it at the same point at which Wireshark does so. Do some other things in the same order as well. Change-Id: I2925366d49d14271ceffa1a938b5e3450337c772 Reviewed-on: https://code.wireshark.org/review/2743 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
9485392687
commit
0cf54e7827
36
tfshark.c
36
tfshark.c
|
@ -796,22 +796,6 @@ main(int argc, char *argv[])
|
|||
|
||||
cmdarg_err_init(failure_message, failure_message_cont);
|
||||
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
get_runtime_version_info(runtime_info_str, NULL);
|
||||
|
||||
/* Add it to the information to be reported on a crash. */
|
||||
ws_add_crash_info("TFShark %s\n"
|
||||
"\n"
|
||||
"%s"
|
||||
"\n"
|
||||
"%s",
|
||||
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
|
||||
|
||||
#ifdef _WIN32
|
||||
arg_list_utf_16to8(argc, argv);
|
||||
create_app_running_mutex();
|
||||
|
@ -838,6 +822,24 @@ main(int argc, char *argv[])
|
|||
init_progfile_dir_error);
|
||||
}
|
||||
|
||||
initialize_funnel_ops();
|
||||
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
get_runtime_version_info(runtime_info_str, NULL);
|
||||
|
||||
/* Add it to the information to be reported on a crash. */
|
||||
ws_add_crash_info("TFShark %s\n"
|
||||
"\n"
|
||||
"%s"
|
||||
"\n"
|
||||
"%s",
|
||||
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
|
||||
|
||||
/*
|
||||
* In order to have the -X opts assigned before the wslua machine starts
|
||||
* we need to call getopts before epan_init() gets called.
|
||||
|
@ -909,8 +911,6 @@ main(int argc, char *argv[])
|
|||
(GLogLevelFlags)log_flags,
|
||||
tfshark_log_handler, NULL /* user_data */);
|
||||
|
||||
initialize_funnel_ops();
|
||||
|
||||
init_report_err(failure_message, open_failure_message, read_failure_message,
|
||||
write_failure_message);
|
||||
|
||||
|
|
58
tshark.c
58
tshark.c
|
@ -1002,35 +1002,8 @@ main(int argc, char *argv[])
|
|||
|
||||
static const char optstring[] = OPTSTRING;
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Load wpcap if possible. Do this before collecting the run-time version information */
|
||||
load_wpcap();
|
||||
|
||||
/* Warn the user if npf.sys isn't loaded. */
|
||||
if (!npf_sys_is_running() && get_windows_major_version() >= 6) {
|
||||
fprintf(stderr, "The NPF driver isn't running. You may have trouble "
|
||||
"capturing or\nlisting interfaces.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
cmdarg_err_init(failure_message, failure_message_cont);
|
||||
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
get_runtime_version_info(runtime_info_str, get_tshark_runtime_info);
|
||||
|
||||
/* Add it to the information to be reported on a crash. */
|
||||
ws_add_crash_info("TShark %s\n"
|
||||
"\n"
|
||||
"%s"
|
||||
"\n"
|
||||
"%s",
|
||||
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
|
||||
|
||||
#ifdef _WIN32
|
||||
arg_list_utf_16to8(argc, argv);
|
||||
create_app_running_mutex();
|
||||
|
@ -1057,6 +1030,35 @@ main(int argc, char *argv[])
|
|||
init_progfile_dir_error);
|
||||
}
|
||||
|
||||
initialize_funnel_ops();
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Load wpcap if possible. Do this before collecting the run-time version information */
|
||||
load_wpcap();
|
||||
|
||||
/* Warn the user if npf.sys isn't loaded. */
|
||||
if (!npf_sys_is_running() && get_windows_major_version() >= 6) {
|
||||
fprintf(stderr, "The NPF driver isn't running. You may have trouble "
|
||||
"capturing or\nlisting interfaces.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
get_runtime_version_info(runtime_info_str, get_tshark_runtime_info);
|
||||
|
||||
/* Add it to the information to be reported on a crash. */
|
||||
ws_add_crash_info("TShark %s\n"
|
||||
"\n"
|
||||
"%s"
|
||||
"\n"
|
||||
"%s",
|
||||
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
|
||||
|
||||
/*
|
||||
* In order to have the -X opts assigned before the wslua machine starts
|
||||
* we need to call getopts before epan_init() gets called.
|
||||
|
@ -1141,8 +1143,6 @@ main(int argc, char *argv[])
|
|||
tshark_log_handler, NULL /* user_data */);
|
||||
#endif
|
||||
|
||||
initialize_funnel_ops();
|
||||
|
||||
init_report_err(failure_message, open_failure_message, read_failure_message,
|
||||
write_failure_message);
|
||||
|
||||
|
|
Loading…
Reference in New Issue