unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
blob a589fa9591799e8c4c56dcf0116c9826acb85323 5976 bytes (raw)
name: gnu/packages/patches/elogind-revert-logind-check-policykit.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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


debug log:

solving a589fa9591 ...
found a589fa9591 in https://yhetil.org/guix-bugs/20220110171603.6ihwny2xf5xaaa7g@pelzflorian.localdomain/

applying [1/1] https://yhetil.org/guix-bugs/20220110171603.6ihwny2xf5xaaa7g@pelzflorian.localdomain/
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

1:26: trailing whitespace.
 
1:31: trailing whitespace.
 
1:35: trailing whitespace.
 
1:60: trailing whitespace.
 
1:80: trailing whitespace.
 
Checking patch gnu/packages/patches/elogind-revert-logind-check-policykit.patch...
Applied patch gnu/packages/patches/elogind-revert-logind-check-policykit.patch cleanly.
warning: squelched 6 whitespace errors
warning: 11 lines add whitespace errors.

index at:
100644 a589fa9591799e8c4c56dcf0116c9826acb85323	gnu/packages/patches/elogind-revert-logind-check-policykit.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).