From 1a8f4a5dd006e1a5a55086948c9ee35a2be88eef29f22787c1ae7eb095e074d9 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 26 Feb 2013 14:15:06 +0000 Subject: [PATCH] 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 --- gparted.changes | 10 ++++++++++ gparted.policy | 19 +++++++++++++++++++ gparted.spec | 11 +++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 gparted.policy diff --git a/gparted.changes b/gparted.changes index 31eb1f5..6622032 100644 --- a/gparted.changes +++ b/gparted.changes @@ -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 diff --git a/gparted.policy b/gparted.policy new file mode 100644 index 0000000..8fc884b --- /dev/null +++ b/gparted.policy @@ -0,0 +1,19 @@ + + + + + + Authentication is required to run the GParted Partition Editor + gparted + + auth_admin + auth_admin + auth_admin + + /usr/sbin/gparted + true + + + diff --git a/gparted.spec b/gparted.spec index 066ce57..3df5a5c 100644 --- a/gparted.spec +++ b/gparted.spec @@ -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