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/udpdump.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/udpdump.c')
-rw-r--r-- | extcap/udpdump.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/extcap/udpdump.c b/extcap/udpdump.c index c1636b7c94..4539918fdd 100644 --- a/extcap/udpdump.c +++ b/extcap/udpdump.c @@ -47,6 +47,7 @@ #include <wsutil/strtoi.h> #include <wsutil/inet_addr.h> #include <wsutil/filesystem.h> +#include <wsutil/privileges.h> #include <cli_main.h> @@ -358,6 +359,7 @@ static void run_listener(const char* fifo, const guint16 port, const char* proto int main(int argc, char *argv[]) { + char* init_progfile_dir_error; int option_idx = 0; int result; guint16 port = 0; @@ -371,6 +373,22 @@ int main(int argc, char *argv[]) WSADATA wsaData; #endif /* _WIN32 */ + /* + * 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); + } + help_url = data_file_url("udpdump.html"); extcap_base_set_util_info(extcap_conf, argv[0], UDPDUMP_VERSION_MAJOR, UDPDUMP_VERSION_MINOR, UDPDUMP_VERSION_RELEASE, help_url); |