diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-02-24 19:58:07 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-02-24 19:58:07 +0000 |
commit | 99abbc5e5a6ecd3fc981b45646fd8cb5d320377b (patch) | |
tree | da76713365257a445f3ae3b95470917f59d46728 /kde-plasma/kscreenlocker | |
parent | 4935506e9a5cbfabd37c64093eac5f36c2ff0017 (diff) |
gentoo resync : 24.02.2018
Diffstat (limited to 'kde-plasma/kscreenlocker')
-rw-r--r-- | kde-plasma/kscreenlocker/Manifest | 8 | ||||
-rw-r--r-- | kde-plasma/kscreenlocker/files/ck-unlock-session | 220 | ||||
-rw-r--r-- | kde-plasma/kscreenlocker/files/kscreenlocker-consolekit-unlock.patch | 13 | ||||
-rw-r--r-- | kde-plasma/kscreenlocker/kscreenlocker-5.12.2.ebuild (renamed from kde-plasma/kscreenlocker/kscreenlocker-5.12.1.ebuild) | 6 | ||||
-rw-r--r-- | kde-plasma/kscreenlocker/metadata.xml | 3 |
5 files changed, 246 insertions, 4 deletions
diff --git a/kde-plasma/kscreenlocker/Manifest b/kde-plasma/kscreenlocker/Manifest index 18174b60df95..8fdabac09f35 100644 --- a/kde-plasma/kscreenlocker/Manifest +++ b/kde-plasma/kscreenlocker/Manifest @@ -1,7 +1,9 @@ +AUX ck-unlock-session 6159 BLAKE2B e5ef1f55e5082b35a67778e055548a59e15f346cd0aaa8b6fe46f74384d72605121ea06a0317e117350ead99a17d6926e48f2c8672d7271824e6206961c8751a SHA512 61830c4a00cb119efd2b01188c11954521c4de45706249ffaff17b713ac4d90eef647edf2afc5ea7571c35dd50fd193426dd1310109afd316ff7a9faa0071ec1 AUX kde-np.pam 217 BLAKE2B 47e599ef678a81bd12a3e2a04b662c284136f13d5e0aeab06961e9d57007c51a93af1132239f97421cc6f9c47e8622d698d0eb2235e99820efbb8523b227c2de SHA512 88cae39981916a1d4ad115bcac6f4c7db92fa2eef606217ce270cf7ffeb422c18dbabc9f3f4c4581fc1a99b814f51c34b4ccb1dbc8fe255e64a63a31f80c91cb AUX kde.pam 226 BLAKE2B b281adb40b654aa616af66818613f6446b1bfd2025c0819130ae684f61f6683689d1facd3a4b248849bbfda0975603094988b809d01dcab501f69e1f4ef8825f SHA512 a44c3325ea4c56e1b3c8c2953a68e5c7eaea5e2f059c0eea4b4dfde2b2e056e5223574c967d991c6427117ce4db0c4fb00fb6a241f29bf2eaac37b1195496776 +AUX kscreenlocker-consolekit-unlock.patch 792 BLAKE2B 65ada31a191a5ae478a8a5edf27d0555ab4e81a20dbfb128cff1de520386f914b9730f22bb709be97f0ab9a38c9aba1d0a4596039b2438325ad55ea3969f7fea SHA512 21f06f101a9a04a80393a040d29506de8b4de129f3c6433d5455245ec6a9dca9630a59338612396032bd66e345fb59fb78bcd1b486b5d46138be616da632ff18 DIST kscreenlocker-5.11.5.tar.xz 125528 BLAKE2B 32bad30682da09245cc567f3cb79c0e0fd4ffdba26b47ef0c49c3094374503640cab7718033cb9c366ef7acddb6180995f4121b61ed1d04bbd867e1361e9d7ea SHA512 20eefbb4f970b2476d3df2e36bf74021d854f0ba61cba4946b3fc7190cff9edc9fef753d3bdde24ab135cc0dc5ad826cb22063db7b12ce817007355a98a3011a -DIST kscreenlocker-5.12.1.tar.xz 118452 BLAKE2B 1a8eb4742f026af8ce9ab81b63adc37df192cb1c6f66a014d807641e8d40b126664f7e1a0a0c3812975730398ab4aa634ff186a1aab34d13b8086ffdd358a2eb SHA512 e3895c1792f630fe0c8b73910629c0b141c179557eb8da7216564fadbfead659a4eb0b4fdc872054def8e5a6a9c68c27a19e65ec5256cb871b33b7c08d384e46 +DIST kscreenlocker-5.12.2.tar.xz 118448 BLAKE2B 4c70334369d1f2fbf39a3b6e5c02e7fc71f922b0a18985d3e7598aca7f1209d735993412b1b2aad85ba2b622260896498a198c57e49d9aa4deecc5f82b7dba0d SHA512 cb293d69bc56fc3b2cde20b4088277a8d578896429dae2f66a8496ebb8750c23a32d56dcecad047d5a9a9180fa1c3a1a42ad12943fc937a009dcd8be4e7e08c3 EBUILD kscreenlocker-5.11.5.ebuild 2088 BLAKE2B 467a8c4a4da242250fb776c4b6e9a83777ea81296cc917d7ef79460b083ca0418429cc093964a259d6eb9d1b56237df15b0411721ceff9ab4694cf8dc00c8370 SHA512 1e133cc0cbfbf6505df1ceae6ec5b730e6f4997d68b00787e7cc5a934b843ea7d567febe5b83e7e1b2d2c37241ea0e11fafd1ae7eb40fb07bbd1106c0ed4a4d1 -EBUILD kscreenlocker-5.12.1.ebuild 2090 BLAKE2B 0f469d2e658e834e56964d032369450f910289a8ef694482ed712a4a84160c2a07e5501054eebb952160d8f30847969ef560e505d72eb39072f798525eee8d03 SHA512 70ab11dcd7671a070094d902beef4a5ecb1f146709ea37fd1f78851220659f336843ea94142dadd9437314bd933f45e30d09732b96559fc328ade43d8c54e25f -MISC metadata.xml 249 BLAKE2B ad415db89e5dee1627aa77f44ded9d4e1e5b8217d06c7ca25bbaa3fe92ce67c2b1090957c45a821b407d7927e5af798498aa6a5b903895ee1af8ee20a446c7f7 SHA512 76a5a340b13f0053ca3c5e94ed24380ea8d29b45ac8655419e22eaadb1e4a827c04d2e7e36b65145c4964e6526f656618fc6ac144e277ef53cb7373e6239e3c3 +EBUILD kscreenlocker-5.12.2.ebuild 2230 BLAKE2B 5a90ba44f40c103717a26f7183c19ff6b6d42d0270f8b4cebfe4ee2756169bcbba9bf739341a836d34e256f2c47a08abd93168f877bf2806cfee14bd44d3aea7 SHA512 7aa33eff86e5a3fa6d2844cb7a2999622e56deec7d26f50152cb10b048a3cddee0af4ae652410a6f13fde05dd1d5bafefc19a3e06ae49ad49d30622dab1312db +MISC metadata.xml 397 BLAKE2B 0fad03b144a175f0f5f9d8e0c0ba4f75e6cd4f211ba0207e73a7968b7d49bbe0977860324a51ebef324ea0f915eb92dc23978558e000085ff21bd8fdb1d53187 SHA512 1d3749f74eab5cd2e17f73bb44e9f8d7ce03060db8d422a835597f13dce6c39c232eface04d9e74ed3ef66e9a45bb7b4b64c4cd82f6b5aedc62627bd77801c76 diff --git a/kde-plasma/kscreenlocker/files/ck-unlock-session b/kde-plasma/kscreenlocker/files/ck-unlock-session new file mode 100644 index 000000000000..6ce6935b0671 --- /dev/null +++ b/kde-plasma/kscreenlocker/files/ck-unlock-session @@ -0,0 +1,220 @@ +#!/bin/sh + +# This script is to make unlocking using OpenRC/Consolekit easier when the KDE Screenlocker breaks. +# +# Version: 0.2 +# Date written: February 2, 2018 +# Last modification: February 17, 2018 +# +# Copyright (C) 2018 Daniel Frey +# Copyright (C) 2018 Lars Wendler +# +# This script is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# +# Some notes: +# -The switch processing/argument handling is very basic. +# -This script assumes session names start with "Session" when listing +# sessions. This is settable via a variable. +# +# Possible actions: +# -h : Show help screen +# -l : List current consolekit sessions +# -u : Unlock specified session (one parameter required - the session name) +# -a : Attempt to unlock all sessions + +# Return code documentation +# +# 0: Script executed normally +# 1: Root access is not present for script +# 2: No arguments passed +# 3: Multiple actions requested, can only do one at a time +# 4: Argument passed was not recognized +# 5: Multiple arguments passed for unlock single session, only one needed +# 6: The argument required for unlocksession() is missing (internal error) + +SCRIPTNAME="$(basename $0)" + +# Return code constants +readonly ERR_NORMAL_OPERATION=0 +readonly ERR_NO_ROOT=1 +readonly ERR_NO_ARGS=2 +readonly ERR_TOO_MANY_ACTIONS=3 +readonly ERR_INVALID_ARGUMENTS=4 +readonly ERR_TOO_MANY_ARGS=5 +readonly ERR_INTERNAL_ARG_MISSING=6 + +# Action parameter constants +readonly ACTION_NONE=0 +readonly ACTION_HELP=1 +readonly ACTION_LIST=2 +readonly ACTION_UNLOCKALL=3 +readonly ACTION_UNLOCK=4 + +# This is what's used to look for a session via consolekit. +# By default, assume it is prefixed with "Session". +SESSION_SEARCH_PREFIX="Session" + +# Check to make sure script has root access, if not... abort now! +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root." + exit ${ERR_NO_ROOT} +fi + +showhelp() { + cat <<EOF +${SCRIPTNAME}: a script that helps unlock consolekit sessions + +Usage: ${SCRIPTNAME} [action] [parameters] + +Actions: + -l : list current sessions available for unlocking + -u : unlock session specified as a parameter + -a : attempt to unlock all current sessions + -h : this screen + +Parameters: + The -u parameter requires a session name to unlock, use -l to + list sessions. + +Example: + To unlock a single session, use: + ${SCRIPTNAME} -u Session1 + +No arguments will show this screen. +EOF +} + +listsessions() { + # Get a list of all sessions, and remove the full colon from the session name + ALLSESSIONS=$(ck-list-sessions | grep "^${SESSION_SEARCH_PREFIX}" | awk -F : '{print $1}') + + echo + echo "Sessions present on this machine, space-delineated:" + echo + echo ${ALLSESSIONS} + echo + echo + echo "Session detail (to help locate a specific session:" + ck-list-sessions | grep -A 2 "^${SESSION_SEARCH_PREFIX}" +} + +unlocksession() { + # This function expects one parameter set (the session to unlock). + # Make sure the parameter exists before continuing. + if [ -z "${1}" ]; then + showhelp + exit ${ERR_INTERNAL_ARG_MISSING} + fi + + echo "Attempting to unlock session $1; messages from dbus are not suppressed." + + # Finally, request the unlock. + dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/$1 org.freedesktop.ConsoleKit.Session.Unlock +} + +unlockallsessions() { + # Get a list of all sessions, and remove the full colon from the session name + ALLSESSIONS=$(ck-list-sessions | grep "^${SESSION_SEARCH_PREFIX}" | awk -F : '{print $1}') + + echo "Attempting to unlock all sessions. Messages from dbus are not suppressed." + echo + # Loop through results, attempt to unlock all sessions. + # Count them and report at the end. + COUNT=0 + for i in ${ALLSESSIONS}; do + dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/$i org.freedesktop.ConsoleKit.Session.Unlock + let "COUNT+=1" + done + + echo + echo "Attempted to unlock ${COUNT} session(s)." +} + +check_actions() { + # Make sure multiple actions are not chosen. + if [ ${ACTION} -ne ${ACTION_NONE} ]; then + echo "You can only declare one action at a time!" + echo "" + showhelp + exit ${ERR_TOO_MANY_ACTIONS} + fi +} + +# Start of "main" routine + +# Initialize variables: +# ACTION=default 0; used to make sure more than one action are not +# specified at the same time. If an invalid argument was passed +# (e.g. one without the hyphen prefix) it will be caught as well. +ACTION="${ACTION_NONE}" + +# Show help if no arguments provided at all +if [ $# -eq 0 ]; then + showhelp + exit ${ERR_NO_ARGS} +fi + +# Process arguments passed, setting environment appropriately. +# During this check, ensure only one action was requested. This +# script will not do multiple things at a time. +while getopts “hlau:” OPTION; do + case ${OPTION} in + h) # Help action + check_actions + ACTION=${ACTION_HELP} + ;; + l) # List action + check_actions + ACTION="${ACTION_LIST}" + ;; + a) # Enable all USB hubs/devices action + check_actions + ACTION="${ACTION_UNLOCKALL}" + ;; + u) # Enable specific hub/device via find command action + check_actions + ACTION="${ACTION_UNLOCK}" + + # Save session name passed for later + UNLOCKSESSION="${OPTARG}" + ;; + ?) # Unknown parameter + showhelp + exit ${ERR_INVALID_ARGUMENTS} + ;; + esac +done + +# If script reaches this point, only one action was specified, so it is safe +# to continue processing. +case ${ACTION} in + ${ACTION_HELP}) # help action + showhelp + ;; + ${ACTION_LIST}) # list action + listsessions + ;; + ${ACTION_UNLOCKALL}) # unlock all sessions + unlockallsessions + ;; + ${ACTION_UNLOCK}) # unlock single session + unlocksession ${UNLOCKSESSION} + ;; + *) + echo "Unrecognized action." + echo + showhelp + exit ${ERR_INVALID_ARGUMENTS} + ;; +esac + +exit ${ERR_NORMAL_OPERATION} diff --git a/kde-plasma/kscreenlocker/files/kscreenlocker-consolekit-unlock.patch b/kde-plasma/kscreenlocker/files/kscreenlocker-consolekit-unlock.patch new file mode 100644 index 000000000000..b0e4011d2b88 --- /dev/null +++ b/kde-plasma/kscreenlocker/files/kscreenlocker-consolekit-unlock.patch @@ -0,0 +1,13 @@ +--- a/abstractlocker.cpp ++++ b/abstractlocker.cpp +@@ -52,9 +52,8 @@ void BackgroundWindow::paintEvent(QPaintEvent* ) + auto text = ki18n("The screen locker is broken and unlocking is not possible anymore.\n" + "In order to unlock switch to a virtual terminal (e.g. Ctrl+Alt+F2),\n" + "log in and execute the command:\n\n" +- "loginctl unlock-session %1\n\n" ++ "ck-unlock-session\n\n" + "Afterwards switch back to the running session (Ctrl+Alt+F%2)."); +- text = text.subs(QString::fromLocal8Bit(qgetenv("XDG_SESSION_ID"))); + text = text.subs(QString::fromLocal8Bit(qgetenv("XDG_VTNR"))); + p.setPen(Qt::white); + QFont f = p.font(); diff --git a/kde-plasma/kscreenlocker/kscreenlocker-5.12.1.ebuild b/kde-plasma/kscreenlocker/kscreenlocker-5.12.2.ebuild index ba3e06457c80..000589de4b14 100644 --- a/kde-plasma/kscreenlocker/kscreenlocker-5.12.1.ebuild +++ b/kde-plasma/kscreenlocker/kscreenlocker-5.12.2.ebuild @@ -9,7 +9,7 @@ inherit kde5 pam DESCRIPTION="Library and components for secure lock screen architecture" KEYWORDS="~amd64 ~arm ~arm64 ~x86" -IUSE="+pam seccomp" +IUSE="consolekit +pam seccomp" REQUIRED_USE="seccomp? ( pam )" @@ -58,6 +58,8 @@ RESTRICT+=" test" src_prepare() { kde5_src_prepare + use consolekit && eapply "${FILESDIR}"/${PN}-consolekit-unlock.patch + use test || sed -i \ -e "/add_subdirectory(autotests)/ s/^/#/" greeter/CMakeLists.txt || die } @@ -85,6 +87,8 @@ src_install() { newpamd "${FILESDIR}/kde.pam" kde newpamd "${FILESDIR}/kde-np.pam" kde-np + use consolekit && dobin "${FILESDIR}"/ck-unlock-session + if ! use pam; then chown root "${ED}"usr/$(get_libdir)/libexec/kcheckpass || die chmod +s "${ED}"usr/$(get_libdir)/libexec/kcheckpass || die diff --git a/kde-plasma/kscreenlocker/metadata.xml b/kde-plasma/kscreenlocker/metadata.xml index 2fdbf33d963d..099a76f8dd86 100644 --- a/kde-plasma/kscreenlocker/metadata.xml +++ b/kde-plasma/kscreenlocker/metadata.xml @@ -5,4 +5,7 @@ <email>kde@gentoo.org</email> <name>Gentoo KDE Project</name> </maintainer> + <use> + <flag name="consolekit">Add support for killing the screenlocker when <pkg>sys-auth/consolekit</pkg> is the session tracker</flag> + </use> </pkgmetadata> |