From 7298f5261526384e4d95b267e502713494375dd5 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 17 Dec 2016 14:01:06 +0000 Subject: Use polkit instead of consolehelper to gain root access. Rather than spending lots of time figuring out why consolehelper no longer works in GNOME. --- NEWS | 1 + draklive-install | 2 ++ draklive-install.desktop.in | 2 +- draklive-install.wrapper | 6 ++++++ mageia-draklive-install.desktop.in | 2 +- org.mageia.draklive-install-lock-storage.policy | 22 ++++++++++++++++++++++ org.mageia.draklive-install.policy | 22 ++++++++++++++++++++++ 7 files changed, 55 insertions(+), 2 deletions(-) create mode 100755 draklive-install.wrapper create mode 100644 org.mageia.draklive-install-lock-storage.policy create mode 100644 org.mageia.draklive-install.policy diff --git a/NEWS b/NEWS index 92d88c0..19bf906 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- use polkit instead of consolehelper to gain root access - drop useless reboot in xsetup 2.7 diff --git a/draklive-install b/draklive-install index 42ac2f1..1a941a5 100755 --- a/draklive-install +++ b/draklive-install @@ -343,6 +343,8 @@ sub clean_live_system_hds() { sub finish_installation { my ($fstab) = @_; + #- remove the extra authorisation draklive added + run_program::rooted($::prefix, 'sed', '-i', '/for draklive-install/d', '/etc/pam.d/polkit-1'); sync_logs(); #- cleanly umount here, it will avoid fs journals to be corrupted after a hackish reboot umount_all($fstab); diff --git a/draklive-install.desktop.in b/draklive-install.desktop.in index 2777431..b3c2332 100644 --- a/draklive-install.desktop.in +++ b/draklive-install.desktop.in @@ -1,6 +1,6 @@ [Desktop Entry] Encoding=UTF-8 -Exec=/usr/bin/draklive-install-lock-storage +Exec=/usr/bin/draklive-install Icon=draklive-install Terminal=false Type=Application diff --git a/draklive-install.wrapper b/draklive-install.wrapper new file mode 100755 index 0000000..5a8f4eb --- /dev/null +++ b/draklive-install.wrapper @@ -0,0 +1,6 @@ +#!/bin/sh +if [[ "$UID" != "0" ]] ; then + /usr/bin/pkexec /usr/sbin/draklive-install-lock-storage "$@" + exit $? +fi +exec /usr/sbin/draklive-install-lock-storage "$@" diff --git a/mageia-draklive-install.desktop.in b/mageia-draklive-install.desktop.in index f935973..f9290e2 100644 --- a/mageia-draklive-install.desktop.in +++ b/mageia-draklive-install.desktop.in @@ -2,7 +2,7 @@ Encoding=UTF-8 _Name=Install on Hard Disk _Comment=Install your Mageia live system to disk -Exec=/usr/bin/draklive-install-lock-storage +Exec=/usr/bin/draklive-install Icon=draklive-install Terminal=false Type=Application diff --git a/org.mageia.draklive-install-lock-storage.policy b/org.mageia.draklive-install-lock-storage.policy new file mode 100644 index 0000000..a73282f --- /dev/null +++ b/org.mageia.draklive-install-lock-storage.policy @@ -0,0 +1,22 @@ + + + + + Mageia + http://www.mageia.org/ + + + Run draklive-install + Authentication is required to run Mageia Draklive Installer + draklive-install + + yes + no + yes + + /usr/sbin/draklive-install-lock-storage + true + + diff --git a/org.mageia.draklive-install.policy b/org.mageia.draklive-install.policy new file mode 100644 index 0000000..dccc272 --- /dev/null +++ b/org.mageia.draklive-install.policy @@ -0,0 +1,22 @@ + + + + + Mageia + http://www.mageia.org/ + + + Run draklive-install + Authentication is required to run Mageia Draklive Installer + draklive-install + + yes + no + yes + + /usr/sbin/draklive-install + true + + -- cgit v1.2.1