summaryrefslogtreecommitdiff
path: root/source/a/upower
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2020-12-09 21:10:40 +0000
committerEric Hameleers <alien@slackware.com>2020-12-10 08:59:45 +0100
commitcf14860fabf930b99a09834440cf1ae1fae695e5 (patch)
tree896eb6f3f24befe6507b3b456972feaa8d136b21 /source/a/upower
parent7d1fda615bfe3ec57a0c6753082b866a09ac1af3 (diff)
downloadcurrent-cf14860fabf930b99a09834440cf1ae1fae695e5.tar.gz
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/upower')
-rw-r--r--source/a/upower/10-enable-upower-suspend.rules9
-rw-r--r--source/a/upower/doinst.sh2
-rwxr-xr-xsource/a/upower/upower.SlackBuild9
3 files changed, 18 insertions, 2 deletions
diff --git a/source/a/upower/10-enable-upower-suspend.rules b/source/a/upower/10-enable-upower-suspend.rules
new file mode 100644
index 00000000..4bccfb01
--- /dev/null
+++ b/source/a/upower/10-enable-upower-suspend.rules
@@ -0,0 +1,9 @@
+polkit.addRule(
+ function(action, subject) {
+ if ( (action.id == "org.freedesktop.upower.suspend" ||
+ action.id == "org.freedesktop.upower.hibernate")
+ && subject.isInGroup("power") ) {
+ return polkit.Result.YES;
+ }
+ }
+);
diff --git a/source/a/upower/doinst.sh b/source/a/upower/doinst.sh
index 46abf401..40e2087c 100644
--- a/source/a/upower/doinst.sh
+++ b/source/a/upower/doinst.sh
@@ -12,4 +12,4 @@ config() {
}
config etc/UPower/UPower.conf.new
-
+config usr/share/polkit-1/rules.d/10-enable-upower-suspend.rules.new
diff --git a/source/a/upower/upower.SlackBuild b/source/a/upower/upower.SlackBuild
index 04ded50a..7afa472b 100755
--- a/source/a/upower/upower.SlackBuild
+++ b/source/a/upower/upower.SlackBuild
@@ -28,7 +28,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=upower
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d- | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
@@ -114,6 +114,13 @@ CXXFLAGS="$SLKCFLAGS" \
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
+# Add upower policy allowing users in the 'power' group
+# to suspend/hibernate the computer:
+mkdir -p $PKG/usr/share/polkit-1/rules.d
+install -m 0644 -o root \
+ $CWD/10-enable-upower-suspend.rules \
+ $PKG/usr/share/polkit-1/rules.d/10-enable-upower-suspend.rules.new
+
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la