Fixed obtaining process list in power.sh to avoid SELinux denials
Resolves: rhbz#1408457
This commit is contained in:
parent
ce6e405603
commit
b490262b76
@ -2,12 +2,19 @@
|
|||||||
|
|
||||||
PATH=/usr/sbin:/usr/bin
|
PATH=/usr/sbin:/usr/bin
|
||||||
|
|
||||||
|
# $1 = session number
|
||||||
|
function get_session_processes() {
|
||||||
|
local uid=$(loginctl show-session $1 | grep '^User=' | sed -r -e 's/^User=(.*)$/\1/')
|
||||||
|
systemd-cgls "/user.slice/user-${uid}.slice/session-${1}.scope"
|
||||||
|
}
|
||||||
|
|
||||||
# Check session status using systemd
|
# Check session status using systemd
|
||||||
session_ids=$(loginctl list-sessions 2>/dev/null | awk '{print $1}')
|
session_ids=$(loginctl list-sessions 2>/dev/null | awk '{print $1}')
|
||||||
for session in ${session_ids} ; do
|
for session in ${session_ids} ; do
|
||||||
session_status=$(loginctl session-status ${session})
|
session_status=$(loginctl show-session ${session})
|
||||||
echo "${session_status}" | grep -e '\(Active: yes\|State: active\)' &> /dev/null &&
|
session_processes="$(get_session_processes ${session})"
|
||||||
echo "${session_status}" | grep -e '\(gnome-settings-daemon\|cinnamon-settings-daemon\|kded[4-5]\|plasmashell\|xfce4-power-manager\|mate-power-manager\)' &> /dev/null && exit 0
|
echo "${session_status}" | grep -e 'Active=yes' &> /dev/null &&
|
||||||
|
echo "${session_processes}" | grep -e '\(gnome-settings-daemon\|cinnamon-settings-daemon\|kded[4-5]\|plasmashell\|xfce4-power-manager\|mate-power-manager\)' &> /dev/null && exit 0
|
||||||
done
|
done
|
||||||
|
|
||||||
# Get the ID of the first active X11 session: using ConsoleKit
|
# Get the ID of the first active X11 session: using ConsoleKit
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
Summary: ACPI Event Daemon
|
Summary: ACPI Event Daemon
|
||||||
Name: acpid
|
Name: acpid
|
||||||
Version: 2.0.28
|
Version: 2.0.28
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Source: http://downloads.sourceforge.net/acpid2/%{name}-%{version}.tar.xz
|
Source: http://downloads.sourceforge.net/acpid2/%{name}-%{version}.tar.xz
|
||||||
@ -135,6 +135,10 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 18 2017 Ondřej Lysoněk <olysonek@redhat.com> - 2.0.28-2
|
||||||
|
- Fixed obtaining process list in power.sh to avoid SELinux denials
|
||||||
|
Resolves: rhbz#1408457
|
||||||
|
|
||||||
* Fri Sep 16 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.28-1
|
* Fri Sep 16 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.28-1
|
||||||
- New version
|
- New version
|
||||||
Resolves: rhbz#1376618
|
Resolves: rhbz#1376618
|
||||||
|
Loading…
Reference in New Issue
Block a user