Install polkit file to allow run of 'pkexec /usr/sbin/usbinstallì to current active user; drop sudoers.d support

This commit is contained in:
Silvan Calarco 2012-02-19 17:40:00 +01:00
parent 8720bc231a
commit 77bc0b98d1
2 changed files with 24 additions and 2 deletions

View File

@ -15,6 +15,7 @@ sbindir := /usr/sbin
sysconfdir := /etc
datadir := /usr/share
mambadir := /usr/share/openmamba
polkitdir := /usr/share/polkit-1/actions
localesdir := ${datadir}/locale
DESTDIR :=
@ -48,14 +49,14 @@ install-dirs:
@$(INSTALL_DIR) $(DESTDIR)$(mambadir)/usbinstall
@$(INSTALL_DIR) $(DESTDIR)$(datadir)/applications
@$(INSTALL_DIR) $(DESTDIR)$(mambadir)/usbinstall/img
@$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/sudoers.d/
@$(INSTALL_DIR) $(DESTDIR)$(polkitdir)
install: install-dirs install-locales
$(INSTALL_PROGRAM) src/usbinstall.py $(DESTDIR)$(mambadir)/usbinstall/usbinstall.py
$(INSTALL_SCRIPT) src/usbinstall.sh $(DESTDIR)$(sbindir)/usbinstall
$(INSTALL_DATA) src/fdisk_template $(DESTDIR)$(mambadir)/usbinstall/fdisk_template
$(INSTALL_DATA) src/img/*.png $(DESTDIR)$(mambadir)/usbinstall/img/
${INSTALL} -m 440 src/usbinstall-sudoers $(DESTDIR)$(sysconfdir)/sudoers.d/usbinstall
$(INSTALL_DATA) src/org.openmamba.usbinstall.policy $(DESTDIR)$(polkitdir)/org.openmamba.usbinstall.policy
$(INSTALL_DATA) src/usbinstall.desktop $(DESTDIR)$(datadir)/applications/usbinstall.desktop
clean:

View File

@ -0,0 +1,21 @@
<?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.0/policyconfig.dtd">
<policyconfig>
<vendor>openmamba</vendor>
<vendor_url>http://www.openmamba.org</vendor_url>
<action id="org.openmamba.usbinstall.run">
<description>openmamba installation on USB pendrive</description>
<description xml:lang="it">Installatione di openmamba su chiavetta USB</description>
<message>Authentication is required to install openmamba on USB pendrive</message>
<message xml:lang="it">Bisogna autenticarsi per installare openmamba su una chiavetta USB</message>
<icon_name>security-high</icon_name>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/usbinstall</annotate>
</action>
</policyconfig>