Accepting request 156363 from GNOME:Apps

Install proper polkit authorisation file and use pkexec instead of xdg-su to run gparted from the desktop menu with elevated privileges; fixes bnc#755837 (forwarded request 156214 from Zaitor)

OBS-URL: https://build.opensuse.org/request/show/156363
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gparted?expand=0&rev=13
This commit is contained in:
Stephan Kulow 2013-02-26 14:15:06 +00:00 committed by Git OBS Bridge
parent 585ec57f89
commit 1a8f4a5dd0
3 changed files with 38 additions and 2 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Feb 21 17:51:53 UTC 2013 - badshah400@gmail.com
- Install polkit policy file (new source file gparted.policy) to
allow gparted to be run by normal user after gaining elevated
privileges using pkexec; BuildRequires: polkit to properly own
polkit directories
- Use pkexec instead of xdg-su to run gparted from desktop menu;
introduces run time requirement on polkit; fixes bnc#755837.
-------------------------------------------------------------------
Sun Dec 16 19:00:52 UTC 2012 - dimstar@opensuse.org

19
gparted.policy Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.opensuse.policykit.gparted">
<message>Authentication is required to run the GParted Partition Editor</message>
<icon_name>gparted</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/gparted</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@ -1,7 +1,7 @@
#
# spec file for package gparted
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -24,6 +24,7 @@ License: GPL-2.0
Group: System/Filesystems
Url: http://gparted.sourceforge.net/
Source0: http://downloads.sourceforge.net/project/gparted/gparted/gparted-0.14.1/%{name}-%{version}.tar.bz2
Source1: gparted.policy
BuildRequires: e2fsprogs-devel
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -35,6 +36,7 @@ BuildRequires: intltool
BuildRequires: libglademm-devel
BuildRequires: parted-devel
BuildRequires: perl-XML-Parser
BuildRequires: polkit
BuildRequires: scrollkeeper
BuildRequires: update-desktop-files
BuildRequires: xfsprogs-devel
@ -46,6 +48,7 @@ Requires: mtools
Requires: nilfs-utils
Requires: ntfsprogs
Requires: parted
Requires: polkit
Requires: reiserfs
Requires: xdg-utils
Requires: xfsprogs
@ -64,13 +67,16 @@ copying data residing on hard disks and mirroring one partition with another
%setup -q
%build
export GKSUPROG="/usr/bin/xdg-su -c"
export GKSUPROG="pkexec"
%configure \
--disable-scrollkeeper
make %{?_smp_mflags}
%install
%make_install
install -Dm0644 %{S:1} %{buildroot}%{_datadir}/polkit-1/actions/org.opensuse.policykit.gparted.policy
%suse_update_desktop_file %{name}
%fdupes %{buildroot}
%find_lang %{name} %{?no_lang_C}
@ -95,6 +101,7 @@ rm -rf %{buildroot}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/polkit-1/actions/org.opensuse.policykit.gparted.policy
%dir %{_datadir}/gnome
%dir %{_datadir}/gnome/help
%dir %{_datadir}/gnome/help/gparted