Hi, Locally compiled Wireshark 1.12.8 Help>Authors tab is throwing error dialogue with error "Could not open file" / "No such file"in linux system. The AUTHORS-SHORT are stored in share/wireshark directory. I checked the the path having the file after installation. Compilation is done with gtk2. The problem is that it is taking the path at the time of compilation instead of the path at the time of installation. asked 08 Feb '16, 05:14 Abhisek edited 08 Feb '16, 07:53 grahamb ♦ showing 5 of 12 show 7 more comments |
One Answer:
I changed the files below accordingly and it works for me: epan/filesystem.c::get_datafile_path()->get_datafile_dir(). commented all if condition() with started_with_special_privs() to cope up with special privilage. Thanks. answered 30 Jan '17, 04:18 Abhisek |
This is an install of Wireshark that you've compiled yourself?
yes it is compiled in local. the share/wireshark path shown in error is same as after compiled path. need to set any environment variable?
This is Linux, right? What build system did you use? (cmake or autotools (./configure etc.))? I suspect you used cmake but want to be sure.
yes that is santiago (RHEL). autotools (./configure --prefix=<absolute path="" of="" binary=""> --with-gtk2=yes ....) is used.
Oh, sorry, another question: did you "make install" yet or are you running from the build directory? (Or did you build an RPM and then install that?)
see i did make install... ok the binary is running well where i did make install... Now i ported the bin,lib and share folder to another linux machine and stated ./wireshark... then the problem started...
After doing "make install" were you still running "./wireshark" (from the build directory)? Or, put another way, are you sure you were running the copy you installed?
Note that with autotools ./wireshark in the build directory is a shell script which does a bunch work to allow it to work properly when run from the build environment (for example looking in a different location for the AUTHORS file among other differences). "make install" puts the actual Wireshark binary in the installed directory (no more shell-script wrapper).
On the 2nd machine (with the copy of the install) do you have an environment variable WIRESHARK_RUN_FROM_BUILD_DIRECTORY set? That should only be set when Wireshark is running from the build directory.
BTW, why not build an RPM ("make rpm-package") and install that on the 2nd machine?
Ok, how check the WIRESHARK_RUN_FROM_BUILD_DIRECTORY flag in 2nd machine? printenv not showing that flag itself...
Currently i am running ./autogen.sh, ./configur,make, make install to get the binary in build machine.Could you please share the process of make rpm-package?
If printenv doesn't show it then it's not set. I assume that the AUTHORS file is actually present in the share directory on the 2nd machine?
If you're not modifying Wireshark's source code or using any ./configure options other than specifying gtk2 and optionally the prefix then all you need to do is
make rpm-package
instead ofmake install
(in fact themake
step is also not necessary).If you are using some special ./configure options then you'll need to edit
packaging/rpm/SPECS/wireshark.spec.in
to reflect those options.If you plan to install Wireshark on a machine other than what you compiled on then building the RPM really is the best way to go regardless of what's causing the current problem.
See the developer's guide directions for building packages too.
Thanks for your comments @JeffMorriss , I had changed the source code of about_dlg.c and made a binary for thst particular remote machine. this is a work around of this problem. but still to make this binary work for any system need to dig the rpm build option more. So i kept this question open for suggestion. Becuase i didn't find what exactly to change to packaging/rpm/SPECS/wireshark.spec.in file. Any lead???
Well, it really depends. As mentioned earlier most people don't NEED to change wireshark.spec.in . But if your options aren't taken into account by the configure/spec logic then you'd simply have to change the configure options in
packaging/rpm/SPECS/wireshark.spec.in
, re-run ./configure, and then build the RPM.Thanks All!!! The Actual RootCause: the binary is compiled with root permission, and the configure option is like
./configure --prefix=<path to store binary> --with-gtk2=yes --disable-glibtest
Now in other machine, the compiled binary is also run with root permission. so it will set prefix to
<path to store binary>
in second machine also. The Authors is having path set relative to prefix which is the path of first machine, so unable to get the path.Work Around:
wsutil/filesystem.c
is having the set path functions, so every decision making case uncheck root user, so it will set prefix from environment variable.