SHA256
1
0
forked from pool/systemd
Dr. Werner Fink 2014-09-19 13:11:36 +00:00 committed by Git OBS Bridge
parent 0ce5120c8f
commit 22bae05ad2
4 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,75 @@
---
src/login/logind-action.c | 5 +++++
src/login/logind-dbus.c | 20 ++++++++++++++++----
2 files changed, 21 insertions(+), 4 deletions(-)
Index: systemd-210/src/login/logind-action.c
===================================================================
--- systemd-210/src/login/logind-action.c
+++ systemd-210/src/login/logind-action.c
@@ -101,6 +101,11 @@ int manager_handle_action(
/* If the key handling is inhibited, don't do anything */
if (inhibit_key > 0) {
+ if (inhibit_key == INHIBIT_HANDLE_POWER_KEY) {
+ int fd;
+ fd = open("/run/systemd/acpi-shutdown", O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR);
+ close(fd);
+ }
if (manager_is_inhibited(m, inhibit_key, INHIBIT_BLOCK, NULL, true, false, 0, NULL)) {
log_debug("Refusing operation, %s is inhibited.", inhibit_what_to_string(inhibit_key));
return 0;
Index: systemd-210/src/login/logind-dbus.c
===================================================================
--- systemd-210/src/login/logind-dbus.c
+++ systemd-210/src/login/logind-dbus.c
@@ -1469,9 +1469,11 @@ static int method_do_shutdown_or_sleep(
sd_bus_error *error) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
- bool multiple_sessions, blocked;
+ bool multiple_sessions, blocked, shutdown_through_acpi;
int interactive, r;
uid_t uid;
+ int fd;
+ struct stat buf;
assert(m);
assert(message);
@@ -1515,7 +1517,17 @@ static int method_do_shutdown_or_sleep(
multiple_sessions = r > 0;
blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
- if (multiple_sessions) {
+ fd = open ("/run/systemd/acpi-shutdown", O_NOFOLLOW|O_PATH|O_CLOEXEC);
+ if (fd >= 0) {
+ shutdown_through_acpi = ((fstat(fd,&buf) == 0) && (time(NULL) - buf.st_mtime <= 65));
+ close(fd);
+ unlink ("/run/systemd/acpi-shutdown");
+ }
+ else
+ shutdown_through_acpi = false;
+
+
+ if (multiple_sessions && !shutdown_through_acpi) {
r = bus_verify_polkit_async(m->bus, &m->polkit_registry, message,
action_multiple_sessions, interactive, error, method, m);
if (r < 0)
@@ -1524,7 +1536,7 @@ static int method_do_shutdown_or_sleep(
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
- if (blocked) {
+ if (blocked && !shutdown_through_acpi) {
r = bus_verify_polkit_async(m->bus, &m->polkit_registry, message,
action_ignore_inhibit, interactive, error, method, m);
if (r < 0)
@@ -1533,7 +1545,7 @@ static int method_do_shutdown_or_sleep(
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
- if (!multiple_sessions && !blocked) {
+ if (!multiple_sessions && !blocked && !shutdown_through_acpi) {
r = bus_verify_polkit_async(m->bus, &m->polkit_registry, message,
action, interactive, error, method, m);
if (r < 0)

View File

@ -886,6 +886,8 @@ Patch427: 0004-shared-wtmp-utmp-don-t-clear-store_wtmp-in-utmp_put_.patch
Patch428: 0005-shared-label.h-add-missing-stdio.h-include.patch
# PATCH-FIX-UPSTREAM added at 2014/09/19
Patch429: 0006-shared-sparse-endian.h-add-missing-byteswap.h-includ.patch
# PATCH-FIX-SUSE BNC#888612 - AUDIT-0: Power button press at gdm login should not prompt for credentials
Patch430: 0001-bnc888612-logind-polkit-acpi.patch
# UDEV PATCHES
# ============
@ -1655,6 +1657,7 @@ cp %{SOURCE7} m4/
%patch427 -p0
%patch428 -p0
%patch429 -p0
%patch430 -p1
# udev patches
%patch1001 -p1

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Sep 19 13:08:14 UTC 2014 - werner@suse.de
- Add patch 0001-bnc888612-logind-polkit-acpi.patch from Frederic
to solve bnc#888612 - AUDIT-0: Power button press at gdm login
should not prompt for credentials
-------------------------------------------------------------------
Fri Sep 19 11:36:48 UTC 2014 - werner@suse.de

View File

@ -881,6 +881,8 @@ Patch427: 0004-shared-wtmp-utmp-don-t-clear-store_wtmp-in-utmp_put_.patch
Patch428: 0005-shared-label.h-add-missing-stdio.h-include.patch
# PATCH-FIX-UPSTREAM added at 2014/09/19
Patch429: 0006-shared-sparse-endian.h-add-missing-byteswap.h-includ.patch
# PATCH-FIX-SUSE AUDIT-0: Power button press at gdm login should not prompt for credentials (bnc#888612)
Patch430: 0001-bnc888612-logind-polkit-acpi.patch
# UDEV PATCHES
# ============
@ -1650,6 +1652,7 @@ cp %{SOURCE7} m4/
%patch427 -p0
%patch428 -p0
%patch429 -p0
%patch430 -p1
# udev patches
%patch1001 -p1