chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aada2b1
)
Prep v226: Apply missing fixes and changes to src/login
author
Sven Eden
<yamakuzure@gmx.net>
Mon, 9 Jan 2017 04:53:01 +0000
(
05:53
+0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:22:32 +0000
(10:22 +0100)
src/login/logind-dbus.c
patch
|
blob
|
history
src/login/logind-seat-dbus.c
patch
|
blob
|
history
src/login/logind-session-dbus.c
patch
|
blob
|
history
src/login/logind-user-dbus.c
patch
|
blob
|
history
src/login/pam_elogind.c
patch
|
blob
|
history
diff --git
a/src/login/logind-dbus.c
b/src/login/logind-dbus.c
index ac987ec57aa28fc04ac7ed4c5a4c1112a49e3b94..fdf95fc5001dc8d06c3514c7d7fba3171bcc82ef 100644
(file)
--- a/
src/login/logind-dbus.c
+++ b/
src/login/logind-dbus.c
@@
-943,6
+943,7
@@
static int method_lock_sessions(sd_bus_message *message, void *userdata, sd_bus_
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.lock-sessions",
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.lock-sessions",
+ NULL,
false,
UID_INVALID,
&m->polkit_registry,
false,
UID_INVALID,
&m->polkit_registry,
@@
-1097,6
+1098,7
@@
static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bu
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-user-linger",
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-user-linger",
+ NULL,
interactive,
UID_INVALID,
&m->polkit_registry,
interactive,
UID_INVALID,
&m->polkit_registry,
@@
-1269,6
+1271,7
@@
static int method_attach_device(sd_bus_message *message, void *userdata, sd_bus_
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.attach-device",
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.attach-device",
+ NULL,
interactive,
UID_INVALID,
&m->polkit_registry,
interactive,
UID_INVALID,
&m->polkit_registry,
@@
-1300,6
+1303,7
@@
static int method_flush_devices(sd_bus_message *message, void *userdata, sd_bus_
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.flush-devices",
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.flush-devices",
+ NULL,
interactive,
UID_INVALID,
&m->polkit_registry,
interactive,
UID_INVALID,
&m->polkit_registry,
@@
-1636,7
+1640,7
@@
static int verify_shutdown_creds(
blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
if (multiple_sessions && action_multiple_sessions) {
blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
if (multiple_sessions && action_multiple_sessions) {
- r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_multiple_sessions, interactive, UID_INVALID, &m->polkit_registry, error);
+ r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_multiple_sessions,
NULL,
interactive, UID_INVALID, &m->polkit_registry, error);
if (r < 0)
return r;
if (r == 0)
if (r < 0)
return r;
if (r == 0)
@@
-1644,7
+1648,7
@@
static int verify_shutdown_creds(
}
if (blocked && action_ignore_inhibit) {
}
if (blocked && action_ignore_inhibit) {
- r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_ignore_inhibit, interactive, UID_INVALID, &m->polkit_registry, error);
+ r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_ignore_inhibit,
NULL,
interactive, UID_INVALID, &m->polkit_registry, error);
if (r < 0)
return r;
if (r == 0)
if (r < 0)
return r;
if (r == 0)
@@
-1652,7
+1656,7
@@
static int verify_shutdown_creds(
}
if (!multiple_sessions && !blocked && action) {
}
if (!multiple_sessions && !blocked && action) {
- r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action, interactive, UID_INVALID, &m->polkit_registry, error);
+ r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action,
NULL,
interactive, UID_INVALID, &m->polkit_registry, error);
if (r < 0)
return r;
if (r == 0)
if (r < 0)
return r;
if (r == 0)
@@
-2069,7
+2073,7
@@
static int method_can_shutdown_or_sleep(
blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
if (multiple_sessions) {
blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
if (multiple_sessions) {
- r = bus_test_polkit(message, CAP_SYS_BOOT, action_multiple_sessions, UID_INVALID, &challenge, error);
+ r = bus_test_polkit(message, CAP_SYS_BOOT, action_multiple_sessions,
NULL,
UID_INVALID, &challenge, error);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-2082,7
+2086,7
@@
static int method_can_shutdown_or_sleep(
}
if (blocked) {
}
if (blocked) {
- r = bus_test_polkit(message, CAP_SYS_BOOT, action_ignore_inhibit, UID_INVALID, &challenge, error);
+ r = bus_test_polkit(message, CAP_SYS_BOOT, action_ignore_inhibit,
NULL,
UID_INVALID, &challenge, error);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-2098,7
+2102,7
@@
static int method_can_shutdown_or_sleep(
/* If neither inhibit nor multiple sessions
* apply then just check the normal policy */
/* If neither inhibit nor multiple sessions
* apply then just check the normal policy */
- r = bus_test_polkit(message, CAP_SYS_BOOT, action, UID_INVALID, &challenge, error);
+ r = bus_test_polkit(message, CAP_SYS_BOOT, action,
NULL,
UID_INVALID, &challenge, error);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-2217,6
+2221,7
@@
static int method_set_reboot_to_firmware_setup(
r = bus_verify_polkit_async(message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-reboot-to-firmware-setup",
r = bus_verify_polkit_async(message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-reboot-to-firmware-setup",
+ NULL,
false,
UID_INVALID,
&m->polkit_registry,
false,
UID_INVALID,
&m->polkit_registry,
@@
-2255,6
+2260,7
@@
static int method_can_reboot_to_firmware_setup(
r = bus_test_polkit(message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-reboot-to-firmware-setup",
r = bus_test_polkit(message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-reboot-to-firmware-setup",
+ NULL,
UID_INVALID,
&challenge,
error);
UID_INVALID,
&challenge,
error);
@@
-2291,6
+2297,7
@@
static int method_set_wall_message(
r = bus_verify_polkit_async(message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-wall-message",
r = bus_verify_polkit_async(message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.set-wall-message",
+ NULL,
false,
UID_INVALID,
&m->polkit_registry,
false,
UID_INVALID,
&m->polkit_registry,
@@
-2362,6
+2369,7
@@
static int method_inhibit(sd_bus_message *message, void *userdata, sd_bus_error
w == INHIBIT_HANDLE_SUSPEND_KEY ? "org.freedesktop.login1.inhibit-handle-suspend-key" :
w == INHIBIT_HANDLE_HIBERNATE_KEY ? "org.freedesktop.login1.inhibit-handle-hibernate-key" :
"org.freedesktop.login1.inhibit-handle-lid-switch",
w == INHIBIT_HANDLE_SUSPEND_KEY ? "org.freedesktop.login1.inhibit-handle-suspend-key" :
w == INHIBIT_HANDLE_HIBERNATE_KEY ? "org.freedesktop.login1.inhibit-handle-hibernate-key" :
"org.freedesktop.login1.inhibit-handle-lid-switch",
+ NULL,
false,
UID_INVALID,
&m->polkit_registry,
false,
UID_INVALID,
&m->polkit_registry,
diff --git
a/src/login/logind-seat-dbus.c
b/src/login/logind-seat-dbus.c
index ce67ffde37889b3a7b69fe3c4ecf0a4cfc8db5b0..346e1d2cece27f970ee2d537c13a106a66a7f6b1 100644
(file)
--- a/
src/login/logind-seat-dbus.c
+++ b/
src/login/logind-seat-dbus.c
@@
-204,6
+204,7
@@
int bus_seat_method_terminate(sd_bus_message *message, void *userdata, sd_bus_er
message,
CAP_KILL,
"org.freedesktop.login1.manage",
message,
CAP_KILL,
"org.freedesktop.login1.manage",
+ NULL,
false,
UID_INVALID,
&s->manager->polkit_registry,
false,
UID_INVALID,
&s->manager->polkit_registry,
diff --git
a/src/login/logind-session-dbus.c
b/src/login/logind-session-dbus.c
index b5ecc322f56e7fba9d6642a3b3e4e60daa6dc5a7..e6b4ccd7c6e46150a3fe0e2a432d748c25292822 100644
(file)
--- a/
src/login/logind-session-dbus.c
+++ b/
src/login/logind-session-dbus.c
@@
-191,6
+191,7
@@
int bus_session_method_terminate(sd_bus_message *message, void *userdata, sd_bus
message,
CAP_KILL,
"org.freedesktop.login1.manage",
message,
CAP_KILL,
"org.freedesktop.login1.manage",
+ NULL,
false,
s->user->uid,
&s->manager->polkit_registry,
false,
s->user->uid,
&s->manager->polkit_registry,
@@
-232,6
+233,7
@@
int bus_session_method_lock(sd_bus_message *message, void *userdata, sd_bus_erro
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.lock-sessions",
message,
CAP_SYS_ADMIN,
"org.freedesktop.login1.lock-sessions",
+ NULL,
false,
s->user->uid,
&s->manager->polkit_registry,
false,
s->user->uid,
&s->manager->polkit_registry,
@@
-306,6
+308,7
@@
int bus_session_method_kill(sd_bus_message *message, void *userdata, sd_bus_erro
message,
CAP_KILL,
"org.freedesktop.login1.manage",
message,
CAP_KILL,
"org.freedesktop.login1.manage",
+ NULL,
false,
s->user->uid,
&s->manager->polkit_registry,
false,
s->user->uid,
&s->manager->polkit_registry,
@@
-714,10
+717,9
@@
int session_send_create_reply(Session *s, sd_bus_error *error) {
if (fifo_fd < 0)
return fifo_fd;
if (fifo_fd < 0)
return fifo_fd;
- /* Update the session
and user
state file before we notify the client
+ /* Update the session state file before we notify the client
* about the result. */
session_save(s);
* about the result. */
session_save(s);
- user_save(s->user);
p = session_bus_path(s);
if (!p)
p = session_bus_path(s);
if (!p)
diff --git
a/src/login/logind-user-dbus.c
b/src/login/logind-user-dbus.c
index 36c0e8626dd2e206477c51504a0e1f211b50c91a..20ea2fbdc415882b28461ab7a70db53378b25921 100644
(file)
--- a/
src/login/logind-user-dbus.c
+++ b/
src/login/logind-user-dbus.c
@@
-179,6
+179,7
@@
int bus_user_method_terminate(sd_bus_message *message, void *userdata, sd_bus_er
message,
CAP_KILL,
"org.freedesktop.login1.manage",
message,
CAP_KILL,
"org.freedesktop.login1.manage",
+ NULL,
false,
u->uid,
&u->manager->polkit_registry,
false,
u->uid,
&u->manager->polkit_registry,
@@
-207,6
+208,7
@@
int bus_user_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *
message,
CAP_KILL,
"org.freedesktop.login1.manage",
message,
CAP_KILL,
"org.freedesktop.login1.manage",
+ NULL,
false,
u->uid,
&u->manager->polkit_registry,
false,
u->uid,
&u->manager->polkit_registry,
diff --git
a/src/login/pam_elogind.c
b/src/login/pam_elogind.c
index 0e90573a26a6ba38dbde12e3efe07f4ae7e12948..7ccaec56f01e035d2104987388f440f140017384 100644
(file)
--- a/
src/login/pam_elogind.c
+++ b/
src/login/pam_elogind.c
@@
-185,7
+185,7
@@
static int export_legacy_dbus_address(
if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0)
goto error;
} else {
if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0)
goto error;
} else {
- /* FIXME: We *realy* should move the access() check into the
+ /* FIXME: We *real
l
y* should move the access() check into the
* daemons that spawn dbus-daemon, instead of forcing
* DBUS_SESSION_BUS_ADDRESS= here. */
* daemons that spawn dbus-daemon, instead of forcing
* DBUS_SESSION_BUS_ADDRESS= here. */