|
|
fdca65 |
From ef789e1e30c8682ac04e9ed29d40352992bf8aa9 Mon Sep 17 00:00:00 2001
|
|
|
fdca65 |
From: rpm-build <rpm-build>
|
|
|
fdca65 |
Date: Thu, 20 Dec 2018 14:51:38 -0500
|
|
|
fdca65 |
Subject: [PATCH] manager: allow multiple xdmcp logins for the same user
|
|
|
fdca65 |
|
|
|
fdca65 |
---
|
|
|
fdca65 |
common/gdm-settings-keys.h | 1 +
|
|
|
fdca65 |
daemon/gdm-manager.c | 27 +++++++++++++++++++++++++++
|
|
|
fdca65 |
data/gdm.schemas | 5 +++++
|
|
|
fdca65 |
data/gdm.schemas.in.in | 5 +++++
|
|
|
fdca65 |
4 files changed, 38 insertions(+)
|
|
|
fdca65 |
|
|
|
fdca65 |
diff --git a/common/gdm-settings-keys.h b/common/gdm-settings-keys.h
|
|
|
fdca65 |
index f0059b5..33676a8 100644
|
|
|
fdca65 |
--- a/common/gdm-settings-keys.h
|
|
|
fdca65 |
+++ b/common/gdm-settings-keys.h
|
|
|
fdca65 |
@@ -55,6 +55,7 @@ G_BEGIN_DECLS
|
|
|
fdca65 |
#define GDM_KEY_MAX_WAIT_INDIRECT "xdmcp/MaxWaitIndirect"
|
|
|
fdca65 |
#define GDM_KEY_PING_INTERVAL "xdmcp/PingIntervalSeconds"
|
|
|
fdca65 |
#define GDM_KEY_WILLING "xdmcp/Willing"
|
|
|
fdca65 |
+#define GDM_KEY_ALLOW_MULTIPLE_SESSIONS_PER_USER "xdmcp/AllowMultipleSessionsPerUser"
|
|
|
fdca65 |
|
|
|
fdca65 |
#define GDM_KEY_MULTICAST "chooser/Multicast"
|
|
|
fdca65 |
#define GDM_KEY_MULTICAST_ADDR "chooser/MulticastAddr"
|
|
|
fdca65 |
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
|
|
fdca65 |
index 031c61c..225de1d 100644
|
|
|
fdca65 |
--- a/daemon/gdm-manager.c
|
|
|
fdca65 |
+++ b/daemon/gdm-manager.c
|
|
|
fdca65 |
@@ -612,6 +612,11 @@ switch_to_compatible_user_session (GdmManager *manager,
|
|
|
fdca65 |
username = gdm_session_get_username (session);
|
|
|
fdca65 |
seat_id = gdm_session_get_display_seat_id (session);
|
|
|
fdca65 |
|
|
|
fdca65 |
+ if (!seat_id || !sd_seat_can_multi_session (seat_id)) {
|
|
|
fdca65 |
+ g_debug ("GdmManager: unable to activate existing sessions unless on seat0");
|
|
|
fdca65 |
+ goto out;
|
|
|
fdca65 |
+ }
|
|
|
fdca65 |
+
|
|
|
fdca65 |
if (!fail_if_already_switched) {
|
|
|
fdca65 |
session = NULL;
|
|
|
fdca65 |
}
|
|
|
fdca65 |
@@ -1091,6 +1096,20 @@ open_temporary_reauthentication_channel (GdmManager *self,
|
|
|
fdca65 |
}
|
|
|
fdca65 |
|
|
|
fdca65 |
static gboolean
|
|
|
fdca65 |
+remote_users_can_log_in_more_than_once (GdmManager *manager)
|
|
|
fdca65 |
+{
|
|
|
fdca65 |
+ gboolean enabled;
|
|
|
fdca65 |
+
|
|
|
fdca65 |
+ enabled = FALSE;
|
|
|
fdca65 |
+
|
|
|
fdca65 |
+ gdm_settings_direct_get_boolean (GDM_KEY_ALLOW_MULTIPLE_SESSIONS_PER_USER, &enabled);
|
|
|
fdca65 |
+
|
|
|
fdca65 |
+ g_debug ("GdmDisplay: Remote users allowed to log in more than once: %s", enabled? "yes" : "no");
|
|
|
fdca65 |
+
|
|
|
fdca65 |
+ return enabled;
|
|
|
fdca65 |
+}
|
|
|
fdca65 |
+
|
|
|
fdca65 |
+static gboolean
|
|
|
fdca65 |
gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager,
|
|
|
fdca65 |
GDBusMethodInvocation *invocation,
|
|
|
fdca65 |
const char *username)
|
|
|
fdca65 |
@@ -1122,6 +1141,14 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager
|
|
|
fdca65 |
return TRUE;
|
|
|
fdca65 |
}
|
|
|
fdca65 |
|
|
|
fdca65 |
+ if (is_login_screen && is_remote && remote_users_can_log_in_more_than_once (self)) {
|
|
|
fdca65 |
+ g_dbus_method_invocation_return_error_literal (invocation,
|
|
|
fdca65 |
+ G_DBUS_ERROR,
|
|
|
fdca65 |
+ G_DBUS_ERROR_ACCESS_DENIED,
|
|
|
fdca65 |
+ "Login screen creates new sessions for remote connections");
|
|
|
fdca65 |
+ return TRUE;
|
|
|
fdca65 |
+ }
|
|
|
fdca65 |
+
|
|
|
fdca65 |
if (is_login_screen) {
|
|
|
fdca65 |
session = find_session_for_user_on_seat (self,
|
|
|
fdca65 |
username,
|
|
|
fdca65 |
diff --git a/data/gdm.schemas.in.in b/data/gdm.schemas.in.in
|
|
|
fdca65 |
index 8ad2031..003f92c 100644
|
|
|
fdca65 |
--- a/data/gdm.schemas.in.in
|
|
|
fdca65 |
+++ b/data/gdm.schemas.in.in
|
|
|
fdca65 |
@@ -129,5 +129,10 @@
|
|
|
fdca65 |
<signature>s</signature>
|
|
|
fdca65 |
<default>@gdmconfdir@/Xwilling</default>
|
|
|
fdca65 |
</schema>
|
|
|
fdca65 |
+ <schema>
|
|
|
fdca65 |
+ <key>xdmcp/AllowMultipleSessionsPerUser</key>
|
|
|
fdca65 |
+ <signature>b</signature>
|
|
|
fdca65 |
+ <default>false</default>
|
|
|
fdca65 |
+ </schema>
|
|
|
fdca65 |
</schemalist>
|
|
|
fdca65 |
</gdmschemafile>
|
|
|
fdca65 |
--
|
|
|
fdca65 |
1.8.3.1
|
|
|
fdca65 |
|