From ec54b9ac5edf8b75d4391192dfa0ea5552d96c10eefecac1a571ad3dd2670bbc Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Wed, 17 May 2017 09:53:50 +0000 Subject: [PATCH] - Allow opening capture files from desktop without asking for privileged credentials. bsc#1039454 OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=210 --- wireshark.changes | 6 ++++++ wireshark.spec | 31 ++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/wireshark.changes b/wireshark.changes index 5d527c9..174ef7c 100644 --- a/wireshark.changes +++ b/wireshark.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 17 09:51:33 UTC 2017 - astieger@suse.com + +- Allow opening capture files from desktop without asking for + privileged credentials. bsc#1039454 + ------------------------------------------------------------------- Fri Apr 14 08:46:58 UTC 2017 - astieger@suse.com diff --git a/wireshark.spec b/wireshark.spec index 2dd5b8f..6cac4d7 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -205,17 +205,16 @@ echo "`grep %{name}-%{version}.tar.bz2 %{SOURCE2} | grep SHA256 | head -n1 | cut %if ! %{use_caps} %patch1 -p1 +# open capture files without root privileges bsc#1025714 +for X in wireshark{,-gtk}.desktop; do + cp -pv $X ${X/wireshark/wireshark-file} + echo "NoDisplay=true" >> ${X/wireshark/wireshark-file} +done +sed -i '/^MimeType.*/d' wireshark{,-gtk}.desktop # run as root if not using caps -sed -i 's!^Exec=wireshark!Exec=%{_bindir}/xdg-su -c %{_bindir}/wireshark!' wireshark.desktop -%endif - -sed -i 's/^Icon=wireshark.png$/Icon=wireshark/' wireshark.desktop -%if %{with gtk} -sed \ - -e 's/^Name.*Wireshark/& (GTK)/' \ - -e 's/^Icon=wireshark/&-gtk/' \ - -e '/Exec=/s/wireshark/&-gtk/g' %{name}.desktop > %{name}-gtk.desktop +sed -i 's!^Exec=wireshark!Exec=%{_bindir}/xdg-su -c %{_bindir}/wireshark!' wireshark{,-gtk}.desktop %endif +sed -i 's/^Icon=wireshark.png$/Icon=wireshark/' wireshark*.desktop %build export CFLAGS="%{optflags} -fPIC" @@ -300,6 +299,10 @@ install -m 644 wsutil/*.h "${IDIR}/wsutil" install -D -m 0644 image/wsicon48.png %{buildroot}%{_datadir}/pixmaps/wireshark-gtk.png install -D -m 0644 wireshark-gtk.desktop %{buildroot}%{_datadir}/applications/wireshark-gtk.desktop %suse_update_desktop_file -n %{name}-gtk +%if ! %{use_caps} +install -D -m 0644 wireshark-file-gtk.desktop %{buildroot}%{_datadir}/applications/wireshark-file-gtk.desktop +%suse_update_desktop_file -n %{name}-file-gtk +%endif %else # sometimes the gtk.desktop gets autoinstalled by make_install rm -f %{buildroot}%{_datadir}/applications/wireshark-gtk.desktop @@ -309,6 +312,10 @@ rm -f %{buildroot}%{_datadir}/applications/wireshark-gtk.desktop install -D -m 0644 image/wsicon48.png %{buildroot}%{_datadir}/pixmaps/wireshark.png install -D -m 0644 wireshark.desktop %{buildroot}%{_datadir}/applications/wireshark.desktop %suse_update_desktop_file %{name} +%if ! %{use_caps} +install -D -m 0644 wireshark-file.desktop %{buildroot}%{_datadir}/applications/wireshark-file.desktop +%suse_update_desktop_file %{name}-file +%endif %else rm -f %{buildroot}%{_datadir}/applications/wireshark.desktop %endif @@ -398,6 +405,9 @@ exit 0 %{_bindir}/wireshark-gtk %{_bindir}/ethereal %{_datadir}/applications/wireshark-gtk.desktop +%if ! %{use_caps} +%{_datadir}/applications/wireshark-file-gtk.desktop +%endif %{_datadir}/pixmaps/wireshark-gtk.png %post ui-gtk @@ -421,6 +431,9 @@ test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null | %dir %{_datadir}/appdata %{_datadir}/appdata/wireshark.appdata.xml %{_datadir}/applications/wireshark.desktop +%if ! %{use_caps} +%{_datadir}/applications/wireshark-file.desktop +%endif %{_datadir}/pixmaps/wireshark.png %post ui-qt