[Pkg-privacy-commits] [tails-installer] 35/40: Use polkit (pkexec) instead of consolehelper, thanks to Gene Czarcinski (#1145813)
anonym
anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:15:03 UTC 2017
This is an automated email from the git hooks/post-receive script.
anonym-tails-guest pushed a commit to annotated tag 3.13.1
in repository tails-installer.
commit 0e226d98a7cc67dfa8fed7686f20db4e97e24796
Author: Luke Macken <lmacken at redhat.com>
Date: Wed Nov 26 23:13:23 2014 -0700
Use polkit (pkexec) instead of consolehelper, thanks to Gene Czarcinski (#1145813)
---
MANIFEST.in | 4 +--
data/liveusb-creator.desktop | 2 +-
liveusb-creator.console | 5 ---
liveusb-creator.pam | 5 ---
liveusb-creator.spec | 37 ++++++++++++++--------
liveusb-creator_polkit | 6 ++++
...fedoraproject.pkexec.run-liveusb-creator.policy | 19 +++++++++++
7 files changed, 51 insertions(+), 27 deletions(-)
diff --git a/MANIFEST.in b/MANIFEST.in
index b6a00fe..7487d65 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,8 +3,8 @@ include Makefile
include LICENSE.txt
include liveusb-creator
include setup.py
-include liveusb-creator.console
-include liveusb-creator.pam
+include org.fedoraproject.pkexec.run-liveusb-creator.policy
+include liveusb-creator_polkit
include liveusb-creator.spec
graft liveusb
diff --git a/data/liveusb-creator.desktop b/data/liveusb-creator.desktop
index 5a07de9..2fb795b 100644
--- a/data/liveusb-creator.desktop
+++ b/data/liveusb-creator.desktop
@@ -4,7 +4,7 @@ Encoding=UTF-8
Name=Fedora LiveUSB Creator
Comment=Write Fedora images to a USB device
Icon=fedorausb
-Exec=liveusb-creator
+Exec=liveusb-creator_polkit
Terminal=false
Categories=System;
StartupNotify=true
diff --git a/liveusb-creator.console b/liveusb-creator.console
deleted file mode 100644
index 52b46e0..0000000
--- a/liveusb-creator.console
+++ /dev/null
@@ -1,5 +0,0 @@
-USER=root
-PROGRAM=/usr/sbin/liveusb-creator
-SESSION=true
-FALLBACK=true
-
diff --git a/liveusb-creator.pam b/liveusb-creator.pam
deleted file mode 100644
index df41b4c..0000000
--- a/liveusb-creator.pam
+++ /dev/null
@@ -1,5 +0,0 @@
-#%PAM-1.0
-auth include config-util
-account include config-util
-session include config-util
-
diff --git a/liveusb-creator.spec b/liveusb-creator.spec
index 479d88d..912ce88 100644
--- a/liveusb-creator.spec
+++ b/liveusb-creator.spec
@@ -8,7 +8,7 @@
Name: liveusb-creator
Version: 3.13.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A liveusb creator
Group: Applications/System
@@ -23,13 +23,16 @@ ExcludeArch: ppc64
ExcludeArch: %{arm}
BuildRequires: python-devel, python-setuptools, PyQt4-devel, desktop-file-utils gettext
-Requires: syslinux, PyQt4, usermode, isomd5sum
+
+Requires: syslinux
+Requires: PyQt4
+Requires: isomd5sum
Requires: python-urlgrabber
Requires: pyparted >= 2.0
Requires: syslinux-extlinux
Requires: udisks
-# https://bugzilla.redhat.com/show_bug.cgi?id=976415
-Requires: usermode-gtk
+Requires: polkit
+Requires: polkit-gnome
%description
A liveusb creator from Live Fedora images
@@ -46,14 +49,18 @@ rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%{__rm} -r liveusb/urlgrabber
-# Adjust for console-helper magic
+# program needs root, move to sbin
mkdir -p %{buildroot}%{_sbindir}
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_sbindir}/%{name}
-ln -s ../bin/consolehelper %{buildroot}%{_bindir}/%{name}
-mkdir -p %{buildroot}%{_sysconfdir}/pam.d
-cp %{name}.pam %{buildroot}%{_sysconfdir}/pam.d/%{name}
-mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps
-cp %{name}.console %{buildroot}%{_sysconfdir}/security/console.apps/%{name}
+
+# polkit stuff
+mkdir -p %{buildroot}%{_datadir}/polkit-1/actions
+%{__install} -p -m644 \
+ org.fedoraproject.pkexec.run-liveusb-creator.policy \
+ %{buildroot}%{_datadir}/polkit-1/actions/
+%{__install} -p -m755 \
+ liveusb-creator_polkit \
+ %{buildroot}%{_bindir}/
desktop-file-install \
%if %{with_desktop_vendor_tag}
@@ -74,16 +81,18 @@ rm -rf %{buildroot}
%defattr(-,root,root,-)
%doc README.rst LICENSE.txt
%{python_sitelib}/*
-%{_bindir}/%{name}
-%{_sbindir}/%{name}
+%{_bindir}/*
+%{_sbindir}/*
%{_datadir}/applications/*liveusb-creator.desktop
%{_datadir}/pixmaps/fedorausb.png
%{_datadir}/appdata/%{name}.appdata.xml
#%{_datadir}/locale/*/LC_MESSAGES/liveusb-creator.mo
-%config(noreplace) %{_sysconfdir}/pam.d/%{name}
-%config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
+%{_datadir}/polkit-1/actions/org.fedoraproject.pkexec.run-liveusb-creator.policy
%changelog
+* Thu Nov 27 2014 Gene Czarcinski <gczarcinski at gmail.com> 3.13.0-2
+- convert to using polkit (pkexec) instead of consolehelper
+
* Wed Nov 26 2014 Luke Macken <lmacken at redhat.com> - 3.13.0-1
- Latest upstream release with bug fixes and interface improvements.
diff --git a/liveusb-creator_polkit b/liveusb-creator_polkit
new file mode 100644
index 0000000..acaa5e0
--- /dev/null
+++ b/liveusb-creator_polkit
@@ -0,0 +1,6 @@
+#!/bin/bash
+if [ $(which pkexec) ]; then
+ pkexec --disable-internal-agent "/usr/sbin/liveusb-creator" "$@"
+else
+ /usr/sbin/liveusb-creator "$@"
+fi
diff --git a/org.fedoraproject.pkexec.run-liveusb-creator.policy b/org.fedoraproject.pkexec.run-liveusb-creator.policy
new file mode 100644
index 0000000..4796a86
--- /dev/null
+++ b/org.fedoraproject.pkexec.run-liveusb-creator.policy
@@ -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.fedoraproject.pkexec.run-liveusb-creator">
+ <description>Run the liveusb-creator program</description>
+ <message>Authentication is required to run the liveusb-creator</message>
+ <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/liveusb-creator</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+
+</policyconfig>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list