summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rwxr-xr-xdraksnapshot-config2
-rw-r--r--org.mageia.draksnapshot-config.policy44
-rw-r--r--wrapper12
4 files changed, 61 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2dd2fd0..d2fcca3 100644
--- a/Makefile
+++ b/Makefile
@@ -28,10 +28,12 @@ clean:
find . -name '*~' | xargs rm -f
install:
- install -d $(PREFIX)/usr/{sbin,bin,share/{mime/packages,$(NAME)/pixmaps,icons/{mini,large}}}
- install -m755 draksnapshot-config $(SBINDIR)
+ install -d $(PREFIX)/usr/{sbin,bin,libexec,share/{mime/packages,$(NAME)/pixmaps,autostart,gnome/autostart,icons/{mini,large},polkit-1/actions}}
+ install -m755 draksnapshot-config $(PREFIX)/usr/libexec/
+ install -m755 wrapper $(BINDIR)/draksnapshot-config
+ install -m644 org.mageia.draksnapshot-config.policy $(PREFIX)/usr/share/polkit-1/actions/
install -m755 draksnapshot-restore $(SBINDIR)
- install -m755 draksnapshot-applet $(BINDIR)
+ install -m755 draksnapshot-applet $(SBINDIR)
install -d $(SYSCONFDIR)
install -m644 icons/$(NAME).png $(ICONSDIR)/mini/$(NAME).png
install -m644 icons/$(NAME).png $(ICONSDIR)/$(NAME).png
diff --git a/draksnapshot-config b/draksnapshot-config
index 127a762..ac0f8d5 100755
--- a/draksnapshot-config
+++ b/draksnapshot-config
@@ -38,8 +38,6 @@ use ugtk2 qw(:create :dialogs :helpers :wrappers);
use Gtk2::SimpleList;
use interactive;
-require_root_capability();
-
ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/");
######### read config
diff --git a/org.mageia.draksnapshot-config.policy b/org.mageia.draksnapshot-config.policy
new file mode 100644
index 0000000..31c7766
--- /dev/null
+++ b/org.mageia.draksnapshot-config.policy
@@ -0,0 +1,44 @@
+<?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>
+
+ <vendor>Mageia</vendor>
+ <vendor_url>http://www.mageia.org/</vendor_url>
+
+ <action id="org.mageia.draksnapshot-config.pkexec.run">
+ <description>Run Backup Configurator</description>
+ <message>Authentication is required to run Backup Configurator</message>
+ <icon_name>draksnapshot-config</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/draksnapshot-config</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
+<?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>
+
+ <vendor>Mageia</vendor>
+ <vendor_url>http://www.mageia.org/</vendor_url>
+
+ <action id="org.mageia.draksnapshot-config.pkexec.run">
+ <description>Run Backup Configurator</description>
+ <message>Authentication is required to run Backup Configurator</message>
+ <icon_name>draksnapshot-config</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/draksnapshot-config</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/wrapper b/wrapper
new file mode 100644
index 0000000..6882141
--- /dev/null
+++ b/wrapper
@@ -0,0 +1,12 @@
+#!/bin/sh
+if [[ "$UID" != "0" ]] ; then
+ /usr/bin/pkexec /usr/libexec/draksnapshot-config "$@"
+ exit $?
+fi
+exec /usr/libexec/draksnapshot-config "$@"
+#!/bin/sh
+if [[ "$UID" != "0" ]] ; then
+ /usr/bin/pkexec /usr/libexec/draksnapshot-config "$@"
+ exit $?
+fi
+exec /usr/libexec/draksnapshot-config "$@"