aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-10-24 00:44:36 -0700
committerGuy Harris <gharris@sonic.net>2020-10-24 00:44:36 -0700
commit4fd7983b04695bfc1ccf83b49559074bfd3a80d1 (patch)
tree549e0dac128dbb337cf21eb6df9b2d7f2a85dd1e
parent08f521fb63501e1cefa4cb58bf0b92d575bd0702 (diff)
dumpcap: fix the macOS "no permission to capture" message.
The macOS installer works differently from the way it did when that message was written (it's now a drag-install for Wireshark, with separate installers for ChmodBPF and for files to add the Wireshark binary directory to the default $PATH), and the macOS main screen now offers a "click this to install" link, running the ChmodBPF installer, if the user doesn't have permissions to capture. Update the message to reflect that (although that's wrong if you directly run dumpcap or run it via TShark - this needs to be cleaned up in some fashion). Fix a capitalization error while we're at it. In the code that generates the main screen message to which the dumpcap message refers, add a comment saying that, if the main screen message changes, dumpcap's message should also be updated.
-rw-r--r--dumpcap.c7
-rw-r--r--ui/qt/interface_frame.cpp11
2 files changed, 15 insertions, 3 deletions
diff --git a/dumpcap.c b/dumpcap.c
index c843ddb631..b7675fd78b 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -547,9 +547,10 @@ relinquish_all_capabilities(void)
#elif defined(__APPLE__)
#define PLATFORM_PERMISSIONS_SUGGESTION \
"\n\n" \
- "If you installed Wireshark using the package from wireshark.org, "\
- "Try re-installing it and checking the box for the \"Set capture " \
- "permissions on startup\" item."
+ "If you installed Wireshark using the package from wireshark.org, " \
+ "close this dialog and click on the \"installing ChmodBPF\" link in " \
+ "\"You can fix this by installing ChmodBPF.\" on the main screen, " \
+ "and then complete the installation procedure."
#else
#define PLATFORM_PERMISSIONS_SUGGESTION
#endif
diff --git a/ui/qt/interface_frame.cpp b/ui/qt/interface_frame.cpp
index e06fdf6ab7..ca3a407cef 100644
--- a/ui/qt/interface_frame.cpp
+++ b/ui/qt/interface_frame.cpp
@@ -303,6 +303,12 @@ void InterfaceFrame::resetInterfaceTreeDisplay()
if (!haveLocalCapturePermissions())
{
#ifdef Q_OS_MAC
+ //
+ // NOTE: if you change this text, you must also change the
+ // definition of PLATFORM_PERMISSIONS_SUGGESTION that is
+ // used if __APPLE__ is defined, so that it reflects the
+ // new message text.
+ //
QString install_chmodbpf_path = wsApp->applicationDirPath() + "/../Resources/Extras/Install ChmodBPF.pkg";
ui->warningLabel->setText(tr(
"<p>"
@@ -312,6 +318,11 @@ void InterfaceFrame::resetInterfaceTreeDisplay()
"</p>")
.arg(install_chmodbpf_path));
#else
+ //
+ // XXX - should this give similar platform-dependent recommendations,
+ // just as dumpcap gives platform-dependent recommendations in its
+ // PLATFORM_PERMISSIONS_SUGGESTION #define?
+ //
ui->warningLabel->setText(tr("You don't have permission to capture on local interfaces."));
#endif
}