unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
To: 52786@debbugs.gnu.org
Subject: bug#52786: [aarch64] elogind 246.10 fails to start on ROCK64, breaking sway
Date: Mon, 10 Jan 2022 18:16:03 +0100	[thread overview]
Message-ID: <20220110171603.6ihwny2xf5xaaa7g@pelzflorian.localdomain> (raw)
In-Reply-To: <20220101114704.sbq3bk3gvebrus65@pelzflorian.localdomain>

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

Reverting elogind commit 150d7b05074f16db70a2872765edbb39066d80af
makes sway start again.  See attached patch.  We could graft elogind
or put it on core-updates, but I have not yet properly tested nor
understood.  I will test and try understanding now.

Regards,
Florian

[-- Attachment #2: gnu-elogind-Revert-changes-to-logind-waiting-for-pol.patch --]
[-- Type: text/plain, Size: 8293 bytes --]

From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Mon, 10 Jan 2022 17:24:50 +0100
Subject: [PATCH] gnu: elogind: Revert changes to logind waiting for polkit.

* gnu/packages/patches/elogind-revert-logind-check-policykit.patch: New file.
* gnu/packages/freedesktop.scm (elogind): Use it.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |   1 +
 gnu/packages/freedesktop.scm                  |   1 +
 ...logind-revert-logind-check-policykit.patch | 164 ++++++++++++++++++
 3 files changed, 166 insertions(+)
 create mode 100644 gnu/packages/patches/elogind-revert-logind-check-policykit.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a7106d5f77..f295e22924 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1017,6 +1017,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/elm-compiler-disable-reactor.patch	\
   %D%/packages/patches/elm-compiler-fix-map-key.patch		\
   %D%/packages/patches/elogind-revert-polkit-detection.patch	\
+  %D%/packages/patches/elogind-revert-logind-check-policykit.patch	\
   %D%/packages/patches/emacs-exec-path.patch			\
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch	\
   %D%/packages/patches/emacs-ignore-empty-xim-styles.patch	\
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index a14fba862c..48f4fb11ce 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -576,6 +576,7 @@ (define-public elogind
                (base32
                 "16045bhpwjq2nqgswln67ipg1zrz2djxlgkfngqng3jqpwagmnzq"))
               (patches (search-patches
+                        "elogind-revert-logind-check-policykit.patch"
                         "elogind-revert-polkit-detection.patch"))))
     (build-system meson-build-system)
     (arguments
diff --git a/gnu/packages/patches/elogind-revert-logind-check-policykit.patch b/gnu/packages/patches/elogind-revert-logind-check-policykit.patch
new file mode 100644
index 0000000000..a589fa9591
--- /dev/null
+++ b/gnu/packages/patches/elogind-revert-logind-check-policykit.patch
@@ -0,0 +1,164 @@
+From 1c3f1db2f8a93957386813b1be4274f6ac8b851f Mon Sep 17 00:00:00 2001
+From: Florian Pelz <pelzflorian@pelzflorian.de>
+Date: Mon, 10 Jan 2022 17:12:40 +0100
+Subject: [PATCH] Revert "logind: check PolicyKit before allowing VT switch"
+
+This reverts commit 150d7b05074f16db70a2872765edbb39066d80af.
+---
+ src/login/logind-dbus.c         | 16 ---------
+ src/login/logind-seat-dbus.c    | 58 +--------------------------------
+ src/login/logind-session-dbus.c | 14 --------
+ 3 files changed, 1 insertion(+), 87 deletions(-)
+
+diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
+index a9c954c43..ba30fa7c3 100644
+--- a/src/login/logind-dbus.c
++++ b/src/login/logind-dbus.c
+@@ -1035,8 +1035,6 @@ static int method_activate_session(sd_bus_message *message, void *userdata, sd_b
+         if (r < 0)
+                 return r;
+ 
+-        /* PolicyKit is done by bus_session_method_activate() */
+-
+         return bus_session_method_activate(message, session, error);
+ }
+ 
+@@ -1068,20 +1066,6 @@ static int method_activate_session_on_seat(sd_bus_message *message, void *userda
+                 return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT,
+                                          "Session %s not on seat %s", session_name, seat_name);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &m->polkit_registry,
+-                        error);
+-        if (r < 0)
+-                return r;
+-        if (r == 0)
+-                return 1; /* Will call us back */
+-
+         r = session_activate(session);
+         if (r < 0)
+                 return r;
+diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c
+index a91765205..01fc8ddf6 100644
+--- a/src/login/logind-seat-dbus.c
++++ b/src/login/logind-seat-dbus.c
+@@ -179,20 +179,6 @@ static int method_activate_session(sd_bus_message *message, void *userdata, sd_b
+         if (session->seat != s)
+                 return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT, "Session %s not on seat %s", name, s->id);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
+-        if (r < 0)
+-                return r;
+-        if (r == 0)
+-                return 1; /* Will call us back */
+-
+         r = session_activate(session);
+         if (r < 0)
+                 return r;
+@@ -213,21 +199,7 @@ static int method_switch_to(sd_bus_message *message, void *userdata, sd_bus_erro
+                 return r;
+ 
+         if (to <= 0)
+-                return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid virtual terminal");
+-
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
+-        if (r < 0)
+-                return r;
+-        if (r == 0)
+-                return 1; /* Will call us back */
++                return -EINVAL;
+ 
+         r = seat_switch_to(s, to);
+         if (r < 0)
+@@ -243,20 +215,6 @@ static int method_switch_to_next(sd_bus_message *message, void *userdata, sd_bus
+         assert(message);
+         assert(s);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
+-        if (r < 0)
+-                return r;
+-        if (r == 0)
+-                return 1; /* Will call us back */
+-
+         r = seat_switch_to_next(s);
+         if (r < 0)
+                 return r;
+@@ -271,20 +229,6 @@ static int method_switch_to_previous(sd_bus_message *message, void *userdata, sd
+         assert(message);
+         assert(s);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
+-        if (r < 0)
+-                return r;
+-        if (r == 0)
+-                return 1; /* Will call us back */
+-
+         r = seat_switch_to_previous(s);
+         if (r < 0)
+                 return r;
+diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
+index beca34a33..9c223418e 100644
+--- a/src/login/logind-session-dbus.c
++++ b/src/login/logind-session-dbus.c
+@@ -194,20 +194,6 @@ int bus_session_method_activate(sd_bus_message *message, void *userdata, sd_bus_
+         assert(message);
+         assert(s);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
+-        if (r < 0)
+-                return r;
+-        if (r == 0)
+-                return 1; /* Will call us back */
+-
+         r = session_activate(s);
+         if (r < 0)
+                 return r;
+-- 
+2.34.0
+

base-commit: 87624540b486d710749ad00ef5aa427a9e5c1d0c
-- 
2.34.0


  reply	other threads:[~2022-01-10 17:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-25  8:41 bug#52786: [aarch64] elogind 246.10 fails to start on ROCK64, breaking sway pelzflorian (Florian Pelz)
2021-12-28 15:35 ` pelzflorian (Florian Pelz)
2022-01-01 11:47   ` pelzflorian (Florian Pelz)
2022-01-10 17:16     ` pelzflorian (Florian Pelz) [this message]
2022-06-22  8:59       ` pelzflorian (Florian Pelz)
2022-06-22 12:26         ` Josselin Poiret via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220110171603.6ihwny2xf5xaaa7g@pelzflorian.localdomain \
    --to=pelzflorian@pelzflorian.de \
    --cc=52786@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).