Mageia Bugzilla – Attachment 8795 Details for
Bug 19968
Convert draklive-install to use polkit instead of consolehelper to gain root access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch for draklive-install (in git)
0001-Use-polkit-instead-of-consolehelper-to-gain-root-acc.patch (text/plain), 4.33 KB, created by
Martin Whitaker
on 2016-12-17 15:49:22 CET
(
hide
)
Description:
Patch for draklive-install (in git)
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2016-12-17 15:49:22 CET
Size:
4.33 KB
patch
obsolete
>From a3d9acdd48c19b36f5aab122719ce54aa8f1d532 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Sat, 17 Dec 2016 14:01:06 +0000 >Subject: [PATCH 1/2] Use polkit instead of consolehelper to gain root access. > >Rather than spending lots of time figuring out why consolehelper no >longer works in GNOME. > >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 @@ >+<?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.draklive-install-lock-storage.pkexec.run"> >+ <description>Run draklive-install</description> >+ <message>Authentication is required to run Mageia Draklive Installer</message> >+ <icon_name>draklive-install</icon_name> >+ <defaults> >+ <allow_any>yes</allow_any> >+ <allow_inactive>no</allow_inactive> >+ <allow_active>yes</allow_active> >+ </defaults> >+ <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/draklive-install-lock-storage</annotate> >+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> >+ </action> >+</policyconfig> >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 @@ >+<?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.draklive-install.pkexec.run"> >+ <description>Run draklive-install</description> >+ <message>Authentication is required to run Mageia Draklive Installer</message> >+ <icon_name>draklive-install</icon_name> >+ <defaults> >+ <allow_any>yes</allow_any> >+ <allow_inactive>no</allow_inactive> >+ <allow_active>yes</allow_active> >+ </defaults> >+ <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/draklive-install</annotate> >+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> >+ </action> >+</policyconfig> >-- >2.10.2 >
From a3d9acdd48c19b36f5aab122719ce54aa8f1d532 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Sat, 17 Dec 2016 14:01:06 +0000 Subject: [PATCH 1/2] Use polkit instead of consolehelper to gain root access. Rather than spending lots of time figuring out why consolehelper no longer works in GNOME. 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 @@ +<?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.draklive-install-lock-storage.pkexec.run"> + <description>Run draklive-install</description> + <message>Authentication is required to run Mageia Draklive Installer</message> + <icon_name>draklive-install</icon_name> + <defaults> + <allow_any>yes</allow_any> + <allow_inactive>no</allow_inactive> + <allow_active>yes</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/draklive-install-lock-storage</annotate> + <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> + </action> +</policyconfig> 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 @@ +<?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.draklive-install.pkexec.run"> + <description>Run draklive-install</description> + <message>Authentication is required to run Mageia Draklive Installer</message> + <icon_name>draklive-install</icon_name> + <defaults> + <allow_any>yes</allow_any> + <allow_inactive>no</allow_inactive> + <allow_active>yes</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/draklive-install</annotate> + <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> + </action> +</policyconfig> -- 2.10.2
View Attachment As Raw
Actions:
View
Attachments on
bug 19968
: 8795 |
8796