SHA256
1
0
forked from pool/wireshark

Accepting request 495559 from network:utilities

Allow opening capture files from desktop without asking for privileged credentials. bsc#1025714

OBS-URL: https://build.opensuse.org/request/show/495559
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/wireshark?expand=0&rev=124
This commit is contained in:
Dominique Leuenberger 2017-05-17 15:19:14 +00:00 committed by Git OBS Bridge
commit 8eeb8aa1f6
2 changed files with 28 additions and 9 deletions

View File

@ -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#1025714
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Apr 14 08:46:58 UTC 2017 - astieger@suse.com Fri Apr 14 08:46:58 UTC 2017 - astieger@suse.com

View File

@ -205,17 +205,16 @@ echo "`grep %{name}-%{version}.tar.bz2 %{SOURCE2} | grep SHA256 | head -n1 | cut
%if ! %{use_caps} %if ! %{use_caps}
%patch1 -p1 %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 # run as root if not using caps
sed -i 's!^Exec=wireshark!Exec=%{_bindir}/xdg-su -c %{_bindir}/wireshark!' wireshark.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
%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
%endif %endif
sed -i 's/^Icon=wireshark.png$/Icon=wireshark/' wireshark*.desktop
%build %build
export CFLAGS="%{optflags} -fPIC" 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 image/wsicon48.png %{buildroot}%{_datadir}/pixmaps/wireshark-gtk.png
install -D -m 0644 wireshark-gtk.desktop %{buildroot}%{_datadir}/applications/wireshark-gtk.desktop install -D -m 0644 wireshark-gtk.desktop %{buildroot}%{_datadir}/applications/wireshark-gtk.desktop
%suse_update_desktop_file -n %{name}-gtk %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 %else
# sometimes the gtk.desktop gets autoinstalled by make_install # sometimes the gtk.desktop gets autoinstalled by make_install
rm -f %{buildroot}%{_datadir}/applications/wireshark-gtk.desktop 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 image/wsicon48.png %{buildroot}%{_datadir}/pixmaps/wireshark.png
install -D -m 0644 wireshark.desktop %{buildroot}%{_datadir}/applications/wireshark.desktop install -D -m 0644 wireshark.desktop %{buildroot}%{_datadir}/applications/wireshark.desktop
%suse_update_desktop_file %{name} %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 %else
rm -f %{buildroot}%{_datadir}/applications/wireshark.desktop rm -f %{buildroot}%{_datadir}/applications/wireshark.desktop
%endif %endif
@ -398,6 +405,9 @@ exit 0
%{_bindir}/wireshark-gtk %{_bindir}/wireshark-gtk
%{_bindir}/ethereal %{_bindir}/ethereal
%{_datadir}/applications/wireshark-gtk.desktop %{_datadir}/applications/wireshark-gtk.desktop
%if ! %{use_caps}
%{_datadir}/applications/wireshark-file-gtk.desktop
%endif
%{_datadir}/pixmaps/wireshark-gtk.png %{_datadir}/pixmaps/wireshark-gtk.png
%post ui-gtk %post ui-gtk
@ -421,6 +431,9 @@ test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null |
%dir %{_datadir}/appdata %dir %{_datadir}/appdata
%{_datadir}/appdata/wireshark.appdata.xml %{_datadir}/appdata/wireshark.appdata.xml
%{_datadir}/applications/wireshark.desktop %{_datadir}/applications/wireshark.desktop
%if ! %{use_caps}
%{_datadir}/applications/wireshark-file.desktop
%endif
%{_datadir}/pixmaps/wireshark.png %{_datadir}/pixmaps/wireshark.png
%post ui-qt %post ui-qt