diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-07 19:56:22 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-08 02:57:53 +0000 |
commit | bbc8cbfb9c0f4b43834af43e518de085cc39fd6b (patch) | |
tree | 34dce617ae902a9569862f3fee19cf21f8d7bd89 /extcap/dpauxmon.c | |
parent | 9f575c8dc9a04c1eb4634cf525815ff226a5e1bf (diff) |
If you use data_file_url(), you must first call init_progfile_dir().
And if you call init_progfile_dir(), you must call
init_process_policies() before that.
And even if you *don't* use data_file_url(), you might use it in the
future, or you might use other calls to get data file paths, so make
*all* the extcap programs make those calls.
(Yes, this is important on macOS, for example; it may also be important
on Windows. On other UN*Xes we may just compile in the data file path,
but that's not true on *all* our platforms.)
Change-Id: I99265ed69ec24096884ec067feddd7d7f3855436
Reviewed-on: https://code.wireshark.org/review/32775
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'extcap/dpauxmon.c')
-rw-r--r-- | extcap/dpauxmon.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/extcap/dpauxmon.c b/extcap/dpauxmon.c index f16ec80d12..2058f96477 100644 --- a/extcap/dpauxmon.c +++ b/extcap/dpauxmon.c @@ -17,6 +17,7 @@ #include <wsutil/strtoi.h> #include <wsutil/filesystem.h> #include <wsutil/netlink.h> +#include <wsutil/privileges.h> #include <writecap/pcapio.h> #include <netlink/netlink.h> @@ -478,6 +479,7 @@ close_out: int main(int argc, char *argv[]) { + char* init_progfile_dir_error; int option_idx = 0; int result; unsigned int interface_id = 0; @@ -485,6 +487,22 @@ int main(int argc, char *argv[]) extcap_parameters* extcap_conf = g_new0(extcap_parameters, 1); char* help_header = NULL; + /* + * Get credential information for later use. + */ + init_process_policies(); + + /* + * Attempt to get the pathname of the directory containing the + * executable file. + */ + init_progfile_dir_error = init_progfile_dir(argv[0]); + if (init_progfile_dir_error != NULL) { + g_warning("Can't get pathname of directory containing the captype program: %s.", + init_progfile_dir_error); + g_free(init_progfile_dir_error); + } + extcap_base_set_util_info(extcap_conf, argv[0], DPAUXMON_VERSION_MAJOR, DPAUXMON_VERSION_MINOR, DPAUXMON_VERSION_RELEASE, NULL); extcap_base_register_interface(extcap_conf, DPAUXMON_EXTCAP_INTERFACE, "DisplayPort AUX channel monitor capture", 275, "DisplayPort AUX channel monitor"); |