SHA256
1
0
forked from pool/systemd
systemd/0001-bnc888612-logind-polkit-acpi.patch
Stephan Kulow 799437355d Accepting request 252537 from Base:System
- Add upstream patch
  0001-systemd-tmpfiles-Fix-IGNORE_DIRECTORY_PATH-age-handl.patch 
  for bsc#893797

- Drop renaming virtual interfaces in a guest (bnc#898432).
  Add 1088-drop-renaming-of-virtual-interfaces-in-guest.patch 

- Rename patch 0001-infinit-timeout-for-kmod-loaded-modules.patch
  to patch 1087-infinit-timeout-for-kmod-loaded-modules.patch 
  and apply this one

- Change patch
  0003-mount-order-options-before-other-arguments-to-mount.patch
  to fix bsc#898240 

- Add upstream patches
  0001-Fix-warning-about-unused-variable-with-SELINUX.patch
  0002-bus-remove-unused-check.patch

- Add patch 0001-infinit-timeout-for-kmod-loaded-modules.patch to
  be able to avoid killing a running kmod/modprobe (bnc#889297) 

- Update patch 0001-bnc888612-logind-polkit-acpi.patch 

- Add upstream patches
  0001-login-pause-devices-before-acknowledging-VT-switches.patch
  May help that history of the shell is saved
  0001-nspawn-don-t-try-to-create-veth-link-with-too-long-i.patch
  0001-socket-introduce-SELinuxContextFromNet-option.patch (bsc#897801)
  0002-util-avoid-non-portable-__WORDSIZE.patch

OBS-URL: https://build.opensuse.org/request/show/252537
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=208
2014-09-28 17:56:47 +00:00

76 lines
3.4 KiB
Diff

---
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.orig/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.orig/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) && !sleep_verb);
+ 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)