summaryrefslogtreecommitdiffstats
path: root/source/a/elogind
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2020-12-09 21:10:40 +0000
committer Eric Hameleers <alien@slackware.com>2020-12-10 08:59:45 +0100
commitcf14860fabf930b99a09834440cf1ae1fae695e5 (patch)
tree896eb6f3f24befe6507b3b456972feaa8d136b21 /source/a/elogind
parent7d1fda615bfe3ec57a0c6753082b866a09ac1af3 (diff)
downloadcurrent-cf14860fabf930b99a09834440cf1ae1fae695e5.tar.gz
current-cf14860fabf930b99a09834440cf1ae1fae695e5.tar.xz
Wed Dec 9 21:10:40 UTC 202020201209211040
a/elogind-243.7-x86_64-2.txz: Rebuilt. Moved default udev rules to /lib/udev/rules.d/. Thanks to Robby Workman. Added /usr/share/polkit-1/rules.d/10-enable-session-power.rules. a/glibc-zoneinfo-2020d-noarch-2.txz: Rebuilt. Make /etc/localtime a symlink pointing into /usr/share/zoneinfo. If you have /usr on a separate partition, this might cause time problems prior to /usr being mounted (I recommend *not* making /usr a separate partition). But if you insist for some reason, you can probably work around it by adding the pointed-to directory and timezone file to your empty pre-mounted /usr directory. a/upower-0.99.11-x86_64-2.txz: Rebuilt. Added /usr/share/polkit-1/rules.d/10-enable-upower-suspend.rules. d/autoconf-2.70-noarch-1.txz: Upgraded. d/gnucobol-3.1.1-x86_64-1.txz: Upgraded. kde/powerdevil-5.20.4-x86_64-2.txz: Rebuilt. Moved 10-enable-powerdevil-discrete-gpu.rules.new to /usr/share/polkit-1/rules.d/. Thanks to Robby Workman. Moved 10-enable-session-power.rules to the elogind package. Moved 10-enable-upower-suspend.rules to the upower package. Thanks to GazL. l/jasper-2.0.23-x86_64-1.txz: Upgraded. Fix heap-overflow in cp_create() in jpc_enc.c. For more information, see: https://github.com/jasper-software/jasper/issues/252 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-27828 (* Security fix *) l/sbc-1.5-x86_64-1.txz: Upgraded. n/curl-7.74.0-x86_64-1.txz: Upgraded. This release includes the following security related bugfixes: Inferior OCSP verification [93] FTP wildcard stack overflow [95] Trusting FTP PASV responses [97] For more information, see: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8286 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8285 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8284 (* Security fix *) xap/xscreensaver-5.45-x86_64-1.txz: Upgraded. xfce/Greybird-3.22.13-noarch-1.txz: Upgraded.
Diffstat (limited to 'source/a/elogind')
-rw-r--r--source/a/elogind/10-enable-elogind-power.rules12
-rw-r--r--source/a/elogind/doinst.sh3
-rwxr-xr-xsource/a/elogind/elogind.SlackBuild17
3 files changed, 29 insertions, 3 deletions
diff --git a/source/a/elogind/10-enable-elogind-power.rules b/source/a/elogind/10-enable-elogind-power.rules
new file mode 100644
index 000000000..db4992062
--- /dev/null
+++ b/source/a/elogind/10-enable-elogind-power.rules
@@ -0,0 +1,12 @@
+polkit.addRule(
+ function(action, subject) {
+ if ( (action.id == "org.freedesktop.login1.reboot" ||
+ action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
+ action.id == "org.freedesktop.login1.power-off" ||
+ action.id == "org.freedesktop.login1.power-off-multiple-sessions")
+ && subject.isInGroup("power") ) {
+ return polkit.Result.YES;
+ }
+ }
+);
+
diff --git a/source/a/elogind/doinst.sh b/source/a/elogind/doinst.sh
index dc85465c8..d920f6641 100644
--- a/source/a/elogind/doinst.sh
+++ b/source/a/elogind/doinst.sh
@@ -26,8 +26,9 @@ preserve_perms() {
#
# Preserve permissions while moving into place:
-config etc/elogind/logind.conf.new
preserve_perms etc/rc.d/rc.elogind.new
+config etc/elogind/logind.conf.new
+config usr/share/polkit-1/rules.d/10-enable-session-power.rules.new
if pgrep -f elogind-daemon | grep -q 'elogind-daemon'; then
echo "Reloading elogind-daemon..."
diff --git a/source/a/elogind/elogind.SlackBuild b/source/a/elogind/elogind.SlackBuild
index 1e0e0e3bb..1cf2e5c62 100755
--- a/source/a/elogind/elogind.SlackBuild
+++ b/source/a/elogind/elogind.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=elogind
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -113,7 +113,7 @@ meson \
--libdir /usr/lib${LIBDIRSUFFIX} \
-Drootlibdir="/lib${LIBDIRSUFFIX}" \
-Drootlibexecdir="/lib${LIBDIRSUFFIX}/elogind" \
- -Dudevrulesdir="/etc/udev/rules.d" \
+ -Dudevrulesdir="/lib/udev/rules.d" \
-Ddocdir="/usr/doc/$PKGNAM-$VERSION" \
-Dhtmldir="/usr/doc/$PKGNAM-$VERSION/html" \
-Dmandir="/usr/man" \
@@ -163,6 +163,19 @@ cat $CWD/rc.elogind \
> $PKG/etc/rc.d/rc.elogind.new
chmod 755 $PKG/etc/rc.d/rc.elogind.new
+# Create supported dirs in /etc/elogind/ (local config)
+mkdir -p $PKG/etc/elogind/logind.conf.d/ $PKG/etc/elogind/sleep.conf.d/
+
+# Add login1 policy file that allows users in the 'power' group
+# to shutdown/reboot the computer:
+mkdir -p $PKG/usr/share/polkit-1/rules.d
+install -m 0644 -o root \
+ $CWD/10-enable-elogind-power.rules \
+ $PKG/usr/share/polkit-1/rules.d/10-enable-session-power.rules.new
+
+# We don't need the hidden files to make inferior package managers keep dirs:
+find $PKG -type f -name ".keep_dir" -exec rm -f {} \;
+
# Add a documentation directory:
mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
cp -a \