Compare commits
No commits in common. "imports/c8-beta/gdm-3.28.3-29.el8" and "c8" have entirely different histories.
imports/c8
...
c8
.gdm.metadata.gitignore
SOURCES
0001-Honor-initial-setup-being-disabled-by-distro-install.patch0001-Revert-gdm-wayland-x-session-don-t-overwrite-user-en.patch0001-build-Support-keyutils-1.5.11-and-older.patch0001-daemon-Don-t-error-on-shutdown.patch0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch0001-daemon-fix-wayland-detection-when-deciding-to-bypass.patch0001-data-Disable-network-configuration-on-login-screen.patch0001-data-add-system-dconf-databases-to-gdm-profile.patch0001-data-disable-wayland-for-proprietary-nvidia-machines.patch0001-data-disable-wayland-on-certain-hardware.patch0001-data-disable-wayland-on-server-chips-and-dual-gpu-se.patch0001-data-enable-wayland-on-cirrus.patch0001-data-only-disable-wayland-on-passthrough-virt-setups.patch0001-data-reap-gdm-sessions-on-shutdown.patch0001-display-Handle-failure-before-display-registration.patch0001-display-access-file-drop-unused-function.patch0001-display-ask-accountservice-if-there-are-users-rather.patch0001-local-display-factory-Don-t-try-to-respawn-displays-.patch0001-local-display-factory-Provide-more-flexibility-for-c.patch0001-local-display-factory-pause-for-a-few-seconds-before.patch0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch0001-manager-don-t-kill-timed-login-session-immediately-a.patch0001-manager-ensure-is-initial-is-transfered-to-autologin.patch0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch0001-session-worker-expose-worker-state-enum-to-type-syst.patch0001-utils-Drop-gdm-screenshot.patch0001-utils-add-new-gdm-disable-wayland-binary.patch0001-worker-don-t-load-user-settings-for-program-sessions.patch0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch0002-libgdm-Sort-session-list.patch0002-manager-Fix-btmp-record-accounting.patch0002-manager-session-Add-some-debugging-around-starting-r.patch0002-pam_gdm-Use-the-last-cryptsetup-password-instead-of-.patch0002-session-support-new-accountsservice-Session-and-Sess.patch0002-session-worker-kill-user-sessions-when-stop-gdm-serv.patch0003-daemon-save-os-release-in-accountsservice.patch0003-session-Don-t-allow-greeter-operations-on-an-running.patch0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch0003-session-worker-uninitialize-pam-if-worker-is-killed.patch0003-xdmcp-display-factory-Set-supported-session-types-fo.patch0004-GdmManager-Don-t-perform-timed-login-if-session-gets.patch0004-daemon-handle-upgrades-from-RHEL-7.patch0004-data-reap-gdm-sessions-on-shutdown.patch0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patchdefault.pa-for-gdm
SPECS
@ -1 +1 @@
|
||||
3c619c91941b2df0362a67b905669f8852106bf5 SOURCES/gdm-3.28.3.tar.xz
|
||||
05c48de8765bde97768b6740417ad6c374c20763 SOURCES/gdm-40.0.tar.xz
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/gdm-3.28.3.tar.xz
|
||||
SOURCES/gdm-40.0.tar.xz
|
||||
|
@ -1,4 +1,4 @@
|
||||
From fa5733788ae5f8e8caeb07e956be370e96f9b6b1 Mon Sep 17 00:00:00 2001
|
||||
From a447cd87b99868348ecf69479eb7958f20a318a2 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Matos <tiagomatos@gmail.com>
|
||||
Date: Mon, 23 Jan 2017 20:19:51 +0100
|
||||
Subject: [PATCH] Honor initial setup being disabled by distro installer
|
||||
@ -14,30 +14,45 @@ that but more might be added in the future.
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=777708
|
||||
---
|
||||
daemon/Makefile.am | 1 +
|
||||
daemon/gdm-display.c | 29 +++++++++++++++++++++++++++++
|
||||
2 files changed, 30 insertions(+)
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index ab5dda0..786e0c5 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -14,6 +14,7 @@ AM_CPPFLAGS = \
|
||||
-DLOCALSTATEDIR=\"$(localstatedir)\" \
|
||||
-DLOGDIR=\"$(logdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\" \
|
||||
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
|
||||
-DGDM_RUN_DIR=\"$(GDM_RUN_DIR)\" \
|
||||
-DGDM_XAUTH_DIR=\"$(GDM_XAUTH_DIR)\" \
|
||||
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
||||
index 0057e2c..2af8e13 100644
|
||||
index 687e7da4b..b3bdf066d 100644
|
||||
--- a/daemon/gdm-display.c
|
||||
+++ b/daemon/gdm-display.c
|
||||
@@ -1456,6 +1456,31 @@ can_create_environment (const char *session_id)
|
||||
@@ -1591,103 +1591,132 @@ kernel_cmdline_initial_setup_force_state (gboolean *force_state)
|
||||
GError *error = NULL;
|
||||
gchar *contents = NULL;
|
||||
gchar *setup_argument = NULL;
|
||||
|
||||
g_return_val_if_fail (force_state != NULL, FALSE);
|
||||
|
||||
if (!g_file_get_contents ("/proc/cmdline", &contents, NULL, &error)) {
|
||||
g_debug ("GdmDisplay: Could not check kernel parameters, not forcing initial setup: %s",
|
||||
error->message);
|
||||
g_clear_error (&error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_debug ("GdmDisplay: Checking kernel command buffer %s", contents);
|
||||
|
||||
if (!kernel_cmdline_initial_setup_argument (contents, &setup_argument, &error)) {
|
||||
g_debug ("GdmDisplay: Failed to read kernel commandline: %s", error->message);
|
||||
g_clear_pointer (&contents, g_free);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_clear_pointer (&contents, g_free);
|
||||
|
||||
/* Poor-man's check for truthy or falsey values */
|
||||
*force_state = setup_argument[0] == '1';
|
||||
|
||||
g_free (setup_argument);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
+static gboolean
|
||||
+initial_setup_disabled_by_anaconda (void)
|
||||
+{
|
||||
+ GKeyFile *key_file;
|
||||
@ -62,11 +77,46 @@ index 0057e2c..2af8e13 100644
|
||||
+ return disabled;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
static gboolean
|
||||
wants_initial_setup (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
gboolean enabled = FALSE;
|
||||
@@ -1480,6 +1505,10 @@ wants_initial_setup (GdmDisplay *self)
|
||||
gboolean forced = FALSE;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
if (already_done_initial_setup_on_this_boot ()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (kernel_cmdline_initial_setup_force_state (&forced)) {
|
||||
if (forced) {
|
||||
g_debug ("GdmDisplay: Forcing gnome-initial-setup");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_debug ("GdmDisplay: Forcing no gnome-initial-setup");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* don't run initial-setup on remote displays
|
||||
*/
|
||||
if (!priv->is_local) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* don't run if the system has existing users */
|
||||
if (priv->have_existing_user_accounts) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* don't run if initial-setup is unavailable */
|
||||
if (!can_create_environment ("gnome-initial-setup")) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gdm_settings_direct_get_boolean (GDM_KEY_INITIAL_SETUP_ENABLE, &enabled)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -77,6 +127,33 @@ index 0057e2c..2af8e13 100644
|
||||
return enabled;
|
||||
}
|
||||
|
||||
void
|
||||
gdm_display_start_greeter_session (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
GdmSession *session;
|
||||
char *display_name;
|
||||
char *seat_id;
|
||||
char *hostname;
|
||||
char *auth_file = NULL;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_return_if_fail (g_strcmp0 (priv->session_class, "greeter") == 0);
|
||||
|
||||
g_debug ("GdmDisplay: Running greeter");
|
||||
|
||||
display_name = NULL;
|
||||
seat_id = NULL;
|
||||
hostname = NULL;
|
||||
|
||||
g_object_get (self,
|
||||
"x11-display-name", &display_name,
|
||||
"seat-id", &seat_id,
|
||||
"remote-hostname", &hostname,
|
||||
NULL);
|
||||
if (priv->access_file != NULL) {
|
||||
auth_file = gdm_display_access_file_get_path (priv->access_file);
|
||||
}
|
||||
--
|
||||
2.9.3
|
||||
2.28.0
|
||||
|
||||
|
@ -0,0 +1,241 @@
|
||||
From 85951a0384cb7f37d99669575fad4aea155f25a8 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 5 May 2021 10:50:56 -0400
|
||||
Subject: [PATCH 1/5] Revert "gdm-{wayland,x}-session: don't overwrite user env
|
||||
with fallback vars"
|
||||
|
||||
This reverts commit ccecd9c975d04da80db4cd547b67a1a94fa83292.
|
||||
---
|
||||
daemon/gdm-wayland-session.c | 22 +---------------------
|
||||
daemon/gdm-x-session.c | 22 +---------------------
|
||||
2 files changed, 2 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-wayland-session.c b/daemon/gdm-wayland-session.c
|
||||
index d0404d2c1..35679b194 100644
|
||||
--- a/daemon/gdm-wayland-session.c
|
||||
+++ b/daemon/gdm-wayland-session.c
|
||||
@@ -262,112 +262,92 @@ on_session_finished (GSubprocess *subprocess,
|
||||
|
||||
state->session_exit_status = exit_status;
|
||||
} else {
|
||||
int signal_number;
|
||||
|
||||
signal_number = g_subprocess_get_term_sig (subprocess);
|
||||
g_debug ("session was killed with status %d", signal_number);
|
||||
}
|
||||
|
||||
g_clear_object (&state->session_subprocess);
|
||||
out:
|
||||
g_main_loop_quit (state->main_loop);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
spawn_session (State *state,
|
||||
GCancellable *cancellable)
|
||||
{
|
||||
GSubprocessLauncher *launcher = NULL;
|
||||
GSubprocess *subprocess = NULL;
|
||||
GError *error = NULL;
|
||||
gboolean is_running = FALSE;
|
||||
int ret;
|
||||
char **argv = NULL;
|
||||
static const char *session_variables[] = { "DISPLAY",
|
||||
"XAUTHORITY",
|
||||
"WAYLAND_DISPLAY",
|
||||
"WAYLAND_SOCKET",
|
||||
"GNOME_SHELL_SESSION_MODE",
|
||||
NULL };
|
||||
- /* The environment variables listed below are those we have set (or
|
||||
- * received from our own execution environment) only as a fallback to
|
||||
- * make things work, as opposed to a information directly pertaining to
|
||||
- * the session about to be started. Variables listed here will not
|
||||
- * overwrite the existing environment (possibly) imported from the
|
||||
- * systemd --user instance.
|
||||
- * As an example: We need a PATH for some of the launched subprocesses
|
||||
- * to work, but if the user (or the distributor) has customized the PATH
|
||||
- * via one of systemds user-environment-generators, that version should
|
||||
- * be preferred. */
|
||||
- static const char *fallback_variables[] = { "PATH", NULL };
|
||||
|
||||
g_debug ("Running wayland session");
|
||||
|
||||
ret = g_shell_parse_argv (state->session_command,
|
||||
NULL,
|
||||
&argv,
|
||||
&error);
|
||||
|
||||
if (!ret) {
|
||||
g_debug ("could not parse session arguments: %s", error->message);
|
||||
goto out;
|
||||
}
|
||||
|
||||
launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
|
||||
|
||||
if (state->environment != NULL) {
|
||||
size_t i;
|
||||
|
||||
for (i = 0; state->environment[i] != NULL; i++) {
|
||||
g_auto(GStrv) environment_entry = NULL;
|
||||
|
||||
if (state->environment[i][0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
environment_entry = g_strsplit (state->environment[i], "=", 2);
|
||||
|
||||
if (environment_entry[0] == NULL || environment_entry[1] == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
- /* Merge the environment block imported from systemd --user with the
|
||||
- * environment we have set for ourselves (and thus pass on to the
|
||||
- * launcher process). Variables we have set have precedence, as to not
|
||||
- * import stale data from prior user sessions, with the exception of
|
||||
- * those listed in fallback_variables. See the comment there for more
|
||||
- * explanations. */
|
||||
- g_subprocess_launcher_setenv (launcher,
|
||||
- environment_entry[0],
|
||||
- environment_entry[1],
|
||||
- g_strv_contains (fallback_variables, environment_entry[0]));
|
||||
+ g_subprocess_launcher_setenv (launcher, environment_entry[0], environment_entry[1], FALSE);
|
||||
}
|
||||
|
||||
/* Don't allow session specific environment variables from earlier sessions to
|
||||
* leak through */
|
||||
for (i = 0; session_variables[i] != NULL; i++) {
|
||||
if (g_getenv (session_variables[i]) == NULL) {
|
||||
g_subprocess_launcher_unsetenv (launcher, session_variables[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state->bus_address != NULL) {
|
||||
g_subprocess_launcher_setenv (launcher, "DBUS_SESSION_BUS_ADDRESS", state->bus_address, TRUE);
|
||||
}
|
||||
|
||||
subprocess = g_subprocess_launcher_spawnv (launcher,
|
||||
(const char * const *) argv,
|
||||
&error);
|
||||
g_strfreev (argv);
|
||||
|
||||
if (subprocess == NULL) {
|
||||
g_debug ("could not start session: %s", error->message);
|
||||
goto out;
|
||||
}
|
||||
|
||||
state->session_subprocess = g_object_ref (subprocess);
|
||||
|
||||
g_subprocess_wait_async (state->session_subprocess,
|
||||
cancellable,
|
||||
(GAsyncReadyCallback)
|
||||
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
|
||||
index 5962da572..b15483614 100644
|
||||
--- a/daemon/gdm-x-session.c
|
||||
+++ b/daemon/gdm-x-session.c
|
||||
@@ -588,102 +588,82 @@ on_session_finished (GSubprocess *subprocess,
|
||||
|
||||
state->session_exit_status = exit_status;
|
||||
} else {
|
||||
int signal_number;
|
||||
|
||||
signal_number = g_subprocess_get_term_sig (subprocess);
|
||||
g_debug ("session was killed with status %d", signal_number);
|
||||
}
|
||||
|
||||
g_clear_object (&state->session_subprocess);
|
||||
out:
|
||||
g_main_loop_quit (state->main_loop);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
spawn_session (State *state,
|
||||
gboolean run_script,
|
||||
GCancellable *cancellable)
|
||||
{
|
||||
GSubprocessLauncher *launcher = NULL;
|
||||
GSubprocess *subprocess = NULL;
|
||||
GError *error = NULL;
|
||||
gboolean is_running = FALSE;
|
||||
const char *vt;
|
||||
static const char *session_variables[] = { "DISPLAY",
|
||||
"XAUTHORITY",
|
||||
"WAYLAND_DISPLAY",
|
||||
"WAYLAND_SOCKET",
|
||||
"GNOME_SHELL_SESSION_MODE",
|
||||
NULL };
|
||||
- /* The environment variables listed below are those we have set (or
|
||||
- * received from our own execution environment) only as a fallback to
|
||||
- * make things work, as opposed to a information directly pertaining to
|
||||
- * the session about to be started. Variables listed here will not
|
||||
- * overwrite the existing environment (possibly) imported from the
|
||||
- * systemd --user instance.
|
||||
- * As an example: We need a PATH for some of the launched subprocesses
|
||||
- * to work, but if the user (or the distributor) has customized the PATH
|
||||
- * via one of systemds user-environment-generators, that version should
|
||||
- * be preferred. */
|
||||
- static const char *fallback_variables[] = { "PATH", NULL };
|
||||
|
||||
g_debug ("Running X session");
|
||||
|
||||
launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
|
||||
|
||||
if (state->environment != NULL) {
|
||||
size_t i;
|
||||
|
||||
for (i = 0; state->environment[i] != NULL; i++) {
|
||||
g_auto(GStrv) environment_entry = NULL;
|
||||
|
||||
if (state->environment[i][0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
environment_entry = g_strsplit (state->environment[i], "=", 2);
|
||||
|
||||
if (environment_entry[0] == NULL || environment_entry[1] == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
- /* Merge the environment block imported from systemd --user with the
|
||||
- * environment we have set for ourselves (and thus pass on to the
|
||||
- * launcher process). Variables we have set have precedence, as to not
|
||||
- * import stale data from prior user sessions, with the exception of
|
||||
- * those listed in fallback_variables. See the comment there for more
|
||||
- * explanations. */
|
||||
- g_subprocess_launcher_setenv (launcher,
|
||||
- environment_entry[0],
|
||||
- environment_entry[1],
|
||||
- g_strv_contains (fallback_variables, environment_entry[0]));
|
||||
+ g_subprocess_launcher_setenv (launcher, environment_entry[0], environment_entry[1], FALSE);
|
||||
}
|
||||
|
||||
/* Don't allow session specific environment variables from earlier sessions to
|
||||
* leak through */
|
||||
for (i = 0; session_variables[i] != NULL; i++) {
|
||||
if (g_getenv (session_variables[i]) == NULL) {
|
||||
g_subprocess_launcher_unsetenv (launcher, session_variables[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_subprocess_launcher_setenv (launcher, "DISPLAY", state->display_name, TRUE);
|
||||
g_subprocess_launcher_setenv (launcher, "XAUTHORITY", state->auth_file, TRUE);
|
||||
|
||||
if (state->bus_address != NULL) {
|
||||
g_subprocess_launcher_setenv (launcher, "DBUS_SESSION_BUS_ADDRESS", state->bus_address, TRUE);
|
||||
}
|
||||
|
||||
vt = g_getenv ("XDG_VTNR");
|
||||
|
||||
if (vt != NULL) {
|
||||
g_subprocess_launcher_setenv (launcher, "WINDOWPATH", vt, TRUE);
|
||||
}
|
||||
|
||||
if (run_script) {
|
||||
subprocess = g_subprocess_launcher_spawn (launcher,
|
||||
&error,
|
||||
GDMCONFDIR "/Xsession",
|
||||
state->session_command,
|
||||
NULL);
|
||||
--
|
||||
2.30.1
|
||||
|
86
SOURCES/0001-build-Support-keyutils-1.5.11-and-older.patch
Normal file
86
SOURCES/0001-build-Support-keyutils-1.5.11-and-older.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From 2fc7d94280a82e079129468d9b0db312725e5926 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 12 Dec 2022 15:37:38 -0500
|
||||
Subject: [PATCH 1/2] build: Support keyutils 1.5.11 and older
|
||||
|
||||
keyutils didn't get a pkgconfig file until 1.6.
|
||||
|
||||
This commit looks for the library directly if it can't find
|
||||
the pkgconfig file.
|
||||
---
|
||||
meson.build | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 4a286f97..1a557e9a 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -26,60 +26,65 @@ lang_config_file = (get_option('lang-file') != '')? get_option('lang-file') : gd
|
||||
pam_mod_dir = (get_option('pam-mod-dir') != '')? get_option('pam-mod-dir') : gdm_prefix / get_option('libdir') / 'security'
|
||||
dbus_sys_dir = (get_option('dbus-sys') != '')? get_option('dbus-sys') : get_option('sysconfdir') / 'dbus-1' / 'system.d'
|
||||
gdm_defaults_conf = (get_option('defaults-conf') != '')? get_option('defaults-conf') : gdm_prefix / get_option('datadir') / 'gdm' / 'defaults.conf'
|
||||
gdm_custom_conf = (get_option('custom-conf') != '')? get_option('custom-conf') : gdmconfdir / 'custom.conf'
|
||||
gnome_settings_daemon_dir = (get_option('gnome-settings-daemon-dir') != '')? get_option('gnome-settings-daemon-dir') : gdm_prefix / get_option('libexecdir')
|
||||
gdm_run_dir = (get_option('run-dir') != '')? get_option('run-dir') : gdm_prefix / get_option('localstatedir') / 'run' / 'gdm'
|
||||
gdm_runtime_conf = (get_option('runtime-conf') != '')? get_option('runtime-conf') : gdm_run_dir / 'custom.conf'
|
||||
gdm_pid_file = (get_option('pid-file') != '')? get_option('pid-file') : gdm_run_dir / 'gdm.pid'
|
||||
ran_once_marker_dir = (get_option('ran-once-marker-dir') != '')? get_option('ran-once-marker-dir') : gdm_run_dir
|
||||
working_dir = (get_option('working-dir') != '')? get_option('working-dir') : gdm_prefix / get_option('localstatedir') / 'lib' / 'gdm'
|
||||
gdm_xauth_dir = (get_option('xauth-dir') != '')? get_option('xauth-dir') : gdm_run_dir
|
||||
gdm_screenshot_dir = (get_option('screenshot-dir') != '')? get_option('screenshot-dir') : gdm_run_dir / 'greeter'
|
||||
|
||||
# Common variables
|
||||
config_h_dir = include_directories('.')
|
||||
|
||||
# Dependencies
|
||||
udev_dep = dependency('udev')
|
||||
|
||||
glib_min_version = '2.56.0'
|
||||
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
|
||||
libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
|
||||
accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
|
||||
xcb_dep = dependency('xcb')
|
||||
keyutils_dep = dependency('libkeyutils', required: false)
|
||||
+
|
||||
+if not keyutils_dep.found()
|
||||
+ keyutils_dep = cc.find_library('libkeyutils')
|
||||
+endif
|
||||
+
|
||||
libselinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||
|
||||
# udev
|
||||
if udev_dir == ''
|
||||
if udev_dep.found()
|
||||
udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
|
||||
else
|
||||
udev_prefix = gdm_prefix / 'lib' / 'udev'
|
||||
endif
|
||||
udev_dir = udev_prefix / 'rules.d'
|
||||
endif
|
||||
|
||||
# X11
|
||||
x_deps = declare_dependency(
|
||||
dependencies: [
|
||||
dependency('x11'),
|
||||
dependency('xau'),
|
||||
],
|
||||
)
|
||||
# Xserver 1.17 & later default to -nolisten and require -listen for remote access
|
||||
xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
|
||||
xserver_has_listen = xserver_deps.found()
|
||||
find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
|
||||
find_x_server_out = run_command(find_x_server_script).stdout().strip()
|
||||
if find_x_server_out != ''
|
||||
x_bin = find_x_server_out
|
||||
x_bin_path_split = x_bin.split('/')
|
||||
i = 0
|
||||
x_path = '/'
|
||||
foreach dir : x_bin_path_split
|
||||
--
|
||||
2.35.1
|
||||
|
570
SOURCES/0001-daemon-Don-t-error-on-shutdown.patch
Normal file
570
SOURCES/0001-daemon-Don-t-error-on-shutdown.patch
Normal file
@ -0,0 +1,570 @@
|
||||
From fbdb5fdfc5f4c5569643239cae1d6fe5fac13717 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 12 Dec 2022 10:52:58 -0500
|
||||
Subject: [PATCH] daemon: Don't error on shutdown
|
||||
|
||||
Right now we complain if shutdown happens while the display is
|
||||
comming up.
|
||||
|
||||
This commit detects that case and avoids the error in that case.
|
||||
---
|
||||
daemon/gdm-display.c | 28 +++++++++++++++++++++++++++-
|
||||
daemon/gdm-manager.c | 11 +++++++----
|
||||
2 files changed, 34 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
||||
index 9438fe72..a93857e9 100644
|
||||
--- a/daemon/gdm-display.c
|
||||
+++ b/daemon/gdm-display.c
|
||||
@@ -66,86 +66,88 @@ typedef struct _GdmDisplayPrivate
|
||||
char *x11_display_name;
|
||||
int status;
|
||||
time_t creation_time;
|
||||
|
||||
char *x11_cookie;
|
||||
gsize x11_cookie_size;
|
||||
GdmDisplayAccessFile *access_file;
|
||||
|
||||
guint finish_idle_id;
|
||||
|
||||
xcb_connection_t *xcb_connection;
|
||||
int xcb_screen_number;
|
||||
|
||||
GDBusConnection *connection;
|
||||
GdmDisplayAccessFile *user_access_file;
|
||||
|
||||
GdmDBusDisplay *display_skeleton;
|
||||
GDBusObjectSkeleton *object_skeleton;
|
||||
|
||||
GDBusProxy *accountsservice_proxy;
|
||||
|
||||
/* this spawns and controls the greeter session */
|
||||
GdmLaunchEnvironment *launch_environment;
|
||||
|
||||
guint is_local : 1;
|
||||
guint is_initial : 1;
|
||||
guint allow_timed_login : 1;
|
||||
guint have_existing_user_accounts : 1;
|
||||
guint doing_initial_setup : 1;
|
||||
guint session_registered : 1;
|
||||
+ guint shutting_down : 1;
|
||||
|
||||
GStrv supported_session_types;
|
||||
} GdmDisplayPrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_ID,
|
||||
PROP_STATUS,
|
||||
PROP_SEAT_ID,
|
||||
PROP_SESSION_ID,
|
||||
PROP_SESSION_CLASS,
|
||||
PROP_SESSION_TYPE,
|
||||
PROP_REMOTE_HOSTNAME,
|
||||
PROP_X11_DISPLAY_NUMBER,
|
||||
PROP_X11_DISPLAY_NAME,
|
||||
PROP_X11_COOKIE,
|
||||
PROP_X11_AUTHORITY_FILE,
|
||||
PROP_IS_CONNECTED,
|
||||
PROP_IS_LOCAL,
|
||||
PROP_LAUNCH_ENVIRONMENT,
|
||||
PROP_IS_INITIAL,
|
||||
PROP_ALLOW_TIMED_LOGIN,
|
||||
PROP_HAVE_EXISTING_USER_ACCOUNTS,
|
||||
PROP_DOING_INITIAL_SETUP,
|
||||
PROP_SESSION_REGISTERED,
|
||||
PROP_SUPPORTED_SESSION_TYPES,
|
||||
+ PROP_SHUTTING_DOWN,
|
||||
};
|
||||
|
||||
static void gdm_display_class_init (GdmDisplayClass *klass);
|
||||
static void gdm_display_init (GdmDisplay *self);
|
||||
static void gdm_display_finalize (GObject *object);
|
||||
static void queue_finish (GdmDisplay *self);
|
||||
static void _gdm_display_set_status (GdmDisplay *self,
|
||||
int status);
|
||||
static gboolean wants_initial_setup (GdmDisplay *self);
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdmDisplay, gdm_display, G_TYPE_OBJECT)
|
||||
|
||||
GQuark
|
||||
gdm_display_error_quark (void)
|
||||
{
|
||||
static GQuark ret = 0;
|
||||
if (ret == 0) {
|
||||
ret = g_quark_from_static_string ("gdm_display_error");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
time_t
|
||||
gdm_display_get_creation_time (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), 0);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
@@ -665,61 +667,61 @@ gdm_display_disconnect (GdmDisplay *self)
|
||||
}
|
||||
|
||||
xcb_flush (priv->xcb_connection);
|
||||
|
||||
g_clear_pointer (&priv->xcb_connection, xcb_disconnect);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_unmanage (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
gdm_display_disconnect (self);
|
||||
|
||||
if (priv->user_access_file != NULL) {
|
||||
gdm_display_access_file_close (priv->user_access_file);
|
||||
g_object_unref (priv->user_access_file);
|
||||
priv->user_access_file = NULL;
|
||||
}
|
||||
|
||||
if (priv->access_file != NULL) {
|
||||
gdm_display_access_file_close (priv->access_file);
|
||||
g_object_unref (priv->access_file);
|
||||
priv->access_file = NULL;
|
||||
}
|
||||
|
||||
- if (!priv->session_registered) {
|
||||
+ if (!priv->session_registered && !priv->shutting_down) {
|
||||
g_warning ("GdmDisplay: Session never registered, failing");
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_FAILED);
|
||||
} else {
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_UNMANAGED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_get_id (GdmDisplay *self,
|
||||
char **id,
|
||||
GError **error)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
if (id != NULL) {
|
||||
*id = g_strdup (priv->id);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_get_x11_display_name (GdmDisplay *self,
|
||||
char **x11_display,
|
||||
GError **error)
|
||||
@@ -851,60 +853,70 @@ _gdm_display_set_x11_cookie (GdmDisplay *self,
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_free (priv->x11_cookie);
|
||||
priv->x11_cookie = g_strdup (x11_cookie);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_is_local (GdmDisplay *self,
|
||||
gboolean is_local)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_debug ("GdmDisplay: local: %s", is_local? "yes" : "no");
|
||||
priv->is_local = is_local;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_session_registered (GdmDisplay *self,
|
||||
gboolean registered)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_debug ("GdmDisplay: session registered: %s", registered? "yes" : "no");
|
||||
priv->session_registered = registered;
|
||||
}
|
||||
|
||||
+static void
|
||||
+_gdm_display_set_shutting_down (GdmDisplay *self,
|
||||
+ gboolean shutting_down)
|
||||
+{
|
||||
+ GdmDisplayPrivate *priv;
|
||||
+
|
||||
+ priv = gdm_display_get_instance_private (self);
|
||||
+ priv->shutting_down = shutting_down;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
_gdm_display_set_launch_environment (GdmDisplay *self,
|
||||
GdmLaunchEnvironment *launch_environment)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
g_clear_object (&priv->launch_environment);
|
||||
|
||||
priv->launch_environment = g_object_ref (launch_environment);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_is_initial (GdmDisplay *self,
|
||||
gboolean initial)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_debug ("GdmDisplay: initial: %s", initial? "yes" : "no");
|
||||
priv->is_initial = initial;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_allow_timed_login (GdmDisplay *self,
|
||||
gboolean allow_timed_login)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
@@ -962,60 +974,63 @@ gdm_display_set_property (GObject *object,
|
||||
case PROP_REMOTE_HOSTNAME:
|
||||
_gdm_display_set_remote_hostname (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_X11_DISPLAY_NUMBER:
|
||||
_gdm_display_set_x11_display_number (self, g_value_get_int (value));
|
||||
break;
|
||||
case PROP_X11_DISPLAY_NAME:
|
||||
_gdm_display_set_x11_display_name (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_X11_COOKIE:
|
||||
_gdm_display_set_x11_cookie (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_IS_LOCAL:
|
||||
_gdm_display_set_is_local (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_ALLOW_TIMED_LOGIN:
|
||||
_gdm_display_set_allow_timed_login (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_LAUNCH_ENVIRONMENT:
|
||||
_gdm_display_set_launch_environment (self, g_value_get_object (value));
|
||||
break;
|
||||
case PROP_IS_INITIAL:
|
||||
_gdm_display_set_is_initial (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_SESSION_REGISTERED:
|
||||
_gdm_display_set_session_registered (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_SUPPORTED_SESSION_TYPES:
|
||||
_gdm_display_set_supported_session_types (self, g_value_get_boxed (value));
|
||||
break;
|
||||
+ case PROP_SHUTTING_DOWN:
|
||||
+ _gdm_display_set_shutting_down (self, g_value_get_boolean (value));
|
||||
+ break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdmDisplay *self;
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
self = GDM_DISPLAY (object);
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_ID:
|
||||
g_value_set_string (value, priv->id);
|
||||
break;
|
||||
case PROP_STATUS:
|
||||
g_value_set_int (value, priv->status);
|
||||
break;
|
||||
case PROP_SEAT_ID:
|
||||
g_value_set_string (value, priv->seat_id);
|
||||
break;
|
||||
case PROP_SESSION_ID:
|
||||
g_value_set_string (value, priv->session_id);
|
||||
@@ -1043,60 +1058,63 @@ gdm_display_get_property (GObject *object,
|
||||
priv->access_file?
|
||||
gdm_display_access_file_get_path (priv->access_file) : NULL);
|
||||
break;
|
||||
case PROP_IS_LOCAL:
|
||||
g_value_set_boolean (value, priv->is_local);
|
||||
break;
|
||||
case PROP_IS_CONNECTED:
|
||||
g_value_set_boolean (value, priv->xcb_connection != NULL);
|
||||
break;
|
||||
case PROP_LAUNCH_ENVIRONMENT:
|
||||
g_value_set_object (value, priv->launch_environment);
|
||||
break;
|
||||
case PROP_IS_INITIAL:
|
||||
g_value_set_boolean (value, priv->is_initial);
|
||||
break;
|
||||
case PROP_HAVE_EXISTING_USER_ACCOUNTS:
|
||||
g_value_set_boolean (value, priv->have_existing_user_accounts);
|
||||
break;
|
||||
case PROP_DOING_INITIAL_SETUP:
|
||||
g_value_set_boolean (value, priv->doing_initial_setup);
|
||||
break;
|
||||
case PROP_SESSION_REGISTERED:
|
||||
g_value_set_boolean (value, priv->session_registered);
|
||||
break;
|
||||
case PROP_ALLOW_TIMED_LOGIN:
|
||||
g_value_set_boolean (value, priv->allow_timed_login);
|
||||
break;
|
||||
case PROP_SUPPORTED_SESSION_TYPES:
|
||||
g_value_set_boxed (value, priv->supported_session_types);
|
||||
break;
|
||||
+ case PROP_SHUTTING_DOWN:
|
||||
+ g_value_set_boolean (value, priv->shutting_down);
|
||||
+ break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_get_id (GdmDBusDisplay *skeleton,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
char *id;
|
||||
|
||||
gdm_display_get_id (self, &id, NULL);
|
||||
|
||||
gdm_dbus_display_complete_get_id (skeleton, invocation, id);
|
||||
|
||||
g_free (id);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_get_remote_hostname (GdmDBusDisplay *skeleton,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
char *hostname;
|
||||
|
||||
gdm_display_get_remote_hostname (self, &hostname, NULL);
|
||||
|
||||
@@ -1397,60 +1415,68 @@ gdm_display_class_init (GdmDisplayClass *klass)
|
||||
g_param_spec_boolean ("session-registered",
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_LAUNCH_ENVIRONMENT,
|
||||
g_param_spec_object ("launch-environment",
|
||||
NULL,
|
||||
NULL,
|
||||
GDM_TYPE_LAUNCH_ENVIRONMENT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_STATUS,
|
||||
g_param_spec_int ("status",
|
||||
"status",
|
||||
"status",
|
||||
-1,
|
||||
G_MAXINT,
|
||||
GDM_DISPLAY_UNMANAGED,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_SUPPORTED_SESSION_TYPES,
|
||||
g_param_spec_boxed ("supported-session-types",
|
||||
"supported session types",
|
||||
"supported session types",
|
||||
G_TYPE_STRV,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||
+
|
||||
+ g_object_class_install_property (object_class,
|
||||
+ PROP_SHUTTING_DOWN,
|
||||
+ g_param_spec_boolean ("shutting-down",
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ FALSE,
|
||||
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_init (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
priv->creation_time = time (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_finalize (GObject *object)
|
||||
{
|
||||
GdmDisplay *self;
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_DISPLAY (object));
|
||||
|
||||
self = GDM_DISPLAY (object);
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
g_return_if_fail (priv != NULL);
|
||||
|
||||
g_debug ("GdmDisplay: Finalizing display: %s", priv->id);
|
||||
g_free (priv->id);
|
||||
g_free (priv->seat_id);
|
||||
g_free (priv->session_class);
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index c70248f3..05851001 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -2759,117 +2759,120 @@ gdm_manager_init (GdmManager *manager)
|
||||
NULL,
|
||||
(GDestroyNotify)
|
||||
g_object_unref);
|
||||
manager->priv->transient_sessions = g_hash_table_new_full (NULL,
|
||||
NULL,
|
||||
(GDestroyNotify)
|
||||
NULL,
|
||||
(GDestroyNotify)
|
||||
g_object_unref);
|
||||
g_signal_connect (G_OBJECT (manager->priv->display_store),
|
||||
"display-added",
|
||||
G_CALLBACK (on_display_added),
|
||||
manager);
|
||||
|
||||
g_signal_connect (G_OBJECT (manager->priv->display_store),
|
||||
"display-removed",
|
||||
G_CALLBACK (on_display_removed),
|
||||
manager);
|
||||
}
|
||||
|
||||
static void
|
||||
unexport_display (const char *id,
|
||||
GdmDisplay *display,
|
||||
GdmManager *manager)
|
||||
{
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection))
|
||||
g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
|
||||
}
|
||||
|
||||
static void
|
||||
-finish_display (const char *id,
|
||||
- GdmDisplay *display,
|
||||
- GdmManager *manager)
|
||||
+shut_down_display (const char *id,
|
||||
+ GdmDisplay *display,
|
||||
+ GdmManager *manager)
|
||||
{
|
||||
gdm_display_stop_greeter_session (display);
|
||||
+
|
||||
+ g_object_set (G_OBJECT (display), "shutting-down", TRUE, NULL);
|
||||
+
|
||||
if (gdm_display_get_status (display) == GDM_DISPLAY_MANAGED)
|
||||
gdm_display_unmanage (display);
|
||||
gdm_display_finish (display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_manager_dispose (GObject *object)
|
||||
{
|
||||
GdmManager *manager;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_MANAGER (object));
|
||||
|
||||
manager = GDM_MANAGER (object);
|
||||
|
||||
g_return_if_fail (manager->priv != NULL);
|
||||
|
||||
gdm_manager_stop (manager);
|
||||
|
||||
g_clear_weak_pointer (&manager->priv->automatic_login_display);
|
||||
|
||||
#ifdef HAVE_LIBXDMCP
|
||||
g_clear_object (&manager->priv->xdmcp_factory);
|
||||
#endif
|
||||
g_clear_object (&manager->priv->local_factory);
|
||||
g_clear_pointer (&manager->priv->open_reauthentication_requests,
|
||||
g_hash_table_unref);
|
||||
g_clear_pointer (&manager->priv->transient_sessions,
|
||||
g_hash_table_unref);
|
||||
|
||||
g_list_foreach (manager->priv->user_sessions,
|
||||
(GFunc) gdm_session_close,
|
||||
NULL);
|
||||
g_list_free_full (manager->priv->user_sessions, (GDestroyNotify) g_object_unref);
|
||||
manager->priv->user_sessions = NULL;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_added),
|
||||
manager);
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_removed),
|
||||
manager);
|
||||
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection)) {
|
||||
gdm_display_store_foreach (manager->priv->display_store,
|
||||
(GdmDisplayStoreFunc)unexport_display,
|
||||
manager);
|
||||
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager));
|
||||
}
|
||||
|
||||
gdm_display_store_foreach (manager->priv->display_store,
|
||||
- (GdmDisplayStoreFunc) finish_display,
|
||||
+ (GdmDisplayStoreFunc) shut_down_display,
|
||||
manager);
|
||||
|
||||
gdm_display_store_clear (manager->priv->display_store);
|
||||
|
||||
g_dbus_object_manager_server_set_connection (manager->priv->object_manager, NULL);
|
||||
|
||||
g_clear_object (&manager->priv->connection);
|
||||
g_clear_object (&manager->priv->object_manager);
|
||||
g_clear_object (&manager->priv->display_store);
|
||||
|
||||
G_OBJECT_CLASS (gdm_manager_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
GdmManager *
|
||||
gdm_manager_new (void)
|
||||
{
|
||||
if (manager_object != NULL) {
|
||||
g_object_ref (manager_object);
|
||||
} else {
|
||||
gboolean res;
|
||||
|
||||
manager_object = g_object_new (GDM_TYPE_MANAGER, NULL);
|
||||
g_object_add_weak_pointer (manager_object,
|
||||
(gpointer *) &manager_object);
|
||||
res = register_manager (manager_object);
|
||||
if (! res) {
|
||||
g_object_unref (manager_object);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.37.0.rc1
|
||||
|
@ -0,0 +1,87 @@
|
||||
From ff689b18fd0a5fd03e5941723cb2adff3b7e4b24 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 29 Sep 2021 11:03:41 -0400
|
||||
Subject: [PATCH] daemon: Infer session type from desktop file if user has no
|
||||
saved session type
|
||||
|
||||
The accountsservice user cache file can specify a session type
|
||||
associated with the saved session. This is optional though. If one
|
||||
isn't specified GDM needs to figure out the session type based on the
|
||||
list of preferred session types for the system and the session file
|
||||
itself.
|
||||
|
||||
It was failing to do the latter, though. This commit fixes that.
|
||||
---
|
||||
daemon/gdm-session.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index 29459346..72afe7b2 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -988,60 +988,62 @@ worker_on_saved_language_name_read (GdmDBusWorker *worker,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
worker_on_saved_session_name_read (GdmDBusWorker *worker,
|
||||
const char *session_name,
|
||||
GdmSessionConversation *conversation)
|
||||
{
|
||||
GdmSession *self = conversation->session;
|
||||
|
||||
if (! get_session_command_for_name (self, session_name, NULL)) {
|
||||
/* ignore sessions that don't exist */
|
||||
g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = NULL;
|
||||
update_session_type (self);
|
||||
} else {
|
||||
if (strcmp (session_name,
|
||||
get_default_session_name (self)) != 0) {
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = g_strdup (session_name);
|
||||
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
|
||||
session_name);
|
||||
}
|
||||
}
|
||||
if (self->saved_session_type != NULL)
|
||||
set_session_type (self, self->saved_session_type);
|
||||
+ else
|
||||
+ update_session_type (self);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static GdmSessionConversation *
|
||||
find_conversation_by_pid (GdmSession *self,
|
||||
GPid pid)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
g_hash_table_iter_init (&iter, self->conversations);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
conversation = (GdmSessionConversation *) value;
|
||||
|
||||
if (conversation->worker_pid == pid) {
|
||||
return conversation;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
allow_worker_function (GDBusAuthObserver *observer,
|
||||
GIOStream *stream,
|
||||
GCredentials *credentials,
|
||||
GdmSession *self)
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,135 +0,0 @@
|
||||
From b9f38b65417923624bf97a18daf1c2ede5e8651e Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Sun, 15 Dec 2019 14:51:44 -0500
|
||||
Subject: [PATCH] daemon: fix wayland detection when deciding to bypass
|
||||
Xsession
|
||||
|
||||
At the moment if there's a session file with the same name in
|
||||
both /usr/share/xsessions and /usr/share/wayland-sessions, GDM
|
||||
will think the wayland is getting used when deciding whether or
|
||||
not to bypass the /etc/gdm/Xsession script, even if wayland is
|
||||
explicitly being ignored.
|
||||
|
||||
This commit fixes the check.
|
||||
---
|
||||
daemon/gdm-session.c | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index a8263ba11..ecb2b3cac 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -3145,96 +3145,96 @@ gdm_session_get_session_id (GdmSession *self)
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
const char *
|
||||
gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
const char *service_name)
|
||||
{
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), NULL);
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_session_filename (GdmSession *self)
|
||||
{
|
||||
return g_strdup_printf ("%s.desktop", get_session_name (self));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
static gboolean
|
||||
gdm_session_is_wayland_session (GdmSession *self)
|
||||
{
|
||||
- GKeyFile *key_file;
|
||||
+ g_autoptr (GKeyFile) key_file = NULL;
|
||||
gboolean is_wayland_session = FALSE;
|
||||
- char *filename;
|
||||
- char *full_path = NULL;
|
||||
+ g_autofree char *filename = NULL;
|
||||
+ g_autofree char *full_path = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
- key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
|
||||
+ if (!self->priv->ignore_wayland) {
|
||||
+ key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
|
||||
|
||||
- if (key_file == NULL) {
|
||||
- goto out;
|
||||
- }
|
||||
+ if (key_file == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
- if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
- is_wayland_session = TRUE;
|
||||
+ if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
+ is_wayland_session = TRUE;
|
||||
+ }
|
||||
}
|
||||
- g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
|
||||
out:
|
||||
- g_clear_pointer (&key_file, (GDestroyNotify) g_key_file_free);
|
||||
- g_free (filename);
|
||||
+ g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
+
|
||||
return is_wayland_session;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
update_session_type (GdmSession *self)
|
||||
{
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
gboolean is_wayland_session = FALSE;
|
||||
|
||||
- if (!self->priv->ignore_wayland)
|
||||
- is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
+ is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
|
||||
if (is_wayland_session) {
|
||||
set_session_type (self, "wayland");
|
||||
} else {
|
||||
set_session_type (self, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_bypasses_xsession (GdmSession *self)
|
||||
{
|
||||
GError *error;
|
||||
GKeyFile *key_file;
|
||||
gboolean res;
|
||||
gboolean bypasses_xsession = FALSE;
|
||||
char *filename = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
if (gdm_session_is_wayland_session (self)) {
|
||||
bypasses_xsession = TRUE;
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
--
|
||||
2.18.1
|
||||
|
@ -0,0 +1,103 @@
|
||||
From cebcf2a4d29f01061dedf8714db2842b9582900c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Tue, 8 Jun 2021 20:45:00 +0200
|
||||
Subject: [PATCH 1/3] data: Disable network configuration on login screen
|
||||
|
||||
---
|
||||
data/meson.build | 10 ++++++++++
|
||||
data/org.gnome.gdm.rules.in | 8 ++++++++
|
||||
2 files changed, 18 insertions(+)
|
||||
create mode 100644 data/org.gnome.gdm.rules.in
|
||||
|
||||
diff --git a/data/meson.build b/data/meson.build
|
||||
index 23e2d7f9f..cbd6a6a21 100644
|
||||
--- a/data/meson.build
|
||||
+++ b/data/meson.build
|
||||
@@ -131,60 +131,70 @@ pam_data_files_map = {
|
||||
'arch': [
|
||||
'gdm-autologin',
|
||||
'gdm-launch-environment',
|
||||
'gdm-fingerprint',
|
||||
'gdm-smartcard',
|
||||
'gdm-password',
|
||||
'gdm-pin',
|
||||
],
|
||||
'none': [],
|
||||
# We should no longer have 'autodetect' at this point
|
||||
}
|
||||
|
||||
pam_data_files = pam_data_files_map[default_pam_config]
|
||||
pam_prefix = (get_option('pam-prefix') != '')? get_option('pam-prefix') : get_option('sysconfdir')
|
||||
foreach _pam_filename : pam_data_files
|
||||
install_data('pam-@0@/@1@.pam'.format(default_pam_config, _pam_filename),
|
||||
rename: _pam_filename,
|
||||
install_dir: pam_prefix / 'pam.d',
|
||||
)
|
||||
endforeach
|
||||
|
||||
gdm_rules = configure_file(
|
||||
input: '61-gdm.rules.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: {
|
||||
'libexecdir': gdm_prefix / get_option('libexecdir'),
|
||||
},
|
||||
install_dir: udev_dir,
|
||||
)
|
||||
|
||||
+# Polkit rules
|
||||
+polkit_rules = configure_file(
|
||||
+ input: 'org.gnome.gdm.rules.in',
|
||||
+ output: '@BASENAME@',
|
||||
+ configuration: {
|
||||
+ 'GDM_USERNAME': get_option('user'),
|
||||
+ },
|
||||
+ install_dir: get_option('datadir') / 'polkit-1' / 'rules.d',
|
||||
+)
|
||||
+
|
||||
# DBus service files
|
||||
service_config = configuration_data()
|
||||
service_config.set('sbindir', gdm_prefix / get_option('sbindir'))
|
||||
service_config.set('GDM_INITIAL_VT', get_option('initial-vt'))
|
||||
service_config.set('LANG_CONFIG_FILE', lang_config_file)
|
||||
if plymouth_dep.found()
|
||||
service_config.set('PLYMOUTH_QUIT_SERVICE', 'plymouth-quit.service')
|
||||
else
|
||||
service_config.set('PLYMOUTH_QUIT_SERVICE', '')
|
||||
endif
|
||||
|
||||
if get_option('systemdsystemunitdir') != ''
|
||||
systemd_systemunitdir = get_option('systemdsystemunitdir')
|
||||
else
|
||||
systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
|
||||
endif
|
||||
|
||||
if get_option('systemduserunitdir') != ''
|
||||
systemd_userunitdir = get_option('systemduserunitdir')
|
||||
else
|
||||
systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
|
||||
define_variable: ['prefix', get_option('prefix')])
|
||||
endif
|
||||
|
||||
configure_file(
|
||||
input: 'gdm.service.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: service_config,
|
||||
install_dir: systemd_systemunitdir,
|
||||
format: 'cmake'
|
||||
diff --git a/data/org.gnome.gdm.rules.in b/data/org.gnome.gdm.rules.in
|
||||
new file mode 100644
|
||||
index 000000000..09544f11e
|
||||
--- /dev/null
|
||||
+++ b/data/org.gnome.gdm.rules.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+polkit.addRule(function(action, subject) {
|
||||
+ if (action.id == "org.freedesktop.NetworkManager.network-control" &&
|
||||
+ subject.user == "@GDM_USERNAME@") {
|
||||
+ return polkit.Result.NO;
|
||||
+ }
|
||||
+
|
||||
+ return polkit.Result.NOT_HANDLED;
|
||||
+});
|
||||
--
|
||||
2.30.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 29d374ce6781df6f3b168a8c57163ddb582c998a Mon Sep 17 00:00:00 2001
|
||||
From 8c9fe8ebd9e584adaec0a80ee4c4eaf5357422a5 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 31 Jul 2013 17:32:55 -0400
|
||||
Subject: [PATCH] data: add system dconf databases to gdm profile
|
||||
Subject: [PATCH 1/2] data: add system dconf databases to gdm profile
|
||||
|
||||
This way system settings can affect the login screen.
|
||||
---
|
||||
@ -9,14 +9,16 @@ This way system settings can affect the login screen.
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/data/dconf/gdm.in b/data/dconf/gdm.in
|
||||
index 4d8bf174..9694078f 100644
|
||||
index 4d8bf1748..9694078fb 100644
|
||||
--- a/data/dconf/gdm.in
|
||||
+++ b/data/dconf/gdm.in
|
||||
@@ -1,2 +1,5 @@
|
||||
@@ -1,2 +1,6 @@
|
||||
user-db:user
|
||||
+system-db:gdm
|
||||
+system-db:local
|
||||
+system-db:site
|
||||
+system-db:distro
|
||||
file-db:@DATADIR@/@PACKAGE@/greeter-dconf-defaults
|
||||
--
|
||||
2.11.1
|
||||
--
|
||||
2.30.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From f2ac0603854c7933ecea4a13876fa7e72fd66d1a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
||||
Date: Thu, 6 Sep 2018 10:14:08 -0400
|
||||
Subject: [PATCH] data: disable wayland for proprietary nvidia machines
|
||||
|
||||
At the moment GLX applications don't work well when the
|
||||
proprietary nvidia driver is used with a wayland session.
|
||||
|
||||
For now, disable wayland on that hardware, and users who
|
||||
want to opt in can just edit the udev rule.
|
||||
(or add their own that overrides it)
|
||||
---
|
||||
data/61-gdm.rules.in | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||
index de8e17903..26cf9cf51 100644
|
||||
--- a/data/61-gdm.rules.in
|
||||
+++ b/data/61-gdm.rules.in
|
||||
@@ -1,2 +1,5 @@
|
||||
# disable Wayland on Cirrus chipsets
|
||||
ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland when using the proprietary nvidia driver
|
||||
+DRIVER=="nvidia", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
--
|
||||
2.20.1
|
||||
|
63
SOURCES/0001-data-disable-wayland-on-certain-hardware.patch
Normal file
63
SOURCES/0001-data-disable-wayland-on-certain-hardware.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From e01c0894669f5fe3d1a1c4148b7507e61b95d035 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 11 Feb 2019 18:14:07 -0500
|
||||
Subject: [PATCH] data: disable wayland on certain hardware
|
||||
|
||||
We're having issues with wayland on passthrough to virt
|
||||
setups and with the vendor nvidia driver on hybrid graphics
|
||||
setups, so disable it in those cases.
|
||||
|
||||
Also disable it on server chips for performance reasons.
|
||||
---
|
||||
data/61-gdm.rules.in | 39 +++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 35 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||
index b1da191f..d599a146 100644
|
||||
--- a/data/61-gdm.rules.in
|
||||
+++ b/data/61-gdm.rules.in
|
||||
@@ -1,6 +1,37 @@
|
||||
# disable Wayland on Hi1710 chipsets
|
||||
-ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||
-# disable Wayland when using the proprietary nvidia driver
|
||||
-DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||
+ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on Matrox chipsets
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0522", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0524", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0530", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0533", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0534", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0536", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0538", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on aspeed chipsets
|
||||
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2010", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2000", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on hybrid systems with vendor nvidia driver
|
||||
+# default to Xorg on single gpu vendor nvidia systems
|
||||
+DRIVER=="nvidia", ENV{GDM_HAS_VENDOR_NVIDIA_DRIVER}="1"
|
||||
+DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon PreferredDisplayServer xorg"
|
||||
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_NVIDIA_DRIVER}=="1", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="nvidia_drm", ATTR{parameters/modeset}=="N", RUN+="/usr/libexec/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on HyperV guests
|
||||
+DRIVER=="hyperv_fb", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on passthrough graphics setups for now (assumes passthrough if
|
||||
+# there is more than one card, and one of the cards is virt: cirrus, bochs, qxl)
|
||||
+ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||
+ATTR{vendor}=="0x1b36", ATTR{device}=="0x0100", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||
+ATTR{vendor}=="0x1234", ATTR{device}=="0x1111", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||
+
|
||||
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_VIRTUAL_GPU}=="1", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
# disable Wayland if modesetting is disabled
|
||||
-IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||
+IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 13a617e15cca421962be888b5607a9900bbfef51 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 11 Feb 2019 18:14:07 -0500
|
||||
Subject: [PATCH] data: disable wayland on server chips and dual gpu setups
|
||||
|
||||
We're still having a variety of issues on server chips and
|
||||
dual gpu/hybrid graphics setups.
|
||||
|
||||
This commit forces Xorg for those cases.
|
||||
---
|
||||
data/61-gdm.rules.in | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||
index 26cf9cf51..e3631740d 100644
|
||||
--- a/data/61-gdm.rules.in
|
||||
+++ b/data/61-gdm.rules.in
|
||||
@@ -1,5 +1,23 @@
|
||||
# disable Wayland on Cirrus chipsets
|
||||
ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
+# disable Wayland on Matrox chipsets
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0522", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0524", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0530", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0533", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0534", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0536", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0538", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on aspeed chipsets
|
||||
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2010", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2000", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
# disable Wayland when using the proprietary nvidia driver
|
||||
DRIVER=="nvidia", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on hybrid graphics setups for now
|
||||
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 7d9b41f1d82589999f8c89ed3bcc4eec6cee4978 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Fri, 6 Dec 2019 13:59:43 -0500
|
||||
Subject: [PATCH] data: enable wayland on cirrus
|
||||
|
||||
cirrus in the 5.2 kernel was substantially rewritten and is more wayland
|
||||
ready.
|
||||
|
||||
This commit reenables wayland on cirrus.
|
||||
---
|
||||
data/61-gdm.rules.in | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||
index e3631740d..fc2e3315c 100644
|
||||
--- a/data/61-gdm.rules.in
|
||||
+++ b/data/61-gdm.rules.in
|
||||
@@ -1,23 +1,20 @@
|
||||
-# disable Wayland on Cirrus chipsets
|
||||
-ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
-
|
||||
# disable Wayland on Matrox chipsets
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0522", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0524", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0530", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0533", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0534", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0536", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0538", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
# disable Wayland on aspeed chipsets
|
||||
ATTR{vendor}=="0x1a03", ATTR{device}=="0x2010", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x1a03", ATTR{device}=="0x2000", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
# disable Wayland when using the proprietary nvidia driver
|
||||
DRIVER=="nvidia", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
# disable Wayland on hybrid graphics setups for now
|
||||
SUBSYSTEM=="drm", KERNEL=="card[1-9]*", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,55 +0,0 @@
|
||||
From ab9510df0b5f7bc29662804991729c6d6ee38b70 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 12 Dec 2019 16:56:16 -0500
|
||||
Subject: [PATCH] data: only disable wayland on passthrough virt setups
|
||||
|
||||
at the moment we disable wayland on all hybrid graphics setups,
|
||||
but most hybrid graphics setups work fine.
|
||||
|
||||
The case we really care about is passthrough virt. in that case,
|
||||
wayland is a bad idea because:
|
||||
1) kernel crashes
|
||||
2) mutter provides no way to disable one of the cards, and will
|
||||
always use one as a secondary gpu
|
||||
|
||||
This commit forces xorg in passthrough setups so the user can use
|
||||
an xorg.conf to turn one of the cards off.
|
||||
---
|
||||
data/61-gdm.rules.in | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||
index fc2e3315c..f971224cf 100644
|
||||
--- a/data/61-gdm.rules.in
|
||||
+++ b/data/61-gdm.rules.in
|
||||
@@ -1,20 +1,25 @@
|
||||
# disable Wayland on Matrox chipsets
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0522", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0524", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0530", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0533", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0534", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0536", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x102b", ATTR{device}=="0x0538", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
# disable Wayland on aspeed chipsets
|
||||
ATTR{vendor}=="0x1a03", ATTR{device}=="0x2010", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
ATTR{vendor}=="0x1a03", ATTR{device}=="0x2000", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
# disable Wayland when using the proprietary nvidia driver
|
||||
DRIVER=="nvidia", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
-# disable Wayland on hybrid graphics setups for now
|
||||
-SUBSYSTEM=="drm", KERNEL=="card[1-9]*", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+# disable Wayland on passthrough graphics setups for now (assumes passthrough if
|
||||
+# there is more than one card, and one of the cards is virt: cirrus, bochs, qxl)
|
||||
+ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||
+ATTR{vendor}=="0x1b36", ATTR{device}=="0x0100", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||
+ATTR{vendor}=="0x1234", ATTR{device}=="0x1111", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||
+
|
||||
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_VIRTUAL_GPU}=="1", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
55
SOURCES/0001-data-reap-gdm-sessions-on-shutdown.patch
Normal file
55
SOURCES/0001-data-reap-gdm-sessions-on-shutdown.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From 7f910ee7554703a2e775e73ace10ced5d7a0fe66 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Fri, 26 Jul 2019 14:06:16 -0400
|
||||
Subject: [PATCH] data: reap gdm sessions on shutdown
|
||||
|
||||
If GDM gets shutdown we should make sure all sessions get shutdown too.
|
||||
|
||||
This is a bit of a safety net in case any processes in the session are
|
||||
lingering after the orderly shutdown.
|
||||
---
|
||||
data/gdm.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/data/gdm.service.in b/data/gdm.service.in
|
||||
index 17e8a8de8..195bd0fdc 100644
|
||||
--- a/data/gdm.service.in
|
||||
+++ b/data/gdm.service.in
|
||||
@@ -1,33 +1,34 @@
|
||||
[Unit]
|
||||
Description=GNOME Display Manager
|
||||
|
||||
# replaces the getty
|
||||
Conflicts=getty@tty${GDM_INITIAL_VT}.service
|
||||
After=getty@tty${GDM_INITIAL_VT}.service
|
||||
|
||||
# replaces plymouth-quit since it quits plymouth on its own
|
||||
Conflicts=${PLYMOUTH_QUIT_SERVICE}
|
||||
After=${PLYMOUTH_QUIT_SERVICE}
|
||||
|
||||
# Needs all the dependencies of the services it's replacing
|
||||
# pulled from getty@.service and ${PLYMOUTH_QUIT_SERVICE}
|
||||
# (except for plymouth-quit-wait.service since it waits until
|
||||
# plymouth is quit, which we do)
|
||||
After=rc-local.service plymouth-start.service systemd-user-sessions.service
|
||||
|
||||
# GDM takes responsibility for stopping plymouth, so if it fails
|
||||
# for any reason, make sure plymouth still stops
|
||||
OnFailure=plymouth-quit.service
|
||||
|
||||
[Service]
|
||||
ExecStart=${sbindir}/gdm
|
||||
+ExecStopPost=-/usr/bin/bash -c 'for f in /run/systemd/sessions/*; do [ -f $f ] && /usr/bin/fgrep -q SERVICE=gdm $f && loginctl terminate-session $(basename $f); done'
|
||||
KillMode=mixed
|
||||
Restart=always
|
||||
IgnoreSIGPIPE=no
|
||||
BusName=org.gnome.DisplayManager
|
||||
EnvironmentFile=-${LANG_CONFIG_FILE}
|
||||
ExecReload=/bin/kill -SIGHUP $MAINPID
|
||||
KeyringMode=shared
|
||||
|
||||
[Install]
|
||||
Alias=display-manager.service
|
||||
--
|
||||
2.28.0
|
||||
|
@ -0,0 +1,155 @@
|
||||
From cbfb3ef99ecc9cbb4e6850e5dd0cc9fb65dd398a Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 1 Sep 2020 13:49:27 -0400
|
||||
Subject: [PATCH 1/3] display: Handle failure before display registration
|
||||
|
||||
Normally, e.g., gdm-wayland-session would register its display
|
||||
before starting the session. This display registration is how
|
||||
the display moves to the "managed" state. We currently detect
|
||||
session failure in gdm_display_unmanage. If gdm-wayland-session
|
||||
is killed before it registers the display, gdm_display_unmanage
|
||||
won't run, and failure won't be detected.
|
||||
|
||||
This commit make gdm_display_unmanage get called, even if the
|
||||
display isn't yet fully managed.
|
||||
---
|
||||
daemon/gdm-display.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
||||
index 7c954ad24..3a260923a 100644
|
||||
--- a/daemon/gdm-display.c
|
||||
+++ b/daemon/gdm-display.c
|
||||
@@ -648,62 +648,60 @@ gdm_display_disconnect (GdmDisplay *self)
|
||||
|
||||
/* resource_id_mask is the bits given to each client for
|
||||
* addressing resources */
|
||||
highest_client = (XID) ~unused_bits & ~setup->resource_id_mask;
|
||||
client_increment = setup->resource_id_mask + 1;
|
||||
|
||||
/* Kill every client but ourselves, then close our own connection
|
||||
*/
|
||||
for (client = 0;
|
||||
client <= highest_client;
|
||||
client += client_increment) {
|
||||
|
||||
if (client != setup->resource_id_base)
|
||||
xcb_kill_client (priv->xcb_connection, client);
|
||||
}
|
||||
|
||||
xcb_flush (priv->xcb_connection);
|
||||
|
||||
g_clear_pointer (&priv->xcb_connection, xcb_disconnect);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_unmanage (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
- g_debug ("GdmDisplay: unmanage display");
|
||||
-
|
||||
gdm_display_disconnect (self);
|
||||
|
||||
if (priv->user_access_file != NULL) {
|
||||
gdm_display_access_file_close (priv->user_access_file);
|
||||
g_object_unref (priv->user_access_file);
|
||||
priv->user_access_file = NULL;
|
||||
}
|
||||
|
||||
if (priv->access_file != NULL) {
|
||||
gdm_display_access_file_close (priv->access_file);
|
||||
g_object_unref (priv->access_file);
|
||||
priv->access_file = NULL;
|
||||
}
|
||||
|
||||
if (!priv->session_registered) {
|
||||
g_warning ("GdmDisplay: Session never registered, failing");
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_FAILED);
|
||||
} else {
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_UNMANAGED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_get_id (GdmDisplay *self,
|
||||
char **id,
|
||||
GError **error)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
@@ -1446,63 +1444,63 @@ gdm_display_get_object_skeleton (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
return priv->object_skeleton;
|
||||
}
|
||||
|
||||
static void
|
||||
on_launch_environment_session_opened (GdmLaunchEnvironment *launch_environment,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
char *session_id;
|
||||
|
||||
g_debug ("GdmDisplay: Greeter session opened");
|
||||
session_id = gdm_launch_environment_get_session_id (launch_environment);
|
||||
_gdm_display_set_session_id (self, session_id);
|
||||
g_free (session_id);
|
||||
}
|
||||
|
||||
static void
|
||||
on_launch_environment_session_started (GdmLaunchEnvironment *launch_environment,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
g_debug ("GdmDisplay: Greeter started");
|
||||
}
|
||||
|
||||
static void
|
||||
self_destruct (GdmDisplay *self)
|
||||
{
|
||||
g_object_ref (self);
|
||||
- if (gdm_display_get_status (self) == GDM_DISPLAY_MANAGED) {
|
||||
- gdm_display_unmanage (self);
|
||||
- }
|
||||
+
|
||||
+ g_debug ("GdmDisplay: initiating display self-destruct");
|
||||
+ gdm_display_unmanage (self);
|
||||
|
||||
if (gdm_display_get_status (self) != GDM_DISPLAY_FINISHED) {
|
||||
queue_finish (self);
|
||||
}
|
||||
g_object_unref (self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_launch_environment_session_stopped (GdmLaunchEnvironment *launch_environment,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
g_debug ("GdmDisplay: Greeter stopped");
|
||||
self_destruct (self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_launch_environment_session_exited (GdmLaunchEnvironment *launch_environment,
|
||||
int code,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
g_debug ("GdmDisplay: Greeter exited: %d", code);
|
||||
self_destruct (self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_launch_environment_session_died (GdmLaunchEnvironment *launch_environment,
|
||||
int signal,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
g_debug ("GdmDisplay: Greeter died: %d", signal);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,206 +0,0 @@
|
||||
From fb55ec1c2e2957eb4c11a220874e5089fd357286 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 16 May 2018 14:06:29 -0400
|
||||
Subject: [PATCH] display-access-file: drop unused function
|
||||
|
||||
gdm_display_access_file_remove_display is unused.
|
||||
|
||||
This commit drops it.
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=796176
|
||||
---
|
||||
daemon/gdm-display-access-file.c | 79 --------------------------------
|
||||
daemon/gdm-display-access-file.h | 3 --
|
||||
2 files changed, 82 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-display-access-file.c b/daemon/gdm-display-access-file.c
|
||||
index 9bf818d2a..c1f0f17a8 100644
|
||||
--- a/daemon/gdm-display-access-file.c
|
||||
+++ b/daemon/gdm-display-access-file.c
|
||||
@@ -536,139 +536,60 @@ gdm_display_access_file_add_display_with_cookie (GdmDisplayAccessFile *file,
|
||||
|| fflush (file->priv->fp) == EOF) {
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
"%s", g_strerror (errno));
|
||||
display_added = FALSE;
|
||||
} else {
|
||||
display_added = TRUE;
|
||||
}
|
||||
|
||||
/* If we wrote a FamilyLocal entry, we still want a FamilyWild
|
||||
* entry, because it's more resiliant against hostname changes
|
||||
*
|
||||
*/
|
||||
if (auth_entry.family == FamilyLocal) {
|
||||
auth_entry.family = FamilyWild;
|
||||
|
||||
if (XauWriteAuth (file->priv->fp, &auth_entry)
|
||||
&& fflush (file->priv->fp) != EOF) {
|
||||
display_added = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (auth_entry.address);
|
||||
g_free (auth_entry.number);
|
||||
g_free (auth_entry.name);
|
||||
|
||||
return display_added;
|
||||
}
|
||||
|
||||
-gboolean
|
||||
-gdm_display_access_file_remove_display (GdmDisplayAccessFile *file,
|
||||
- GdmDisplay *display,
|
||||
- GError **error)
|
||||
-{
|
||||
- Xauth *auth_entry;
|
||||
- unsigned short family;
|
||||
- unsigned short address_length;
|
||||
- char *address;
|
||||
- unsigned short number_length;
|
||||
- char *number;
|
||||
- unsigned short name_length;
|
||||
- char *name;
|
||||
-
|
||||
- gboolean result = FALSE;
|
||||
-
|
||||
- g_return_val_if_fail (file != NULL, FALSE);
|
||||
- g_return_val_if_fail (file->priv->path != NULL, FALSE);
|
||||
-
|
||||
- _get_auth_info_for_display (file, display,
|
||||
- &family,
|
||||
- &address_length,
|
||||
- &address,
|
||||
- &number_length,
|
||||
- &number,
|
||||
- &name_length,
|
||||
- &name);
|
||||
-
|
||||
- auth_entry = XauGetAuthByAddr (family,
|
||||
- address_length,
|
||||
- address,
|
||||
- number_length,
|
||||
- number,
|
||||
- name_length,
|
||||
- name);
|
||||
- g_free (address);
|
||||
- g_free (number);
|
||||
- g_free (name);
|
||||
-
|
||||
- if (auth_entry != NULL) {
|
||||
- XauDisposeAuth (auth_entry);
|
||||
- result = TRUE;
|
||||
- }
|
||||
-
|
||||
- /* If FamilyLocal, we also added a FamilyWild entry,
|
||||
- * so we need to clean that up too
|
||||
- */
|
||||
- if (family == FamilyLocal) {
|
||||
- auth_entry = XauGetAuthByAddr (FamilyWild,
|
||||
- address_length,
|
||||
- address,
|
||||
- number_length,
|
||||
- number,
|
||||
- name_length,
|
||||
- name);
|
||||
-
|
||||
- if (auth_entry != NULL) {
|
||||
- XauDisposeAuth (auth_entry);
|
||||
- result = TRUE;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-
|
||||
- if (result == FALSE) {
|
||||
- g_set_error (error,
|
||||
- GDM_DISPLAY_ACCESS_FILE_ERROR,
|
||||
- GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY,
|
||||
- "could not find authorization entry");
|
||||
- } else if (fflush (file->priv->fp) == EOF) {
|
||||
- g_set_error (error,
|
||||
- G_FILE_ERROR,
|
||||
- g_file_error_from_errno (errno),
|
||||
- "%s", g_strerror (errno));
|
||||
- result = FALSE;
|
||||
- }
|
||||
-
|
||||
- return result;
|
||||
-}
|
||||
-
|
||||
void
|
||||
gdm_display_access_file_close (GdmDisplayAccessFile *file)
|
||||
{
|
||||
char *auth_dir;
|
||||
|
||||
g_return_if_fail (file != NULL);
|
||||
g_return_if_fail (file->priv->fp != NULL);
|
||||
g_return_if_fail (file->priv->path != NULL);
|
||||
|
||||
errno = 0;
|
||||
if (g_unlink (file->priv->path) != 0) {
|
||||
g_warning ("GdmDisplayAccessFile: Unable to remove X11 authority database '%s': %s",
|
||||
file->priv->path,
|
||||
g_strerror (errno));
|
||||
}
|
||||
|
||||
/* still try to remove dir even if file remove failed,
|
||||
may have already been removed by someone else */
|
||||
/* we own the parent directory too */
|
||||
auth_dir = g_path_get_dirname (file->priv->path);
|
||||
if (auth_dir != NULL) {
|
||||
errno = 0;
|
||||
if (g_rmdir (auth_dir) != 0) {
|
||||
g_warning ("GdmDisplayAccessFile: Unable to remove X11 authority directory '%s': %s",
|
||||
auth_dir,
|
||||
g_strerror (errno));
|
||||
}
|
||||
g_free (auth_dir);
|
||||
}
|
||||
|
||||
diff --git a/daemon/gdm-display-access-file.h b/daemon/gdm-display-access-file.h
|
||||
index cc7de9e35..eff8dd011 100644
|
||||
--- a/daemon/gdm-display-access-file.h
|
||||
+++ b/daemon/gdm-display-access-file.h
|
||||
@@ -50,39 +50,36 @@ struct _GdmDisplayAccessFile
|
||||
GdmDisplayAccessFilePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GdmDisplayAccessFileClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
enum _GdmDisplayAccessFileError
|
||||
{
|
||||
GDM_DISPLAY_ACCESS_FILE_ERROR_GENERAL = 0,
|
||||
GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY
|
||||
};
|
||||
|
||||
GQuark gdm_display_access_file_error_quark (void);
|
||||
GType gdm_display_access_file_get_type (void);
|
||||
|
||||
GdmDisplayAccessFile *gdm_display_access_file_new (const char *username);
|
||||
gboolean gdm_display_access_file_open (GdmDisplayAccessFile *file,
|
||||
GError **error);
|
||||
gboolean gdm_display_access_file_add_display (GdmDisplayAccessFile *file,
|
||||
GdmDisplay *display,
|
||||
char **cookie,
|
||||
gsize *cookie_size,
|
||||
GError **error);
|
||||
gboolean gdm_display_access_file_add_display_with_cookie (GdmDisplayAccessFile *file,
|
||||
GdmDisplay *display,
|
||||
const char *cookie,
|
||||
gsize cookie_size,
|
||||
GError **error);
|
||||
-gboolean gdm_display_access_file_remove_display (GdmDisplayAccessFile *file,
|
||||
- GdmDisplay *display,
|
||||
- GError **error);
|
||||
|
||||
void gdm_display_access_file_close (GdmDisplayAccessFile *file);
|
||||
char *gdm_display_access_file_get_path (GdmDisplayAccessFile *file);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GDM_DISPLAY_ACCESS_FILE_H__ */
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,269 +0,0 @@
|
||||
From 781e865705b0c134271c9ec21655cd5d8ce37fec Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Sat, 14 Dec 2019 13:50:53 -0500
|
||||
Subject: [PATCH] display: ask accountservice if there are users rather than
|
||||
enumerate users
|
||||
|
||||
At the moment we ask accountsservice to give us the list of users just
|
||||
to find out if there is a list of users.
|
||||
|
||||
That's rather inefficient and might be wrong for directory server users
|
||||
that have never logged in before.
|
||||
|
||||
This commit changes gdm to ask accountsservice the question we really
|
||||
want to know the answer to; whether or not there are users.
|
||||
---
|
||||
daemon/gdm-display.c | 55 ++++++++++++++++++--------------------------
|
||||
1 file changed, 22 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
||||
index 878be88da..875534272 100644
|
||||
--- a/daemon/gdm-display.c
|
||||
+++ b/daemon/gdm-display.c
|
||||
@@ -57,62 +57,60 @@
|
||||
struct GdmDisplayPrivate
|
||||
{
|
||||
char *id;
|
||||
char *seat_id;
|
||||
char *session_id;
|
||||
char *session_class;
|
||||
char *session_type;
|
||||
|
||||
char *remote_hostname;
|
||||
int x11_display_number;
|
||||
char *x11_display_name;
|
||||
int status;
|
||||
time_t creation_time;
|
||||
GTimer *server_timer;
|
||||
|
||||
char *x11_cookie;
|
||||
gsize x11_cookie_size;
|
||||
GdmDisplayAccessFile *access_file;
|
||||
|
||||
guint finish_idle_id;
|
||||
|
||||
xcb_connection_t *xcb_connection;
|
||||
int xcb_screen_number;
|
||||
|
||||
GDBusConnection *connection;
|
||||
GdmDisplayAccessFile *user_access_file;
|
||||
|
||||
GdmDBusDisplay *display_skeleton;
|
||||
GDBusObjectSkeleton *object_skeleton;
|
||||
|
||||
- GDBusProxy *accountsservice_proxy;
|
||||
-
|
||||
/* this spawns and controls the greeter session */
|
||||
GdmLaunchEnvironment *launch_environment;
|
||||
|
||||
guint is_local : 1;
|
||||
guint is_initial : 1;
|
||||
guint allow_timed_login : 1;
|
||||
guint have_existing_user_accounts : 1;
|
||||
guint doing_initial_setup : 1;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_ID,
|
||||
PROP_STATUS,
|
||||
PROP_SEAT_ID,
|
||||
PROP_SESSION_ID,
|
||||
PROP_SESSION_CLASS,
|
||||
PROP_SESSION_TYPE,
|
||||
PROP_REMOTE_HOSTNAME,
|
||||
PROP_X11_DISPLAY_NUMBER,
|
||||
PROP_X11_DISPLAY_NAME,
|
||||
PROP_X11_COOKIE,
|
||||
PROP_X11_AUTHORITY_FILE,
|
||||
PROP_IS_CONNECTED,
|
||||
PROP_IS_LOCAL,
|
||||
PROP_LAUNCH_ENVIRONMENT,
|
||||
PROP_IS_INITIAL,
|
||||
PROP_ALLOW_TIMED_LOGIN,
|
||||
PROP_HAVE_EXISTING_USER_ACCOUNTS,
|
||||
PROP_DOING_INITIAL_SETUP,
|
||||
@@ -512,96 +510,88 @@ queue_finish (GdmDisplay *self)
|
||||
if (self->priv->finish_idle_id == 0) {
|
||||
self->priv->finish_idle_id = g_idle_add ((GSourceFunc)finish_idle, self);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_status (GdmDisplay *self,
|
||||
int status)
|
||||
{
|
||||
if (status != self->priv->status) {
|
||||
self->priv->status = status;
|
||||
g_object_notify (G_OBJECT (self), "status");
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_display_real_prepare (GdmDisplay *self)
|
||||
{
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
g_debug ("GdmDisplay: prepare display");
|
||||
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_PREPARED);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
look_for_existing_users_sync (GdmDisplay *self)
|
||||
{
|
||||
- GError *error = NULL;
|
||||
- GVariant *call_result;
|
||||
- GVariant *user_list;
|
||||
-
|
||||
- self->priv->accountsservice_proxy = g_dbus_proxy_new_sync (self->priv->connection,
|
||||
- 0, NULL,
|
||||
- "org.freedesktop.Accounts",
|
||||
- "/org/freedesktop/Accounts",
|
||||
- "org.freedesktop.Accounts",
|
||||
- NULL,
|
||||
- &error);
|
||||
-
|
||||
- if (!self->priv->accountsservice_proxy) {
|
||||
- g_warning ("Failed to contact accountsservice: %s", error->message);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- call_result = g_dbus_proxy_call_sync (self->priv->accountsservice_proxy,
|
||||
- "ListCachedUsers",
|
||||
- NULL,
|
||||
- 0,
|
||||
+ g_autoptr (GVariant) result = NULL;
|
||||
+ g_autoptr (GVariant) result_child = NULL;
|
||||
+ g_autoptr (GError) error = NULL;
|
||||
+ gboolean has_no_users = FALSE;
|
||||
+
|
||||
+ result = g_dbus_connection_call_sync (self->priv->connection,
|
||||
+ "org.freedesktop.Accounts",
|
||||
+ "/org/freedesktop/Accounts",
|
||||
+ "org.freedesktop.DBus.Properties",
|
||||
+ "Get",
|
||||
+ g_variant_new ("(ss)", "org.freedesktop.Accounts", "HasNoUsers"),
|
||||
+ G_VARIANT_TYPE ("(v)"),
|
||||
+ G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
NULL,
|
||||
&error);
|
||||
|
||||
- if (!call_result) {
|
||||
- g_warning ("Failed to list cached users: %s", error->message);
|
||||
- goto out;
|
||||
+ if (result == NULL) {
|
||||
+ g_warning ("Failed to contact accountsservice: %s", error->message);
|
||||
+ return;
|
||||
}
|
||||
|
||||
- g_variant_get (call_result, "(@ao)", &user_list);
|
||||
- self->priv->have_existing_user_accounts = g_variant_n_children (user_list) > 0;
|
||||
- g_variant_unref (user_list);
|
||||
- g_variant_unref (call_result);
|
||||
-out:
|
||||
- g_clear_error (&error);
|
||||
+ g_variant_get (result, "(v)", &result_child);
|
||||
+ has_no_users = g_variant_get_boolean (result_child);
|
||||
+ self->priv->have_existing_user_accounts = !has_no_users;
|
||||
+
|
||||
+ g_debug ("GdmDisplay: machine does %shave existing user accounts",
|
||||
+ has_no_users? "not " : "");
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_prepare (GdmDisplay *self)
|
||||
{
|
||||
gboolean ret;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
g_debug ("GdmDisplay: Preparing display: %s", self->priv->id);
|
||||
|
||||
/* FIXME: we should probably do this in a more global place,
|
||||
* asynchronously
|
||||
*/
|
||||
look_for_existing_users_sync (self);
|
||||
|
||||
self->priv->doing_initial_setup = wants_initial_setup (self);
|
||||
|
||||
g_object_ref (self);
|
||||
ret = GDM_DISPLAY_GET_CLASS (self)->prepare (self);
|
||||
g_object_unref (self);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_manage (GdmDisplay *self)
|
||||
{
|
||||
gboolean res;
|
||||
|
||||
@@ -1332,61 +1322,60 @@ gdm_display_init (GdmDisplay *self)
|
||||
|
||||
self->priv = GDM_DISPLAY_GET_PRIVATE (self);
|
||||
|
||||
self->priv->creation_time = time (NULL);
|
||||
self->priv->server_timer = g_timer_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_finalize (GObject *object)
|
||||
{
|
||||
GdmDisplay *self;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_DISPLAY (object));
|
||||
|
||||
self = GDM_DISPLAY (object);
|
||||
|
||||
g_return_if_fail (self->priv != NULL);
|
||||
|
||||
g_debug ("GdmDisplay: Finalizing display: %s", self->priv->id);
|
||||
g_free (self->priv->id);
|
||||
g_free (self->priv->seat_id);
|
||||
g_free (self->priv->session_class);
|
||||
g_free (self->priv->remote_hostname);
|
||||
g_free (self->priv->x11_display_name);
|
||||
g_free (self->priv->x11_cookie);
|
||||
|
||||
g_clear_object (&self->priv->display_skeleton);
|
||||
g_clear_object (&self->priv->object_skeleton);
|
||||
g_clear_object (&self->priv->connection);
|
||||
- g_clear_object (&self->priv->accountsservice_proxy);
|
||||
|
||||
if (self->priv->access_file != NULL) {
|
||||
g_object_unref (self->priv->access_file);
|
||||
}
|
||||
|
||||
if (self->priv->user_access_file != NULL) {
|
||||
g_object_unref (self->priv->user_access_file);
|
||||
}
|
||||
|
||||
if (self->priv->server_timer != NULL) {
|
||||
g_timer_destroy (self->priv->server_timer);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gdm_display_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
GDBusObjectSkeleton *
|
||||
gdm_display_get_object_skeleton (GdmDisplay *self)
|
||||
{
|
||||
return self->priv->object_skeleton;
|
||||
}
|
||||
|
||||
static void
|
||||
on_launch_environment_session_opened (GdmLaunchEnvironment *launch_environment,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
char *session_id;
|
||||
|
||||
g_debug ("GdmDisplay: Greeter session opened");
|
||||
session_id = gdm_launch_environment_get_session_id (launch_environment);
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,325 @@
|
||||
From d8fd8d4d6ff6a119f6bd27eb07316384c4776d12 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 15 Sep 2021 11:23:17 -0400
|
||||
Subject: [PATCH] local-display-factory: Don't try to respawn displays on
|
||||
shutdown
|
||||
|
||||
At the moment in the shutdown path we may try to respawn displays
|
||||
that just got killed.
|
||||
|
||||
The respawning happens when things are half torn down leading to
|
||||
crashes.
|
||||
|
||||
This commit makes sure we turn off the respawn logic in the shutdown
|
||||
path.
|
||||
---
|
||||
daemon/gdm-local-display-factory.c | 11 ++++++++++-
|
||||
daemon/gdm-manager.c | 2 ++
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
||||
index 11dcda2c..a0884893 100644
|
||||
--- a/daemon/gdm-local-display-factory.c
|
||||
+++ b/daemon/gdm-local-display-factory.c
|
||||
@@ -46,60 +46,62 @@
|
||||
#define GDM_LOCAL_DISPLAY_FACTORY_DBUS_PATH GDM_DBUS_PATH "/LocalDisplayFactory"
|
||||
#define GDM_MANAGER_DBUS_NAME "org.gnome.DisplayManager.LocalDisplayFactory"
|
||||
|
||||
#define MAX_DISPLAY_FAILURES 5
|
||||
#define WAIT_TO_FINISH_TIMEOUT 10 /* seconds */
|
||||
#define SEAT0_GRAPHICS_CHECK_TIMEOUT 10 /* seconds */
|
||||
|
||||
struct _GdmLocalDisplayFactory
|
||||
{
|
||||
GdmDisplayFactory parent;
|
||||
|
||||
GdmDBusLocalDisplayFactory *skeleton;
|
||||
GDBusConnection *connection;
|
||||
GHashTable *used_display_numbers;
|
||||
|
||||
/* FIXME: this needs to be per seat? */
|
||||
guint num_failures;
|
||||
|
||||
guint seat_new_id;
|
||||
guint seat_removed_id;
|
||||
guint seat_properties_changed_id;
|
||||
|
||||
gboolean seat0_graphics_check_timed_out;
|
||||
guint seat0_graphics_check_timeout_id;
|
||||
|
||||
#if defined(ENABLE_USER_DISPLAY_SERVER)
|
||||
unsigned int active_vt;
|
||||
guint active_vt_watch_id;
|
||||
guint wait_to_finish_timeout_id;
|
||||
#endif
|
||||
+
|
||||
+ gboolean is_started;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
};
|
||||
|
||||
static void gdm_local_display_factory_class_init (GdmLocalDisplayFactoryClass *klass);
|
||||
static void gdm_local_display_factory_init (GdmLocalDisplayFactory *factory);
|
||||
static void gdm_local_display_factory_finalize (GObject *object);
|
||||
|
||||
static void ensure_display_for_seat (GdmLocalDisplayFactory *factory,
|
||||
const char *seat_id);
|
||||
|
||||
static void on_display_status_changed (GdmDisplay *display,
|
||||
GParamSpec *arg1,
|
||||
GdmLocalDisplayFactory *factory);
|
||||
|
||||
static gboolean gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory);
|
||||
static gpointer local_display_factory_object = NULL;
|
||||
static gboolean lookup_by_session_id (const char *id,
|
||||
GdmDisplay *display,
|
||||
gpointer user_data);
|
||||
|
||||
G_DEFINE_TYPE (GdmLocalDisplayFactory, gdm_local_display_factory, GDM_TYPE_DISPLAY_FACTORY)
|
||||
|
||||
GQuark
|
||||
gdm_local_display_factory_error_quark (void)
|
||||
{
|
||||
static GQuark ret = 0;
|
||||
if (ret == 0) {
|
||||
@@ -478,60 +480,64 @@ on_session_registered_cb (GObject *gobject,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
GdmDisplay *display = GDM_DISPLAY (gobject);
|
||||
GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (user_data);
|
||||
gboolean registered;
|
||||
|
||||
g_object_get (display, "session-registered", ®istered, NULL);
|
||||
|
||||
if (!registered)
|
||||
return;
|
||||
|
||||
g_debug ("GdmLocalDisplayFactory: session registered on display, looking for any background displays to kill");
|
||||
|
||||
finish_waiting_displays_on_seat (factory, "seat0");
|
||||
}
|
||||
|
||||
static void
|
||||
on_display_status_changed (GdmDisplay *display,
|
||||
GParamSpec *arg1,
|
||||
GdmLocalDisplayFactory *factory)
|
||||
{
|
||||
int status;
|
||||
int num;
|
||||
char *seat_id = NULL;
|
||||
char *session_type = NULL;
|
||||
char *session_class = NULL;
|
||||
gboolean is_initial = TRUE;
|
||||
gboolean is_local = TRUE;
|
||||
|
||||
+
|
||||
+ if (!factory->is_started)
|
||||
+ return;
|
||||
+
|
||||
num = -1;
|
||||
gdm_display_get_x11_display_number (display, &num, NULL);
|
||||
|
||||
g_object_get (display,
|
||||
"seat-id", &seat_id,
|
||||
"is-initial", &is_initial,
|
||||
"is-local", &is_local,
|
||||
"session-type", &session_type,
|
||||
"session-class", &session_class,
|
||||
NULL);
|
||||
|
||||
status = gdm_display_get_status (display);
|
||||
|
||||
g_debug ("GdmLocalDisplayFactory: display status changed: %d", status);
|
||||
switch (status) {
|
||||
case GDM_DISPLAY_FINISHED:
|
||||
/* remove the display number from factory->used_display_numbers
|
||||
so that it may be reused */
|
||||
if (num != -1) {
|
||||
g_hash_table_remove (factory->used_display_numbers, GUINT_TO_POINTER (num));
|
||||
}
|
||||
gdm_display_factory_queue_purge_displays (GDM_DISPLAY_FACTORY (factory));
|
||||
|
||||
/* if this is a local display, do a full resync. Only
|
||||
* seats without displays will get created anyway. This
|
||||
* ensures we get a new login screen when the user logs out,
|
||||
* if there isn't one.
|
||||
*/
|
||||
if (is_local && g_strcmp0 (session_class, "greeter") != 0) {
|
||||
/* reset num failures */
|
||||
@@ -1250,99 +1256,102 @@ on_display_added (GdmDisplayStore *display_store,
|
||||
|
||||
display = gdm_display_store_lookup (display_store, id);
|
||||
|
||||
if (display != NULL) {
|
||||
g_signal_connect_object (display, "notify::status",
|
||||
G_CALLBACK (on_display_status_changed),
|
||||
factory,
|
||||
0);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_display_removed (GdmDisplayStore *display_store,
|
||||
GdmDisplay *display,
|
||||
GdmLocalDisplayFactory *factory)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), factory);
|
||||
g_object_weak_unref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_local_display_factory_start (GdmDisplayFactory *base_factory)
|
||||
{
|
||||
GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory);
|
||||
GdmDisplayStore *store;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
|
||||
|
||||
+ factory->is_started = TRUE;
|
||||
+
|
||||
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
||||
|
||||
g_signal_connect_object (G_OBJECT (store),
|
||||
"display-added",
|
||||
G_CALLBACK (on_display_added),
|
||||
factory,
|
||||
0);
|
||||
|
||||
g_signal_connect_object (G_OBJECT (store),
|
||||
"display-removed",
|
||||
G_CALLBACK (on_display_removed),
|
||||
factory,
|
||||
0);
|
||||
|
||||
gdm_local_display_factory_start_monitor (factory);
|
||||
return gdm_local_display_factory_sync_seats (factory);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_local_display_factory_stop (GdmDisplayFactory *base_factory)
|
||||
{
|
||||
GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory);
|
||||
GdmDisplayStore *store;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
|
||||
|
||||
gdm_local_display_factory_stop_monitor (factory);
|
||||
|
||||
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (store),
|
||||
G_CALLBACK (on_display_added),
|
||||
factory);
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (store),
|
||||
G_CALLBACK (on_display_removed),
|
||||
factory);
|
||||
-
|
||||
g_clear_handle_id (&factory->seat0_graphics_check_timeout_id, g_source_remove);
|
||||
|
||||
+ factory->is_started = FALSE;
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_local_display_factory_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_local_display_factory_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index b3d0a2b5..4b62b8b1 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -2774,60 +2774,62 @@ unexport_display (const char *id,
|
||||
GdmDisplay *display,
|
||||
GdmManager *manager)
|
||||
{
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection))
|
||||
g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
|
||||
}
|
||||
|
||||
static void
|
||||
finish_display (const char *id,
|
||||
GdmDisplay *display,
|
||||
GdmManager *manager)
|
||||
{
|
||||
gdm_display_stop_greeter_session (display);
|
||||
if (gdm_display_get_status (display) == GDM_DISPLAY_MANAGED)
|
||||
gdm_display_unmanage (display);
|
||||
gdm_display_finish (display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_manager_dispose (GObject *object)
|
||||
{
|
||||
GdmManager *manager;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_MANAGER (object));
|
||||
|
||||
manager = GDM_MANAGER (object);
|
||||
|
||||
g_return_if_fail (manager->priv != NULL);
|
||||
|
||||
+ gdm_manager_stop (manager);
|
||||
+
|
||||
g_clear_weak_pointer (&manager->priv->automatic_login_display);
|
||||
|
||||
#ifdef HAVE_LIBXDMCP
|
||||
g_clear_object (&manager->priv->xdmcp_factory);
|
||||
#endif
|
||||
g_clear_object (&manager->priv->local_factory);
|
||||
g_clear_pointer (&manager->priv->open_reauthentication_requests,
|
||||
g_hash_table_unref);
|
||||
g_clear_pointer (&manager->priv->transient_sessions,
|
||||
g_hash_table_unref);
|
||||
|
||||
g_list_foreach (manager->priv->user_sessions,
|
||||
(GFunc) gdm_session_close,
|
||||
NULL);
|
||||
g_list_free_full (manager->priv->user_sessions, (GDestroyNotify) g_object_unref);
|
||||
manager->priv->user_sessions = NULL;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_added),
|
||||
manager);
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_removed),
|
||||
manager);
|
||||
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection)) {
|
||||
gdm_display_store_foreach (manager->priv->display_store,
|
||||
(GdmDisplayStoreFunc)unexport_display,
|
||||
manager);
|
||||
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager));
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,90 +0,0 @@
|
||||
From f9662449f0f7dbb452ba11fe85a3c81b386f6dab Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 29 Oct 2018 06:57:59 -0400
|
||||
Subject: [PATCH] local-display-factory: pause for a few seconds before falling
|
||||
back to X
|
||||
|
||||
logind currently gets confused if a session is started immediately as
|
||||
one is shutting down.
|
||||
|
||||
Workaround this problem by adding an artificial delay when falling
|
||||
back to X.
|
||||
|
||||
http://bugzilla.redhat.com/1643874
|
||||
---
|
||||
daemon/gdm-local-display-factory.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
||||
index 403921d32..ab7e12e91 100644
|
||||
--- a/daemon/gdm-local-display-factory.c
|
||||
+++ b/daemon/gdm-local-display-factory.c
|
||||
@@ -283,60 +283,65 @@ on_display_status_changed (GdmDisplay *display,
|
||||
/* if this is a local display, do a full resync. Only
|
||||
* seats without displays will get created anyway. This
|
||||
* ensures we get a new login screen when the user logs out,
|
||||
* if there isn't one.
|
||||
*/
|
||||
if (is_local) {
|
||||
/* reset num failures */
|
||||
factory->priv->num_failures = 0;
|
||||
|
||||
gdm_local_display_factory_sync_seats (factory);
|
||||
}
|
||||
break;
|
||||
case GDM_DISPLAY_FAILED:
|
||||
/* leave the display number in factory->priv->used_display_numbers
|
||||
so that it doesn't get reused */
|
||||
gdm_display_store_remove (store, display);
|
||||
|
||||
/* Create a new equivalent display if it was static */
|
||||
if (is_local) {
|
||||
|
||||
factory->priv->num_failures++;
|
||||
|
||||
if (factory->priv->num_failures > MAX_DISPLAY_FAILURES) {
|
||||
/* oh shit */
|
||||
g_warning ("GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors");
|
||||
} else {
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
if (g_strcmp0 (session_type, "wayland") == 0) {
|
||||
g_free (session_type);
|
||||
session_type = NULL;
|
||||
+
|
||||
+ /* workaround logind race for now
|
||||
+ * bug 1643874
|
||||
+ */
|
||||
+ sleep (2);
|
||||
}
|
||||
|
||||
#endif
|
||||
create_display (factory, seat_id, session_type, is_initial);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GDM_DISPLAY_UNMANAGED:
|
||||
break;
|
||||
case GDM_DISPLAY_PREPARED:
|
||||
break;
|
||||
case GDM_DISPLAY_MANAGED:
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
g_free (seat_id);
|
||||
g_free (session_type);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
lookup_by_seat_id (const char *id,
|
||||
GdmDisplay *display,
|
||||
gpointer user_data)
|
||||
{
|
||||
const char *looking_for = user_data;
|
||||
char *current;
|
||||
gboolean res;
|
||||
--
|
||||
2.19.1
|
||||
|
@ -1,28 +1,28 @@
|
||||
From bb58b5762272840a414f2bfe3ab59d733099a06c Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
From d80807171a457ff87bdc9bd861939161749a37a8 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 20 Dec 2018 14:51:38 -0500
|
||||
Subject: [PATCH 1/2] manager: allow multiple xdmcp logins for the same user
|
||||
Subject: [PATCH 1/3] manager: allow multiple xdmcp logins for the same user
|
||||
|
||||
---
|
||||
common/gdm-settings-keys.h | 1 +
|
||||
daemon/gdm-manager.c | 71 ++++++++++++++++++++++++++++----------
|
||||
data/gdm.schemas.in.in | 5 +++
|
||||
data/gdm.schemas.in | 5 +++
|
||||
3 files changed, 59 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/common/gdm-settings-keys.h b/common/gdm-settings-keys.h
|
||||
index f0059b5cf..33676a851 100644
|
||||
index 87685d3cd..4b3a1ffeb 100644
|
||||
--- a/common/gdm-settings-keys.h
|
||||
+++ b/common/gdm-settings-keys.h
|
||||
@@ -28,37 +28,38 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_USER "daemon/User"
|
||||
#define GDM_KEY_GROUP "daemon/Group"
|
||||
@@ -30,37 +30,38 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_AUTO_LOGIN_ENABLE "daemon/AutomaticLoginEnable"
|
||||
#define GDM_KEY_AUTO_LOGIN_USER "daemon/AutomaticLogin"
|
||||
#define GDM_KEY_TIMED_LOGIN_ENABLE "daemon/TimedLoginEnable"
|
||||
#define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
|
||||
#define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
|
||||
#define GDM_KEY_INITIAL_SETUP_ENABLE "daemon/InitialSetupEnable"
|
||||
#define GDM_KEY_PREFERRED_DISPLAY_SERVER "daemon/PreferredDisplayServer"
|
||||
#define GDM_KEY_WAYLAND_ENABLE "daemon/WaylandEnable"
|
||||
#define GDM_KEY_XORG_ENABLE "daemon/XorgEnable"
|
||||
|
||||
#define GDM_KEY_DEBUG "debug/Enable"
|
||||
|
||||
@ -53,11 +53,10 @@ index f0059b5cf..33676a851 100644
|
||||
|
||||
#endif /* _GDM_SETTINGS_KEYS_H */
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 056560b20..de7357ad5 100644
|
||||
index e433acf3b..ce8565bf9 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -594,93 +594,106 @@ get_display_and_details_for_bus_sender (GdmManager *self,
|
||||
if (out_tty != NULL) {
|
||||
@@ -566,93 +566,106 @@ get_display_and_details_for_bus_sender (GdmManager *self,
|
||||
*out_tty = get_tty_for_session_id (session_id, &error);
|
||||
|
||||
if (error != NULL) {
|
||||
@ -71,10 +70,11 @@ index 056560b20..de7357ad5 100644
|
||||
lookup_by_session_id,
|
||||
(gpointer) session_id);
|
||||
|
||||
out:
|
||||
if (out_display != NULL) {
|
||||
*out_display = display;
|
||||
}
|
||||
out:
|
||||
|
||||
g_free (session_id);
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ index 056560b20..de7357ad5 100644
|
||||
- if (existing_session != NULL) {
|
||||
- ssid_to_activate = gdm_session_get_session_id (existing_session);
|
||||
- if (seat_id != NULL) {
|
||||
- res = activate_session_id (manager, seat_id, ssid_to_activate);
|
||||
- res = gdm_activate_session_by_id (manager->priv->connection, seat_id, ssid_to_activate);
|
||||
- if (! res) {
|
||||
- g_debug ("GdmManager: unable to activate session: %s", ssid_to_activate);
|
||||
- goto out;
|
||||
@ -138,7 +138,7 @@ index 056560b20..de7357ad5 100644
|
||||
}
|
||||
|
||||
+ if (seat_id != NULL) {
|
||||
+ res = activate_session_id (manager, seat_id, ssid_to_activate);
|
||||
+ res = gdm_activate_session_by_id (manager->priv->connection, seat_id, ssid_to_activate);
|
||||
+ if (! res) {
|
||||
+ g_debug ("GdmManager: unable to activate session: %s", ssid_to_activate);
|
||||
+ goto out;
|
||||
@ -181,7 +181,7 @@ index 056560b20..de7357ad5 100644
|
||||
{
|
||||
const char *username;
|
||||
char *display_name, *hostname, *display_device;
|
||||
@@ -1088,92 +1101,114 @@ open_temporary_reauthentication_channel (GdmManager *self,
|
||||
@@ -1089,92 +1102,114 @@ open_temporary_reauthentication_channel (GdmManager *self,
|
||||
g_signal_connect (session,
|
||||
"client-disconnected",
|
||||
G_CALLBACK (on_reauthentication_client_disconnected),
|
||||
@ -263,7 +263,7 @@ index 056560b20..de7357ad5 100644
|
||||
+ G_DBUS_ERROR,
|
||||
+ G_DBUS_ERROR_ACCESS_DENIED,
|
||||
+ "Login screen creates new sessions for remote connections");
|
||||
+ return TRUE;
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
if (is_login_screen) {
|
||||
@ -296,11 +296,11 @@ index 056560b20..de7357ad5 100644
|
||||
pid,
|
||||
uid,
|
||||
is_remote);
|
||||
diff --git a/data/gdm.schemas.in.in b/data/gdm.schemas.in.in
|
||||
index 8ad203101..003f92c63 100644
|
||||
--- a/data/gdm.schemas.in.in
|
||||
+++ b/data/gdm.schemas.in.in
|
||||
@@ -102,32 +102,37 @@
|
||||
diff --git a/data/gdm.schemas.in b/data/gdm.schemas.in
|
||||
index a1035f95e..929d13d90 100644
|
||||
--- a/data/gdm.schemas.in
|
||||
+++ b/data/gdm.schemas.in
|
||||
@@ -112,33 +112,38 @@
|
||||
<schema>
|
||||
<key>xdmcp/DisplaysPerHost</key>
|
||||
<signature>i</signature>
|
||||
@ -338,6 +338,7 @@ index 8ad203101..003f92c63 100644
|
||||
+ </schema>
|
||||
</schemalist>
|
||||
</gdmschemafile>
|
||||
|
||||
--
|
||||
2.21.1
|
||||
2.30.1
|
||||
|
||||
|
@ -1,87 +0,0 @@
|
||||
From ecd37ba6d56a49dd896613f68d1e1754633b9f0c Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 6 Feb 2019 16:14:52 -0500
|
||||
Subject: [PATCH 1/4] manager: don't kill timed login session immediately after
|
||||
it starts
|
||||
|
||||
At the moment GDM is misidentifying timed login sessions as if
|
||||
they are automatic login sessions. That leads to their displays
|
||||
getting killed sometimes shortly after log in.
|
||||
|
||||
This commit corrects the check, so that timed login sessions aren't
|
||||
treated as autologin sessions.
|
||||
---
|
||||
daemon/gdm-manager.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 2118c5834..b2d0578f5 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -1841,61 +1841,62 @@ on_start_user_session (StartUserSessionOperation *operation)
|
||||
NULL);
|
||||
} else {
|
||||
uid_t allowed_uid;
|
||||
|
||||
g_object_ref (display);
|
||||
if (doing_initial_setup) {
|
||||
g_debug ("GdmManager: closing down initial setup display");
|
||||
gdm_display_stop_greeter_session (display);
|
||||
gdm_display_unmanage (display);
|
||||
gdm_display_finish (display);
|
||||
|
||||
/* We can't start the user session until the finished display
|
||||
* starts to respawn (since starting an X server and bringing
|
||||
* one down at the same time is a no go)
|
||||
*/
|
||||
g_assert (self->priv->initial_login_operation == NULL);
|
||||
self->priv->initial_login_operation = operation;
|
||||
starting_user_session_right_away = FALSE;
|
||||
} else {
|
||||
g_debug ("GdmManager: session has its display server, reusing our server for another login screen");
|
||||
}
|
||||
|
||||
/* The user session is going to follow the session worker
|
||||
* into the new display. Untie it from this display and
|
||||
* create a new session for a future user login. */
|
||||
allowed_uid = gdm_session_get_allowed_user (operation->session);
|
||||
g_object_set_data (G_OBJECT (display), "gdm-user-session", NULL);
|
||||
g_object_set_data (G_OBJECT (operation->session), "gdm-display", NULL);
|
||||
create_user_session_for_display (operation->manager, display, allowed_uid);
|
||||
|
||||
- if (g_strcmp0 (operation->service_name, "gdm-autologin") == 0) {
|
||||
+ if ((g_strcmp0 (operation->service_name, "gdm-autologin") == 0) &&
|
||||
+ !gdm_session_client_is_connected (operation->session)) {
|
||||
gboolean was_initial = FALSE;
|
||||
|
||||
g_object_get (G_OBJECT (display), "is-initial", &was_initial, NULL);
|
||||
|
||||
/* remove the unused prepared greeter display since we're not going
|
||||
* to have a greeter */
|
||||
gdm_display_store_remove (self->priv->display_store, display);
|
||||
g_object_unref (display);
|
||||
|
||||
should_be_initial = was_initial;
|
||||
}
|
||||
|
||||
/* Give the user session a new display object for bookkeeping purposes */
|
||||
create_display_for_user_session (operation->manager,
|
||||
operation->session,
|
||||
session_id,
|
||||
should_be_initial);
|
||||
}
|
||||
|
||||
if (starting_user_session_right_away) {
|
||||
start_user_session (operation->manager, operation);
|
||||
}
|
||||
|
||||
out:
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_start_user_session (GdmManager *manager,
|
||||
GdmSession *session,
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,198 +0,0 @@
|
||||
From 4b2db2cf52be75e2eec4aa29f8ee082392ded410 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 1 Nov 2018 13:03:37 -0400
|
||||
Subject: [PATCH] manager: ensure is-initial is transfered to autologin display
|
||||
|
||||
At the moment, we don't handle transferring the is-initial property to
|
||||
the autologin display.
|
||||
|
||||
That prevents autologin from working if wayland fails and X falls back,
|
||||
since autologin currently requires an initial display.
|
||||
|
||||
This commit makes sure we properly transfer is-initial from greeter to
|
||||
user display.
|
||||
---
|
||||
daemon/gdm-manager.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 1943d89e4..2118c5834 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -1740,90 +1740,93 @@ start_user_session (GdmManager *manager,
|
||||
|
||||
g_object_get (G_OBJECT (display), "is-connected", &is_connected, NULL);
|
||||
|
||||
if (is_connected) {
|
||||
auth_file = NULL;
|
||||
username = gdm_session_get_username (operation->session);
|
||||
gdm_display_add_user_authorization (display,
|
||||
username,
|
||||
&auth_file,
|
||||
NULL);
|
||||
|
||||
g_assert (auth_file != NULL);
|
||||
|
||||
g_object_set (operation->session,
|
||||
"user-x11-authority-file", auth_file,
|
||||
NULL);
|
||||
|
||||
g_free (auth_file);
|
||||
}
|
||||
}
|
||||
|
||||
gdm_session_start_session (operation->session,
|
||||
operation->service_name);
|
||||
|
||||
destroy_start_user_session_operation (operation);
|
||||
}
|
||||
|
||||
static void
|
||||
create_display_for_user_session (GdmManager *self,
|
||||
GdmSession *session,
|
||||
- const char *session_id)
|
||||
+ const char *session_id,
|
||||
+ gboolean is_initial)
|
||||
{
|
||||
GdmDisplay *display;
|
||||
/* at the moment we only create GdmLocalDisplay objects on seat0 */
|
||||
const char *seat_id = "seat0";
|
||||
|
||||
display = gdm_local_display_new ();
|
||||
|
||||
g_object_set (G_OBJECT (display),
|
||||
"session-class", "user",
|
||||
"seat-id", seat_id,
|
||||
"session-id", session_id,
|
||||
+ "is-initial", is_initial,
|
||||
NULL);
|
||||
gdm_display_store_add (self->priv->display_store,
|
||||
display);
|
||||
g_object_set_data (G_OBJECT (session), "gdm-display", display);
|
||||
g_object_set_data_full (G_OBJECT (display),
|
||||
"gdm-user-session",
|
||||
g_object_ref (session),
|
||||
(GDestroyNotify)
|
||||
clean_user_session);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_start_user_session (StartUserSessionOperation *operation)
|
||||
{
|
||||
GdmManager *self = operation->manager;
|
||||
gboolean migrated;
|
||||
gboolean fail_if_already_switched = TRUE;
|
||||
gboolean doing_initial_setup = FALSE;
|
||||
+ gboolean should_be_initial = FALSE;
|
||||
gboolean starting_user_session_right_away = TRUE;
|
||||
GdmDisplay *display;
|
||||
const char *session_id;
|
||||
|
||||
g_debug ("GdmManager: start or jump to session");
|
||||
|
||||
/* If there's already a session running, jump to it.
|
||||
* If the only session running is the one we just opened,
|
||||
* start a session on it.
|
||||
*/
|
||||
migrated = switch_to_compatible_user_session (operation->manager, operation->session, fail_if_already_switched);
|
||||
|
||||
g_debug ("GdmManager: migrated: %d", migrated);
|
||||
if (migrated) {
|
||||
/* We don't stop the manager here because
|
||||
when Xorg exits it switches to the VT it was
|
||||
started from. That interferes with fast
|
||||
user switching. */
|
||||
gdm_session_reset (operation->session);
|
||||
destroy_start_user_session_operation (operation);
|
||||
goto out;
|
||||
}
|
||||
|
||||
display = get_display_for_user_session (operation->session);
|
||||
|
||||
g_object_get (G_OBJECT (display), "doing-initial-setup", &doing_initial_setup, NULL);
|
||||
|
||||
session_id = gdm_session_get_conversation_session_id (operation->session,
|
||||
operation->service_name);
|
||||
|
||||
@@ -1839,70 +1842,77 @@ on_start_user_session (StartUserSessionOperation *operation)
|
||||
} else {
|
||||
uid_t allowed_uid;
|
||||
|
||||
g_object_ref (display);
|
||||
if (doing_initial_setup) {
|
||||
g_debug ("GdmManager: closing down initial setup display");
|
||||
gdm_display_stop_greeter_session (display);
|
||||
gdm_display_unmanage (display);
|
||||
gdm_display_finish (display);
|
||||
|
||||
/* We can't start the user session until the finished display
|
||||
* starts to respawn (since starting an X server and bringing
|
||||
* one down at the same time is a no go)
|
||||
*/
|
||||
g_assert (self->priv->initial_login_operation == NULL);
|
||||
self->priv->initial_login_operation = operation;
|
||||
starting_user_session_right_away = FALSE;
|
||||
} else {
|
||||
g_debug ("GdmManager: session has its display server, reusing our server for another login screen");
|
||||
}
|
||||
|
||||
/* The user session is going to follow the session worker
|
||||
* into the new display. Untie it from this display and
|
||||
* create a new session for a future user login. */
|
||||
allowed_uid = gdm_session_get_allowed_user (operation->session);
|
||||
g_object_set_data (G_OBJECT (display), "gdm-user-session", NULL);
|
||||
g_object_set_data (G_OBJECT (operation->session), "gdm-display", NULL);
|
||||
create_user_session_for_display (operation->manager, display, allowed_uid);
|
||||
|
||||
if (g_strcmp0 (operation->service_name, "gdm-autologin") == 0) {
|
||||
+ gboolean was_initial = FALSE;
|
||||
+
|
||||
+ g_object_get (G_OBJECT (display), "is-initial", &was_initial, NULL);
|
||||
+
|
||||
/* remove the unused prepared greeter display since we're not going
|
||||
* to have a greeter */
|
||||
gdm_display_store_remove (self->priv->display_store, display);
|
||||
g_object_unref (display);
|
||||
+
|
||||
+ should_be_initial = was_initial;
|
||||
}
|
||||
|
||||
/* Give the user session a new display object for bookkeeping purposes */
|
||||
create_display_for_user_session (operation->manager,
|
||||
operation->session,
|
||||
- session_id);
|
||||
+ session_id,
|
||||
+ should_be_initial);
|
||||
}
|
||||
|
||||
if (starting_user_session_right_away) {
|
||||
start_user_session (operation->manager, operation);
|
||||
}
|
||||
|
||||
out:
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_start_user_session (GdmManager *manager,
|
||||
GdmSession *session,
|
||||
const char *service_name)
|
||||
{
|
||||
StartUserSessionOperation *operation;
|
||||
|
||||
operation = g_slice_new0 (StartUserSessionOperation);
|
||||
operation->manager = manager;
|
||||
operation->session = g_object_ref (session);
|
||||
operation->service_name = g_strdup (service_name);
|
||||
|
||||
operation->idle_id = g_idle_add ((GSourceFunc) on_start_user_session, operation);
|
||||
g_object_set_data (G_OBJECT (session), "start-user-session-operation", operation);
|
||||
}
|
||||
|
||||
static void
|
||||
start_user_session_if_ready (GdmManager *manager,
|
||||
GdmSession *session,
|
||||
const char *service_name)
|
||||
--
|
||||
2.19.1
|
||||
|
@ -0,0 +1,144 @@
|
||||
From f101371f418bb0013af1e5e1ef522277011fd48d Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Thu, 7 Oct 2021 18:22:11 -0700
|
||||
Subject: [PATCH 1/2] meson: Fix detection of Xorg versions that need -listen
|
||||
tcp
|
||||
|
||||
Closes #704
|
||||
---
|
||||
meson.build | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index e6fcf4b8..06d09659 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -42,60 +42,63 @@ udev_dep = dependency('udev')
|
||||
glib_min_version = '2.56.0'
|
||||
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
|
||||
libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
|
||||
accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
|
||||
xcb_dep = dependency('xcb')
|
||||
keyutils_dep = dependency('libkeyutils', required: false)
|
||||
libselinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||
|
||||
# udev
|
||||
if udev_dir == ''
|
||||
if udev_dep.found()
|
||||
udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
|
||||
else
|
||||
udev_prefix = gdm_prefix / 'lib' / 'udev'
|
||||
endif
|
||||
udev_dir = udev_prefix / 'rules.d'
|
||||
endif
|
||||
|
||||
# X11
|
||||
x_deps = declare_dependency(
|
||||
dependencies: [
|
||||
dependency('x11'),
|
||||
dependency('xau'),
|
||||
],
|
||||
)
|
||||
+# Xserver 1.17 & later default to -nolisten and require -listen for remote access
|
||||
+xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
|
||||
+xserver_nolisten_default = xserver_deps.found()
|
||||
find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
|
||||
find_x_server_out = run_command(find_x_server_script).stdout().strip()
|
||||
if find_x_server_out != ''
|
||||
x_bin = find_x_server_out
|
||||
x_bin_path_split = x_bin.split('/')
|
||||
i = 0
|
||||
x_path = '/'
|
||||
foreach dir : x_bin_path_split
|
||||
if i < x_bin_path_split.length() - 1
|
||||
x_path = x_path / dir
|
||||
endif
|
||||
i = i + 1
|
||||
endforeach
|
||||
else
|
||||
# what to do, what to do, this is wrong, but this just sets the
|
||||
# defaults, perhaps this user is cross compiling or some such
|
||||
x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin'
|
||||
x_bin = '/usr/bin/X'
|
||||
endif
|
||||
xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
|
||||
if xdmcp_dep.found() and get_option('tcp-wrappers')
|
||||
libwrap_dep = cc.find_library('libwrap')
|
||||
endif
|
||||
# systemd
|
||||
systemd_dep = dependency('systemd')
|
||||
libsystemd_dep = dependency('libsystemd')
|
||||
if meson.version().version_compare('>= 0.53')
|
||||
systemd_multiseat_x = find_program('systemd-multi-seat-x',
|
||||
required: false,
|
||||
dirs: [
|
||||
@@ -197,60 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir'))
|
||||
conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir'))
|
||||
conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir'))
|
||||
conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir'))
|
||||
conf.set_quoted('LOGDIR', get_option('log-dir'))
|
||||
conf.set_quoted('DMCONFDIR', dmconfdir)
|
||||
conf.set_quoted('GDMCONFDIR', gdmconfdir)
|
||||
conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir)
|
||||
conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir)
|
||||
conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir)
|
||||
conf.set_quoted('GDM_RUN_DIR', gdm_run_dir)
|
||||
conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir'))
|
||||
conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir)
|
||||
conf.set_quoted('GDM_PID_FILE', gdm_pid_file)
|
||||
conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir)
|
||||
conf.set_quoted('LANG_CONFIG_FILE', lang_config_file)
|
||||
conf.set('HAVE_ADT', have_adt)
|
||||
conf.set('HAVE_UTMP_H', have_utmp_header)
|
||||
conf.set('HAVE_UTMPX_H', have_utmpx_header)
|
||||
conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r)
|
||||
conf.set('UTMP', utmp_struct)
|
||||
conf.set('HAVE_GETUTXENT', cc.has_function('getutxent'))
|
||||
conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp'))
|
||||
conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx'))
|
||||
conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil'))
|
||||
conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil'))
|
||||
conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil'))
|
||||
conf.set('HAVE_PAM_SYSLOG', have_pam_syslog)
|
||||
conf.set('HAVE_KEYUTILS', keyutils_dep.found())
|
||||
conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported)
|
||||
conf.set('HAVE_SELINUX', libselinux_dep.found())
|
||||
+conf.set('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default)
|
||||
conf.set('ENABLE_USER_DISPLAY_SERVER', get_option('user-display-server'))
|
||||
conf.set('ENABLE_SYSTEMD_JOURNAL', get_option('systemd-journal'))
|
||||
conf.set('ENABLE_WAYLAND_SUPPORT', get_option('wayland-support'))
|
||||
conf.set('ENABLE_PROFILING', get_option('profiling'))
|
||||
conf.set('GDM_INITIAL_VT', get_option('initial-vt'))
|
||||
conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf)
|
||||
conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf)
|
||||
conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf)
|
||||
conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path'))
|
||||
conf.set_quoted('GDM_USERNAME', get_option('user'))
|
||||
conf.set_quoted('GDM_GROUPNAME', get_option('group'))
|
||||
conf.set('HAVE_LIBXDMCP', xdmcp_dep.found())
|
||||
conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server)
|
||||
conf.set('WITH_PLYMOUTH', plymouth_dep.found())
|
||||
conf.set_quoted('X_SERVER', x_bin)
|
||||
conf.set_quoted('X_PATH', x_path)
|
||||
conf.set('HAVE_UT_UT_HOST', utmp_has_host_field)
|
||||
conf.set('HAVE_UT_UT_PID', utmp_has_pid_field)
|
||||
conf.set('HAVE_UT_UT_ID', utmp_has_id_field)
|
||||
conf.set('HAVE_UT_UT_NAME', utmp_has_name_field)
|
||||
conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field)
|
||||
conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field)
|
||||
conf.set('HAVE_UT_UT_USER', utmp_has_user_field)
|
||||
conf.set('HAVE_UT_UT_TIME', utmp_has_time_field)
|
||||
conf.set('HAVE_UT_UT_TV', utmp_has_tv_field)
|
||||
conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field)
|
||||
conf.set('ENABLE_IPV6', get_option('ipv6'))
|
||||
configure_file(output: 'config.h', configuration: conf)
|
||||
|
||||
# Subdirs
|
||||
--
|
||||
2.33.1
|
||||
|
81
SOURCES/0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch
Normal file
81
SOURCES/0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From 5a2d5dbdf8c6f6d3c896082a5a07b4292f5fb410 Mon Sep 17 00:00:00 2001
|
||||
From: Sam James <sam@gentoo.org>
|
||||
Date: Tue, 5 Jul 2022 01:47:35 +0100
|
||||
Subject: [PATCH 1/2] meson: set -D_GNU_SOURCE for updwtmpx
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Without setting GNU_SOURCE, we end up getting:
|
||||
```
|
||||
../gdm-42.0/daemon/gdm-session-record.c:200:9: error: implicit declaration of function ‘updwtmpx’; did you mean ‘updwtmp’? [-Werror=implicit-function-declaration]
|
||||
updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record);
|
||||
```
|
||||
|
||||
This ended up exposing a bug in updwtmp(3) (which is now fixed
|
||||
thanks to the man-pages maintainers!) as it didn't mention that updwtmpx
|
||||
is a GNU extension (and hence needs GNU_SOURCE in order to be available).
|
||||
|
||||
Alternatively, we could just #define _GNU_SOURCE in gdm-session-record.c
|
||||
for updwtmpx.
|
||||
|
||||
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216168
|
||||
---
|
||||
meson.build | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 8328dd97..4a286f97 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1,44 +1,47 @@
|
||||
project('gdm', 'c',
|
||||
version: '40.0',
|
||||
license: 'GPL2+',
|
||||
meson_version: '>= 0.50',
|
||||
)
|
||||
|
||||
# Modules
|
||||
gnome = import('gnome')
|
||||
pkgconfig = import('pkgconfig')
|
||||
i18n = import('i18n')
|
||||
|
||||
# Compiler
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
+# Use GNU extensions if available
|
||||
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||
+
|
||||
# Options
|
||||
gdm_prefix = get_option('prefix')
|
||||
|
||||
gdmconfdir = (get_option('sysconfsubdir') == '')? gdm_prefix / get_option('sysconfdir') : gdm_prefix / get_option('sysconfdir') / get_option('sysconfsubdir')
|
||||
dmconfdir = (get_option('dmconfdir') != '')? get_option('dmconfdir') : gdm_prefix / get_option('sysconfdir') / 'dm'
|
||||
udev_dir = get_option('udev-dir')
|
||||
at_spi_registryd_dir = (get_option('at-spi-registryd-dir') != '')? get_option('at-spi-registryd-dir') : gdm_prefix / get_option('libexecdir')
|
||||
lang_config_file = (get_option('lang-file') != '')? get_option('lang-file') : gdm_prefix / get_option('sysconfdir') / 'locale.conf'
|
||||
pam_mod_dir = (get_option('pam-mod-dir') != '')? get_option('pam-mod-dir') : gdm_prefix / get_option('libdir') / 'security'
|
||||
dbus_sys_dir = (get_option('dbus-sys') != '')? get_option('dbus-sys') : get_option('sysconfdir') / 'dbus-1' / 'system.d'
|
||||
gdm_defaults_conf = (get_option('defaults-conf') != '')? get_option('defaults-conf') : gdm_prefix / get_option('datadir') / 'gdm' / 'defaults.conf'
|
||||
gdm_custom_conf = (get_option('custom-conf') != '')? get_option('custom-conf') : gdmconfdir / 'custom.conf'
|
||||
gnome_settings_daemon_dir = (get_option('gnome-settings-daemon-dir') != '')? get_option('gnome-settings-daemon-dir') : gdm_prefix / get_option('libexecdir')
|
||||
gdm_run_dir = (get_option('run-dir') != '')? get_option('run-dir') : gdm_prefix / get_option('localstatedir') / 'run' / 'gdm'
|
||||
gdm_runtime_conf = (get_option('runtime-conf') != '')? get_option('runtime-conf') : gdm_run_dir / 'custom.conf'
|
||||
gdm_pid_file = (get_option('pid-file') != '')? get_option('pid-file') : gdm_run_dir / 'gdm.pid'
|
||||
ran_once_marker_dir = (get_option('ran-once-marker-dir') != '')? get_option('ran-once-marker-dir') : gdm_run_dir
|
||||
working_dir = (get_option('working-dir') != '')? get_option('working-dir') : gdm_prefix / get_option('localstatedir') / 'lib' / 'gdm'
|
||||
gdm_xauth_dir = (get_option('xauth-dir') != '')? get_option('xauth-dir') : gdm_run_dir
|
||||
gdm_screenshot_dir = (get_option('screenshot-dir') != '')? get_option('screenshot-dir') : gdm_run_dir / 'greeter'
|
||||
|
||||
# Common variables
|
||||
config_h_dir = include_directories('.')
|
||||
|
||||
# Dependencies
|
||||
udev_dep = dependency('udev')
|
||||
|
||||
glib_min_version = '2.56.0'
|
||||
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,84 @@
|
||||
From 56d12ad9697d5695c780a5be0065d23fec6bd1a5 Mon Sep 17 00:00:00 2001
|
||||
From: Chingkai Chu <3013329+chuchingkai@users.noreply.github.com>
|
||||
Date: Thu, 12 Aug 2021 10:34:01 +0800
|
||||
Subject: [PATCH] session-worker: Set session_vt=0 out of pam uninitialization
|
||||
|
||||
MR GNOME/gdm!123 moved jump_to_vt and session_vt reseting to a
|
||||
separate function, so we don't need to reset session_vt in pam
|
||||
uninitialization.
|
||||
|
||||
https://gitlab.gnome.org/GNOME/gdm/-/issues/719
|
||||
---
|
||||
daemon/gdm-session-worker.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index c1201b70..9cff53a5 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -1076,62 +1076,60 @@ gdm_session_worker_set_state (GdmSessionWorker *worker,
|
||||
|
||||
static void
|
||||
gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
|
||||
int status)
|
||||
{
|
||||
g_debug ("GdmSessionWorker: uninitializing PAM");
|
||||
|
||||
if (worker->priv->pam_handle == NULL)
|
||||
return;
|
||||
|
||||
gdm_session_worker_get_username (worker, NULL);
|
||||
|
||||
if (worker->priv->state >= GDM_SESSION_WORKER_STATE_SESSION_OPENED) {
|
||||
pam_close_session (worker->priv->pam_handle, 0);
|
||||
gdm_session_auditor_report_logout (worker->priv->auditor);
|
||||
} else {
|
||||
gdm_session_auditor_report_login_failure (worker->priv->auditor,
|
||||
status,
|
||||
pam_strerror (worker->priv->pam_handle, status));
|
||||
}
|
||||
|
||||
if (worker->priv->state >= GDM_SESSION_WORKER_STATE_ACCREDITED) {
|
||||
pam_setcred (worker->priv->pam_handle, PAM_DELETE_CRED);
|
||||
}
|
||||
|
||||
pam_end (worker->priv->pam_handle, status);
|
||||
worker->priv->pam_handle = NULL;
|
||||
|
||||
gdm_session_worker_stop_auditor (worker);
|
||||
|
||||
- worker->priv->session_vt = 0;
|
||||
-
|
||||
g_debug ("GdmSessionWorker: state NONE");
|
||||
gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_NONE);
|
||||
}
|
||||
|
||||
static char *
|
||||
_get_tty_for_pam (const char *x11_display_name,
|
||||
const char *display_device)
|
||||
{
|
||||
#ifdef __sun
|
||||
return g_strdup (display_device);
|
||||
#else
|
||||
return g_strdup (x11_display_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PAM_XAUTHDATA
|
||||
static struct pam_xauth_data *
|
||||
_get_xauth_for_pam (const char *x11_authority_file)
|
||||
{
|
||||
FILE *fh;
|
||||
Xauth *auth = NULL;
|
||||
struct pam_xauth_data *retval = NULL;
|
||||
gsize len = sizeof (*retval) + 1;
|
||||
|
||||
fh = fopen (x11_authority_file, "r");
|
||||
if (fh) {
|
||||
auth = XauReadAuth (fh);
|
||||
fclose (fh);
|
||||
}
|
||||
if (auth) {
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,470 +0,0 @@
|
||||
From 521ff70fe447558461dd38cdec62a7c0a5a74f7a Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 24 Jun 2019 14:48:23 -0400
|
||||
Subject: [PATCH 1/3] session-worker: expose worker state enum to type system
|
||||
|
||||
We're going to need to access the worker state as a property on
|
||||
the worker object.
|
||||
|
||||
This commit hooks it up to glib-mkenums so the requisite goo can
|
||||
get generated
|
||||
---
|
||||
daemon/Makefile.am | 8 +++++
|
||||
daemon/gdm-session-worker-enum-types.c.in | 42 +++++++++++++++++++++++
|
||||
daemon/gdm-session-worker-enum-types.h.in | 24 +++++++++++++
|
||||
daemon/gdm-session-worker.c | 16 +++------
|
||||
daemon/gdm-session-worker.h | 12 +++++++
|
||||
5 files changed, 90 insertions(+), 12 deletions(-)
|
||||
create mode 100644 daemon/gdm-session-worker-enum-types.c.in
|
||||
create mode 100644 daemon/gdm-session-worker-enum-types.h.in
|
||||
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index b77c9276e..86a8ee32f 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -14,69 +14,76 @@ AM_CPPFLAGS = \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\" \
|
||||
-DLOCALSTATEDIR=\"$(localstatedir)\" \
|
||||
-DLOGDIR=\"$(logdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\" \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
|
||||
-DGDM_RUN_DIR=\"$(GDM_RUN_DIR)\" \
|
||||
-DGDM_XAUTH_DIR=\"$(GDM_XAUTH_DIR)\" \
|
||||
-DGDM_SCREENSHOT_DIR=\"$(GDM_SCREENSHOT_DIR)\" \
|
||||
-DGDM_CACHE_DIR=\""$(localstatedir)/cache/gdm"\" \
|
||||
-DGDM_SESSION_DEFAULT_PATH=\"$(GDM_SESSION_DEFAULT_PATH)\" \
|
||||
$(DISABLE_DEPRECATED_CFLAGS) \
|
||||
$(DAEMON_CFLAGS) \
|
||||
$(XLIB_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(SYSTEMD_CFLAGS) \
|
||||
$(JOURNALD_CFLAGS) \
|
||||
$(LIBSELINUX_CFLAGS) \
|
||||
-DLANG_CONFIG_FILE=\"$(LANG_CONFIG_FILE)\" \
|
||||
$(NULL)
|
||||
|
||||
BUILT_SOURCES = \
|
||||
gdm-display-glue.h \
|
||||
gdm-manager-glue.h \
|
||||
gdm-local-display-glue.h \
|
||||
gdm-local-display-factory-glue.h \
|
||||
gdm-session-glue.h \
|
||||
gdm-session-worker-glue.h \
|
||||
gdm-session-enum-types.h \
|
||||
+ gdm-session-worker-enum-types.h \
|
||||
com.redhat.AccountsServiceUser.System.h \
|
||||
$(NULL)
|
||||
|
||||
gdm-session-enum-types.h: gdm-session-enum-types.h.in gdm-session.h
|
||||
$(AM_V_GEN) glib-mkenums --template $^ > $@
|
||||
|
||||
gdm-session-enum-types.c: gdm-session-enum-types.c.in gdm-session.h
|
||||
$(AM_V_GEN) glib-mkenums --template $^ > $@
|
||||
|
||||
+gdm-session-worker-enum-types.h: gdm-session-worker-enum-types.h.in gdm-session-worker.h
|
||||
+ $(AM_V_GEN) glib-mkenums --template $^ > $@
|
||||
+
|
||||
+gdm-session-worker-enum-types.c: gdm-session-worker-enum-types.c.in gdm-session-worker.h
|
||||
+ $(AM_V_GEN) glib-mkenums --template $^ > $@
|
||||
+
|
||||
gdm-display-glue.c gdm-display-glue.h: gdm-display.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-display-glue \
|
||||
$(srcdir)/gdm-display.xml
|
||||
|
||||
gdm-local-display-glue.c gdm-local-display-glue.h: gdm-local-display.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-local-display-glue \
|
||||
$(srcdir)/gdm-local-display.xml
|
||||
|
||||
gdm-local-display-factory-glue.c gdm-local-display-factory-glue.h : gdm-local-display-factory.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-local-display-factory-glue \
|
||||
$(srcdir)/gdm-local-display-factory.xml
|
||||
|
||||
gdm-manager-glue.c gdm-manager-glue.h : gdm-manager.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-manager-glue \
|
||||
$(srcdir)/gdm-manager.xml
|
||||
|
||||
gdm-session-glue.c gdm-session-glue.h : gdm-session.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
@@ -128,60 +135,61 @@ gdm_session_worker_SOURCES = \
|
||||
session-worker-main.c \
|
||||
com.redhat.AccountsServiceUser.System.h \
|
||||
com.redhat.AccountsServiceUser.System.c \
|
||||
gdm-session.c \
|
||||
gdm-session.h \
|
||||
gdm-session-settings.h \
|
||||
gdm-session-settings.c \
|
||||
gdm-session-auditor.h \
|
||||
gdm-session-auditor.c \
|
||||
gdm-session-record.c \
|
||||
gdm-session-record.h \
|
||||
gdm-session-worker.h \
|
||||
gdm-session-worker.c \
|
||||
gdm-session-worker-job.c \
|
||||
gdm-session-worker-common.c \
|
||||
gdm-session-worker-common.h \
|
||||
gdm-dbus-util.c \
|
||||
gdm-dbus-util.h \
|
||||
$(NULL)
|
||||
|
||||
if SUPPORTS_PAM_EXTENSIONS
|
||||
gdm_session_worker_SOURCES += $(top_srcdir)/pam-extensions/gdm-pam-extensions.h
|
||||
endif
|
||||
|
||||
nodist_gdm_session_worker_SOURCES = \
|
||||
gdm-session-glue.h \
|
||||
gdm-session-glue.c \
|
||||
gdm-session-worker-glue.c \
|
||||
gdm-session-worker-glue.h \
|
||||
gdm-session-enum-types.c \
|
||||
+ gdm-session-worker-enum-types.c \
|
||||
gdm-session-enum-types.h \
|
||||
$(NULL)
|
||||
|
||||
gdm_wayland_session_LDADD = \
|
||||
$(top_builddir)/common/libgdmcommon.la \
|
||||
$(GTK_LIBS) \
|
||||
$(COMMON_LIBS) \
|
||||
$(SYSTEMD_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
gdm_wayland_session_SOURCES = \
|
||||
gdm-manager-glue.h \
|
||||
gdm-manager-glue.c \
|
||||
gdm-wayland-session.c \
|
||||
$(NULL)
|
||||
|
||||
gdm_x_session_LDADD = \
|
||||
$(top_builddir)/common/libgdmcommon.la \
|
||||
$(GTK_LIBS) \
|
||||
$(COMMON_LIBS) \
|
||||
$(SYSTEMD_LIBS) \
|
||||
$(XLIB_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
gdm_x_session_SOURCES = \
|
||||
gdm-manager-glue.h \
|
||||
gdm-manager-glue.c \
|
||||
gdm-x-session.c \
|
||||
$(NULL)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker-enum-types.c.in b/daemon/gdm-session-worker-enum-types.c.in
|
||||
new file mode 100644
|
||||
index 000000000..c02869076
|
||||
--- /dev/null
|
||||
+++ b/daemon/gdm-session-worker-enum-types.c.in
|
||||
@@ -0,0 +1,42 @@
|
||||
+/*** BEGIN file-header ***/
|
||||
+
|
||||
+#include <glib-object.h>
|
||||
+
|
||||
+/*** END file-header ***/
|
||||
+
|
||||
+/*** BEGIN file-production ***/
|
||||
+#include "@filename@"
|
||||
+/* enumerations from "@filename@" */
|
||||
+/*** END file-production ***/
|
||||
+
|
||||
+/*** BEGIN value-header ***/
|
||||
+GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
+
|
||||
+GType
|
||||
+@enum_name@_get_type (void)
|
||||
+{
|
||||
+ static GType etype = 0;
|
||||
+
|
||||
+ if (G_UNLIKELY(etype == 0)) {
|
||||
+ static const G@Type@Value values[] = {
|
||||
+/*** END value-header ***/
|
||||
+
|
||||
+/*** BEGIN value-production ***/
|
||||
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
+/*** END value-production ***/
|
||||
+
|
||||
+/*** BEGIN value-tail ***/
|
||||
+ { 0, NULL, NULL }
|
||||
+ };
|
||||
+
|
||||
+ etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
+ }
|
||||
+
|
||||
+ return etype;
|
||||
+}
|
||||
+
|
||||
+/*** END value-tail ***/
|
||||
+
|
||||
+/*** BEGIN file-tail ***/
|
||||
+ /**/
|
||||
+/*** END file-tail ***/
|
||||
diff --git a/daemon/gdm-session-worker-enum-types.h.in b/daemon/gdm-session-worker-enum-types.h.in
|
||||
new file mode 100644
|
||||
index 000000000..64f4b4bb6
|
||||
--- /dev/null
|
||||
+++ b/daemon/gdm-session-worker-enum-types.h.in
|
||||
@@ -0,0 +1,24 @@
|
||||
+/*** BEGIN file-header ***/
|
||||
+#ifndef GDM_SESSION_WORKER_ENUM_TYPES_H
|
||||
+#define GDM_SESSION_WORKER_ENUM_TYPES_H
|
||||
+
|
||||
+#include <glib-object.h>
|
||||
+
|
||||
+G_BEGIN_DECLS
|
||||
+/*** END file-header ***/
|
||||
+
|
||||
+/*** BEGIN file-production ***/
|
||||
+
|
||||
+/* enumerations from "@filename@" */
|
||||
+/*** END file-production ***/
|
||||
+
|
||||
+/*** BEGIN value-header ***/
|
||||
+GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||
+/*** END value-header ***/
|
||||
+
|
||||
+/*** BEGIN file-tail ***/
|
||||
+G_END_DECLS
|
||||
+
|
||||
+#endif /* GDM_SESSION_WORKER_ENUM_TYPES_H */
|
||||
+/*** END file-tail ***/
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index ae86d28ac..f6935ab1d 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -83,83 +83,72 @@
|
||||
#define GDM_SESSION_WORKER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SESSION_WORKER, GdmSessionWorkerPrivate))
|
||||
|
||||
#define GDM_SESSION_DBUS_PATH "/org/gnome/DisplayManager/Session"
|
||||
#define GDM_SESSION_DBUS_NAME "org.gnome.DisplayManager.Session"
|
||||
#define GDM_SESSION_DBUS_ERROR_CANCEL "org.gnome.DisplayManager.Session.Error.Cancel"
|
||||
|
||||
#define GDM_WORKER_DBUS_PATH "/org/gnome/DisplayManager/Worker"
|
||||
|
||||
#ifndef GDM_PASSWD_AUXILLARY_BUFFER_SIZE
|
||||
#define GDM_PASSWD_AUXILLARY_BUFFER_SIZE 1024
|
||||
#endif
|
||||
|
||||
#ifndef GDM_SESSION_DEFAULT_PATH
|
||||
#define GDM_SESSION_DEFAULT_PATH "/usr/local/bin:/usr/bin:/bin"
|
||||
#endif
|
||||
|
||||
#ifndef GDM_SESSION_ROOT_UID
|
||||
#define GDM_SESSION_ROOT_UID 0
|
||||
#endif
|
||||
|
||||
#ifndef GDM_SESSION_LOG_FILENAME
|
||||
#define GDM_SESSION_LOG_FILENAME "session.log"
|
||||
#endif
|
||||
|
||||
#define MAX_FILE_SIZE 65536
|
||||
#define MAX_LOGS 5
|
||||
|
||||
#define RELEASE_DISPLAY_SIGNAL (SIGRTMAX)
|
||||
#define ACQUIRE_DISPLAY_SIGNAL (SIGRTMAX - 1)
|
||||
|
||||
-enum {
|
||||
- GDM_SESSION_WORKER_STATE_NONE = 0,
|
||||
- GDM_SESSION_WORKER_STATE_SETUP_COMPLETE,
|
||||
- GDM_SESSION_WORKER_STATE_AUTHENTICATED,
|
||||
- GDM_SESSION_WORKER_STATE_AUTHORIZED,
|
||||
- GDM_SESSION_WORKER_STATE_ACCREDITED,
|
||||
- GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED,
|
||||
- GDM_SESSION_WORKER_STATE_SESSION_OPENED,
|
||||
- GDM_SESSION_WORKER_STATE_SESSION_STARTED
|
||||
-};
|
||||
-
|
||||
typedef struct
|
||||
{
|
||||
GdmSessionWorker *worker;
|
||||
GdmSession *session;
|
||||
GPid pid_of_caller;
|
||||
uid_t uid_of_caller;
|
||||
|
||||
} ReauthenticationRequest;
|
||||
|
||||
struct GdmSessionWorkerPrivate
|
||||
{
|
||||
- int state;
|
||||
+ GdmSessionWorkerState state;
|
||||
|
||||
int exit_code;
|
||||
|
||||
pam_handle_t *pam_handle;
|
||||
|
||||
GPid child_pid;
|
||||
guint child_watch_id;
|
||||
|
||||
/* from Setup */
|
||||
char *service;
|
||||
char *x11_display_name;
|
||||
char *x11_authority_file;
|
||||
char *display_device;
|
||||
char *display_seat_id;
|
||||
char *hostname;
|
||||
char *username;
|
||||
char *log_file;
|
||||
char *session_id;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
gboolean password_is_required;
|
||||
char **extensions;
|
||||
|
||||
int cred_flags;
|
||||
int login_vt;
|
||||
int session_vt;
|
||||
int session_tty_fd;
|
||||
|
||||
char **arguments;
|
||||
guint32 cancelled : 1;
|
||||
@@ -2455,60 +2444,63 @@ gdm_session_worker_set_property (GObject *object,
|
||||
switch (prop_id) {
|
||||
case PROP_SERVER_ADDRESS:
|
||||
gdm_session_worker_set_server_address (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_IS_REAUTH_SESSION:
|
||||
gdm_session_worker_set_is_reauth_session (self, g_value_get_boolean (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdmSessionWorker *self;
|
||||
|
||||
self = GDM_SESSION_WORKER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_SERVER_ADDRESS:
|
||||
g_value_set_string (value, self->priv->server_address);
|
||||
break;
|
||||
case PROP_IS_REAUTH_SESSION:
|
||||
g_value_set_boolean (value, self->priv->is_reauth_session);
|
||||
break;
|
||||
+ case PROP_STATE:
|
||||
+ g_value_set_int (value, self->priv->state);
|
||||
+ break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_worker_handle_set_environment_variable (GdmDBusWorker *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *key,
|
||||
const char *value)
|
||||
{
|
||||
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
|
||||
gdm_session_worker_set_environment_variable (worker, key, value);
|
||||
gdm_dbus_worker_complete_set_environment_variable (object, invocation);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_worker_handle_set_session_name (GdmDBusWorker *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *session_name)
|
||||
{
|
||||
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
|
||||
g_debug ("GdmSessionWorker: session name set to %s", session_name);
|
||||
if (worker->priv->user_settings != NULL)
|
||||
gdm_session_settings_set_session_name (worker->priv->user_settings,
|
||||
session_name);
|
||||
gdm_dbus_worker_complete_set_session_name (object, invocation);
|
||||
return TRUE;
|
||||
diff --git a/daemon/gdm-session-worker.h b/daemon/gdm-session-worker.h
|
||||
index 5603e80e0..2814eab4d 100644
|
||||
--- a/daemon/gdm-session-worker.h
|
||||
+++ b/daemon/gdm-session-worker.h
|
||||
@@ -1,56 +1,68 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
*
|
||||
* Copyright (C) 2006 Ray Strode <rstrode@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GDM_SESSION_WORKER_H
|
||||
#define __GDM_SESSION_WORKER_H
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "gdm-session-worker-glue.h"
|
||||
#include "gdm-session-worker-common.h"
|
||||
+#include "gdm-session-worker-enum-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDM_TYPE_SESSION_WORKER (gdm_session_worker_get_type ())
|
||||
#define GDM_SESSION_WORKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDM_TYPE_SESSION_WORKER, GdmSessionWorker))
|
||||
#define GDM_SESSION_WORKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDM_TYPE_SESSION_WORKER, GdmSessionWorkerClass))
|
||||
#define GDM_IS_SESSION_WORKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDM_TYPE_SESSION_WORKER))
|
||||
#define GDM_IS_SESSION_WORKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDM_TYPE_SESSION_WORKER))
|
||||
#define GDM_SESSION_WORKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GDM_TYPE_SESSION_WORKER, GdmSessionWorkerClass))
|
||||
|
||||
+typedef enum {
|
||||
+ GDM_SESSION_WORKER_STATE_NONE = 0,
|
||||
+ GDM_SESSION_WORKER_STATE_SETUP_COMPLETE,
|
||||
+ GDM_SESSION_WORKER_STATE_AUTHENTICATED,
|
||||
+ GDM_SESSION_WORKER_STATE_AUTHORIZED,
|
||||
+ GDM_SESSION_WORKER_STATE_ACCREDITED,
|
||||
+ GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED,
|
||||
+ GDM_SESSION_WORKER_STATE_SESSION_OPENED,
|
||||
+ GDM_SESSION_WORKER_STATE_SESSION_STARTED
|
||||
+} GdmSessionWorkerState;
|
||||
+
|
||||
typedef struct GdmSessionWorkerPrivate GdmSessionWorkerPrivate;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdmDBusWorkerSkeleton parent;
|
||||
GdmSessionWorkerPrivate *priv;
|
||||
} GdmSessionWorker;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdmDBusWorkerSkeletonClass parent_class;
|
||||
} GdmSessionWorkerClass;
|
||||
|
||||
GType gdm_session_worker_get_type (void);
|
||||
|
||||
GdmSessionWorker * gdm_session_worker_new (const char *server_address,
|
||||
gboolean is_for_reauth) G_GNUC_MALLOC;
|
||||
G_END_DECLS
|
||||
#endif /* GDM_SESSION_WORKER_H */
|
||||
--
|
||||
2.18.1
|
||||
|
362
SOURCES/0001-utils-Drop-gdm-screenshot.patch
Normal file
362
SOURCES/0001-utils-Drop-gdm-screenshot.patch
Normal file
@ -0,0 +1,362 @@
|
||||
From 7b5ee288d992f85eaefbfbc4dac663a29fcae446 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 5 May 2021 11:06:58 -0400
|
||||
Subject: [PATCH] 0001-utils-Drop-gdm-screenshot.patch
|
||||
|
||||
---
|
||||
utils/gdm-screenshot.c | 296 -----------------------------------------
|
||||
utils/meson.build | 15 ---
|
||||
2 files changed, 311 deletions(-)
|
||||
delete mode 100644 utils/gdm-screenshot.c
|
||||
|
||||
diff --git a/utils/gdm-screenshot.c b/utils/gdm-screenshot.c
|
||||
deleted file mode 100644
|
||||
index 5d20929a3..000000000
|
||||
--- a/utils/gdm-screenshot.c
|
||||
+++ /dev/null
|
||||
@@ -1,296 +0,0 @@
|
||||
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
- *
|
||||
- * Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
|
||||
- *
|
||||
- * This program is free software; you can redistribute it and/or modify
|
||||
- * it under the terms of the GNU General Public License as published by
|
||||
- * the Free Software Foundation; either version 2 of the License, or
|
||||
- * (at your option) any later version.
|
||||
- *
|
||||
- * This program is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU General Public License
|
||||
- * along with this program; if not, write to the Free Software
|
||||
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
- *
|
||||
- */
|
||||
-
|
||||
-#include "config.h"
|
||||
-
|
||||
-#include <stdlib.h>
|
||||
-#include <stdio.h>
|
||||
-#include <unistd.h>
|
||||
-#include <string.h>
|
||||
-#include <locale.h>
|
||||
-
|
||||
-#include <glib/gi18n.h>
|
||||
-#include <gtk/gtk.h>
|
||||
-#include <canberra-gtk.h>
|
||||
-
|
||||
-#include <X11/Xatom.h>
|
||||
-#include <gdk/gdkx.h>
|
||||
-
|
||||
-#define SELECTION_NAME "_GDM_SCREENSHOT"
|
||||
-static GtkWidget *selection_window;
|
||||
-
|
||||
-static gboolean debug_in;
|
||||
-
|
||||
-/* Keep all config options for compatibility even if they are noops */
|
||||
-GOptionEntry options [] = {
|
||||
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug_in, N_("Debugging output"), NULL },
|
||||
- { NULL }
|
||||
-};
|
||||
-
|
||||
-/* To make sure there is only one screenshot taken at a time,
|
||||
- * (Imagine key repeat for the print screen key) we hold a selection
|
||||
- * until we are done taking the screenshot
|
||||
- */
|
||||
-/* * Copyright (C) 2001-2006 Jonathan Blandford <jrb@alum.mit.edu> */
|
||||
-static gboolean
|
||||
-screenshot_grab_lock (void)
|
||||
-{
|
||||
- Atom selection_atom;
|
||||
- GdkCursor *cursor;
|
||||
- gboolean result = FALSE;
|
||||
-
|
||||
- selection_atom = gdk_x11_get_xatom_by_name (SELECTION_NAME);
|
||||
- XGrabServer (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
||||
- if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), selection_atom) != None) {
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- selection_window = gtk_invisible_new ();
|
||||
- gtk_widget_show (selection_window);
|
||||
-
|
||||
- if (!gtk_selection_owner_set (selection_window,
|
||||
- gdk_atom_intern (SELECTION_NAME, FALSE),
|
||||
- GDK_CURRENT_TIME)) {
|
||||
- gtk_widget_destroy (selection_window);
|
||||
- selection_window = NULL;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- cursor = gdk_cursor_new_for_display (gdk_display_get_default (), GDK_WATCH);
|
||||
- gdk_pointer_grab (gtk_widget_get_window (selection_window), FALSE, 0, NULL,
|
||||
- cursor, GDK_CURRENT_TIME);
|
||||
- g_object_unref (cursor);
|
||||
-
|
||||
- result = TRUE;
|
||||
-
|
||||
- out:
|
||||
- XUngrabServer (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
||||
- gdk_flush ();
|
||||
-
|
||||
- return result;
|
||||
-}
|
||||
-
|
||||
-/* * Copyright (C) 2001-2006 Jonathan Blandford <jrb@alum.mit.edu> */
|
||||
-static void
|
||||
-screenshot_release_lock (void)
|
||||
-{
|
||||
- if (selection_window != NULL) {
|
||||
- gtk_widget_destroy (selection_window);
|
||||
- selection_window = NULL;
|
||||
- }
|
||||
- gdk_flush ();
|
||||
-}
|
||||
-
|
||||
-/* * Copyright (C) 2001-2006 Jonathan Blandford <jrb@alum.mit.edu> */
|
||||
-static GdkPixbuf *
|
||||
-screenshot_get_pixbuf (Window w)
|
||||
-{
|
||||
- GdkWindow *window;
|
||||
- GdkWindow *root;
|
||||
- GdkPixbuf *screenshot;
|
||||
- int x_real_orig;
|
||||
- int y_real_orig;
|
||||
- int x_orig;
|
||||
- int y_orig;
|
||||
- int real_width;
|
||||
- int real_height;
|
||||
- int width;
|
||||
- int height;
|
||||
-
|
||||
- window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), w);
|
||||
- if (window == NULL) {
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- root = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), GDK_ROOT_WINDOW ());
|
||||
- gdk_window_get_geometry (window, NULL, NULL, &real_width, &real_height);
|
||||
- gdk_window_get_origin (window, &x_real_orig, &y_real_orig);
|
||||
-
|
||||
- x_orig = x_real_orig;
|
||||
- y_orig = y_real_orig;
|
||||
- width = real_width;
|
||||
- height = real_height;
|
||||
-
|
||||
- if (x_orig < 0) {
|
||||
- width = width + x_orig;
|
||||
- x_orig = 0;
|
||||
- }
|
||||
- if (y_orig < 0) {
|
||||
- height = height + y_orig;
|
||||
- y_orig = 0;
|
||||
- }
|
||||
-
|
||||
- if (x_orig + width > gdk_screen_width ()) {
|
||||
- width = gdk_screen_width () - x_orig;
|
||||
- }
|
||||
- if (y_orig + height > gdk_screen_height ()) {
|
||||
- height = gdk_screen_height () - y_orig;
|
||||
- }
|
||||
-
|
||||
- screenshot = gdk_pixbuf_get_from_window (root,
|
||||
- x_orig,
|
||||
- y_orig,
|
||||
- width,
|
||||
- height);
|
||||
-
|
||||
- return screenshot;
|
||||
-}
|
||||
-
|
||||
-static char *
|
||||
-screenshot_save (GdkPixbuf *pixbuf)
|
||||
-{
|
||||
- char *filename;
|
||||
- gboolean res;
|
||||
- GError *error;
|
||||
-
|
||||
- filename = g_build_filename (GDM_SCREENSHOT_DIR,
|
||||
- "GDM-Screenshot.png",
|
||||
- NULL);
|
||||
-
|
||||
- error = NULL;
|
||||
- res = gdk_pixbuf_save (pixbuf,
|
||||
- filename,
|
||||
- "png",
|
||||
- &error,
|
||||
- "tEXt::CREATOR", "gdm-screenshot",
|
||||
- NULL);
|
||||
- if (! res) {
|
||||
- g_warning ("Unable to save screenshot: %s", error->message);
|
||||
- g_error_free (error);
|
||||
- g_free (filename);
|
||||
- filename = NULL;
|
||||
- }
|
||||
-
|
||||
- return filename;
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-sound_effect_finished (ca_context *c,
|
||||
- uint32_t id,
|
||||
- int error_code,
|
||||
- void *userdata)
|
||||
-{
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-play_sound_effect (Window xid)
|
||||
-{
|
||||
- ca_context *c;
|
||||
- ca_proplist *p;
|
||||
- int res;
|
||||
-
|
||||
- c = ca_gtk_context_get ();
|
||||
-
|
||||
- p = NULL;
|
||||
- res = ca_proplist_create (&p);
|
||||
- if (res < 0) {
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
- res = ca_proplist_sets (p, CA_PROP_EVENT_ID, "screen-capture");
|
||||
- if (res < 0) {
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
- res = ca_proplist_sets (p, CA_PROP_EVENT_DESCRIPTION, _("Screenshot taken"));
|
||||
- if (res < 0) {
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
- res = ca_proplist_setf (p,
|
||||
- CA_PROP_WINDOW_X11_XID,
|
||||
- "%lu",
|
||||
- (unsigned long) xid);
|
||||
- if (res < 0) {
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
- ca_context_play_full (c, 0, p, sound_effect_finished, NULL);
|
||||
-
|
||||
- done:
|
||||
- if (p != NULL) {
|
||||
- ca_proplist_destroy (p);
|
||||
- }
|
||||
-
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-prepare_screenshot (void)
|
||||
-{
|
||||
- Window win;
|
||||
- GdkPixbuf *screenshot;
|
||||
- char *filename;
|
||||
-
|
||||
- if (!screenshot_grab_lock ()) {
|
||||
- exit (EXIT_SUCCESS);
|
||||
- }
|
||||
-
|
||||
- win = GDK_ROOT_WINDOW ();
|
||||
-
|
||||
- screenshot = screenshot_get_pixbuf (win);
|
||||
-
|
||||
- screenshot_release_lock ();
|
||||
-
|
||||
- if (screenshot == NULL) {
|
||||
- /* FIXME: dialog? */
|
||||
- exit (EXIT_FAILURE);
|
||||
- }
|
||||
-
|
||||
- play_sound_effect (win);
|
||||
-
|
||||
- filename = screenshot_save (screenshot);
|
||||
- if (filename != NULL) {
|
||||
- g_print ("Wrote %s\n", filename);
|
||||
- /* FIXME: show a dialog or something */
|
||||
- g_free (filename);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-int
|
||||
-main (int argc, char *argv[])
|
||||
-{
|
||||
- GOptionContext *ctx;
|
||||
- gboolean res;
|
||||
- GError *error;
|
||||
-
|
||||
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
- textdomain (GETTEXT_PACKAGE);
|
||||
- setlocale (LC_ALL, "");
|
||||
-
|
||||
- /* Option parsing */
|
||||
- ctx = g_option_context_new (N_("Take a picture of the screen"));
|
||||
- g_option_context_set_translation_domain (ctx, GETTEXT_PACKAGE);
|
||||
- g_option_context_add_main_entries (ctx, options, NULL);
|
||||
- g_option_context_add_group (ctx, gtk_get_option_group (TRUE));
|
||||
- error = NULL;
|
||||
- res = g_option_context_parse (ctx, &argc, &argv, &error);
|
||||
- g_option_context_free (ctx);
|
||||
-
|
||||
- if (! res) {
|
||||
- g_warning ("%s", error->message);
|
||||
- g_error_free (error);
|
||||
- exit (EXIT_FAILURE);
|
||||
- }
|
||||
-
|
||||
- prepare_screenshot ();
|
||||
-
|
||||
- return 1;
|
||||
-}
|
||||
diff --git a/utils/meson.build b/utils/meson.build
|
||||
index d59f167b0..1edd7bce4 100644
|
||||
--- a/utils/meson.build
|
||||
+++ b/utils/meson.build
|
||||
@@ -1,41 +1,26 @@
|
||||
# gdm-flexiserver
|
||||
gdm_flexiserver_deps = [
|
||||
glib_dep,
|
||||
libgdmcommon_dep,
|
||||
]
|
||||
|
||||
gdm_flexiserver = executable('gdmflexiserver',
|
||||
'gdmflexiserver.c',
|
||||
dependencies: gdm_flexiserver_deps,
|
||||
include_directories: config_h_dir,
|
||||
install: true,
|
||||
)
|
||||
|
||||
-# gdm-screenshot
|
||||
-gdm_screenshot_deps = [
|
||||
- glib_dep,
|
||||
- gtk_dep,
|
||||
- x_deps,
|
||||
- libcanberra_gtk_dep,
|
||||
-]
|
||||
-
|
||||
-gdm_screenshot = executable('gdm-screenshot',
|
||||
- 'gdm-screenshot.c',
|
||||
- dependencies: gdm_screenshot_deps,
|
||||
- include_directories: config_h_dir,
|
||||
- install: true,
|
||||
-)
|
||||
-
|
||||
# gdm-runtime-config
|
||||
gdm_runtime_config_deps = [
|
||||
glib_dep,
|
||||
]
|
||||
|
||||
gdm_runtime_config = executable('gdm-runtime-config',
|
||||
'gdm-runtime-config.c',
|
||||
dependencies: gdm_runtime_config_deps,
|
||||
include_directories: config_h_dir,
|
||||
install: true,
|
||||
install_dir: get_option('libexecdir'),
|
||||
)
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,161 +0,0 @@
|
||||
From 14656db42a6b4d4d48cf74127f3187dfe85607ec Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 21 May 2018 15:03:29 +0000
|
||||
Subject: [PATCH] utils: add new gdm-disable-wayland binary
|
||||
|
||||
We currently disable wayland for cirrus by calling printf
|
||||
from a udev rule. This works, but it's a little too open
|
||||
coded to easily write SELinux policy for.
|
||||
|
||||
This commit introduces a new program, gdm-disable-wayland,
|
||||
that does the same thing, but in a dedicated binary.
|
||||
|
||||
A future commit will change the udev rule to use the binary.
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=796315
|
||||
|
||||
|
||||
(cherry picked from commit 2dc57da31781dedfe374ce353b0f5fd6aa9da56f)
|
||||
---
|
||||
utils/Makefile.am | 14 ++++++++++
|
||||
utils/gdm-disable-wayland.c | 53 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 67 insertions(+)
|
||||
create mode 100644 utils/gdm-disable-wayland.c
|
||||
|
||||
diff --git a/utils/Makefile.am b/utils/Makefile.am
|
||||
index ae3cc01fb..babe890b9 100644
|
||||
--- a/utils/Makefile.am
|
||||
+++ b/utils/Makefile.am
|
||||
@@ -1,56 +1,70 @@
|
||||
NULL =
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(srcdir) \
|
||||
-I$(builddir) \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_builddir)/common \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
-DGDMCONFDIR=\"$(gdmconfdir)\" \
|
||||
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
|
||||
+ -DGDM_RUN_DIR=\"$(GDM_RUN_DIR)\" \
|
||||
+ -DGDM_RUNTIME_CONF=\"$(GDM_RUNTIME_CONF)\" \
|
||||
-DGDM_SCREENSHOT_DIR=\""$(GDM_SCREENSHOT_DIR)"\"\
|
||||
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
|
||||
$(UTILS_CFLAGS) \
|
||||
$(CANBERRA_GTK_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
$(XLIB_CFLAGS) \
|
||||
$(SYSTEMD_CFLAGS) \
|
||||
$(COMMON_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
edit = sed \
|
||||
-e 's|@sbindir[@]|$(sbindir)|g' \
|
||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||
-e 's|@localstatedir[@]|$(localstatedir)|g' \
|
||||
-e 's|@GDM_PID_FILE[@]|$(GDM_PID_FILE)|g'
|
||||
|
||||
bin_PROGRAMS = \
|
||||
gdmflexiserver \
|
||||
gdm-screenshot \
|
||||
$(NULL)
|
||||
|
||||
+libexec_PROGRAMS = \
|
||||
+ gdm-disable-wayland \
|
||||
+ $(NULL)
|
||||
+
|
||||
gdmflexiserver_LDADD = \
|
||||
$(top_builddir)/common/libgdmcommon.la \
|
||||
$(GTK_LIBS) \
|
||||
$(COMMON_LIBS) \
|
||||
$(SYSTEMD_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
gdm_screenshot_SOURCES = \
|
||||
gdm-screenshot.c \
|
||||
$(NULL)
|
||||
|
||||
gdm_screenshot_LDADD = \
|
||||
$(GTK_LIBS) \
|
||||
$(CANBERRA_GTK_LIBS) \
|
||||
$(XLIB_LIBS) \
|
||||
$(COMMON_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
+gdm_disable_wayland_LDADD = \
|
||||
+ $(COMMON_LIBS) \
|
||||
+ $(NULL)
|
||||
+
|
||||
+gdm_disable_wayland_SOURCES = \
|
||||
+ gdm-disable-wayland.c \
|
||||
+ $(NULL)
|
||||
+
|
||||
CLEANFILES = \
|
||||
$(NULL)
|
||||
|
||||
DISTCLEANFILES = \
|
||||
$(NULL)
|
||||
diff --git a/utils/gdm-disable-wayland.c b/utils/gdm-disable-wayland.c
|
||||
new file mode 100644
|
||||
index 000000000..be61c4d8f
|
||||
--- /dev/null
|
||||
+++ b/utils/gdm-disable-wayland.c
|
||||
@@ -0,0 +1,53 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
+ *
|
||||
+ * Copyright (C) 2018 Red Hat, Inc.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "config.h"
|
||||
+
|
||||
+#include <locale.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sysexits.h>
|
||||
+
|
||||
+#include <glib.h>
|
||||
+
|
||||
+int
|
||||
+main (int argc, char *argv[])
|
||||
+{
|
||||
+ g_autoptr(GKeyFile) key_file = NULL;
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
+ gboolean saved_okay;
|
||||
+
|
||||
+ setlocale (LC_ALL, "");
|
||||
+
|
||||
+ key_file = g_key_file_new ();
|
||||
+
|
||||
+ g_key_file_set_boolean (key_file, "daemon", "WaylandEnable", FALSE);
|
||||
+
|
||||
+ g_mkdir_with_parents (GDM_RUN_DIR, 0711);
|
||||
+
|
||||
+ saved_okay = g_key_file_save_to_file (key_file, GDM_RUNTIME_CONF, &error);
|
||||
+
|
||||
+ if (!saved_okay) {
|
||||
+ g_printerr ("gdm-disable-wayland: unable to disable wayland: %s",
|
||||
+ error->message);
|
||||
+ return EX_CANTCREAT;
|
||||
+ }
|
||||
+
|
||||
+ return EX_OK;
|
||||
+}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a45b3f26e1f1f4ffc8870ebf073698d5eecf587b Mon Sep 17 00:00:00 2001
|
||||
From f0dce28fa02210caa445e96d9cbec1d150b79e80 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 15 Aug 2018 10:48:16 -0400
|
||||
Subject: [PATCH 1/4] worker: don't load user settings for program sessions
|
||||
@ -6,14 +6,14 @@ Subject: [PATCH 1/4] worker: don't load user settings for program sessions
|
||||
We don't need or want the login greeter to access accountsservice
|
||||
for its session name
|
||||
---
|
||||
daemon/gdm-session-worker.c | 38 +++++++++++++++++++++++++------------
|
||||
1 file changed, 26 insertions(+), 12 deletions(-)
|
||||
daemon/gdm-session-worker.c | 37 ++++++++++++++++++++++++++-----------
|
||||
1 file changed, 26 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index c1d89cab2..e79073996 100644
|
||||
index 9b8e0d87..438348df 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -409,103 +409,108 @@ gdm_session_execute (const char *file,
|
||||
@@ -400,103 +400,108 @@ gdm_session_execute (const char *file,
|
||||
*/
|
||||
static gboolean
|
||||
gdm_session_worker_get_username (GdmSessionWorker *worker,
|
||||
@ -124,12 +124,12 @@ index c1d89cab2..e79073996 100644
|
||||
worker->priv->service,
|
||||
question,
|
||||
answerp,
|
||||
@@ -2475,87 +2480,89 @@ gdm_session_worker_get_property (GObject *object,
|
||||
g_value_set_string (value, self->priv->server_address);
|
||||
break;
|
||||
case PROP_IS_REAUTH_SESSION:
|
||||
@@ -2598,87 +2603,89 @@ gdm_session_worker_get_property (GObject *object,
|
||||
g_value_set_boolean (value, self->priv->is_reauth_session);
|
||||
break;
|
||||
case PROP_STATE:
|
||||
g_value_set_enum (value, self->priv->state);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@ -218,7 +218,8 @@ index c1d89cab2..e79073996 100644
|
||||
g_free (session_name);
|
||||
}
|
||||
|
||||
@@ -2634,109 +2641,111 @@ do_authorize (GdmSessionWorker *worker)
|
||||
@@ -2756,110 +2763,113 @@ do_authorize (GdmSessionWorker *worker)
|
||||
g_dbus_method_invocation_take_error (worker->priv->pending_invocation, error);
|
||||
}
|
||||
worker->priv->pending_invocation = NULL;
|
||||
}
|
||||
@ -248,7 +249,8 @@ index c1d89cab2..e79073996 100644
|
||||
g_assert (worker->priv->state == GDM_SESSION_WORKER_STATE_ACCREDITED);
|
||||
|
||||
g_debug ("GdmSessionWorker: saving account details for user %s", worker->priv->username);
|
||||
worker->priv->state = GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED;
|
||||
+
|
||||
gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED);
|
||||
- if (!gdm_session_settings_save (worker->priv->user_settings,
|
||||
- worker->priv->username)) {
|
||||
- g_warning ("could not save session and language settings");
|
||||
@ -334,7 +336,7 @@ index c1d89cab2..e79073996 100644
|
||||
}
|
||||
|
||||
gdm_dbus_worker_complete_open (GDM_DBUS_WORKER (worker), worker->priv->pending_invocation, session_id);
|
||||
@@ -2980,155 +2989,161 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
@@ -3103,155 +3113,161 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
if (g_strcmp0 (key, "service") == 0) {
|
||||
worker->priv->service = g_variant_dup_string (value, NULL);
|
||||
} else if (g_strcmp0 (key, "extensions") == 0) {
|
||||
@ -496,7 +498,7 @@ index c1d89cab2..e79073996 100644
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *service,
|
||||
const char *username,
|
||||
@@ -3459,98 +3474,97 @@ static void
|
||||
@@ -3589,61 +3605,60 @@ static void
|
||||
reauthentication_request_free (ReauthenticationRequest *request)
|
||||
{
|
||||
|
||||
@ -558,44 +560,6 @@ index c1d89cab2..e79073996 100644
|
||||
|
||||
g_return_if_fail (worker->priv != NULL);
|
||||
|
||||
gdm_session_worker_unwatch_child (worker);
|
||||
|
||||
if (worker->priv->child_pid > 0) {
|
||||
gdm_signal_pid (worker->priv->child_pid, SIGTERM);
|
||||
gdm_wait_on_pid (worker->priv->child_pid);
|
||||
}
|
||||
|
||||
- g_object_unref (worker->priv->user_settings);
|
||||
+ g_clear_object (&worker->priv->user_settings);
|
||||
g_free (worker->priv->service);
|
||||
g_free (worker->priv->x11_display_name);
|
||||
g_free (worker->priv->x11_authority_file);
|
||||
g_free (worker->priv->display_device);
|
||||
g_free (worker->priv->display_seat_id);
|
||||
g_free (worker->priv->hostname);
|
||||
g_free (worker->priv->username);
|
||||
g_free (worker->priv->server_address);
|
||||
g_strfreev (worker->priv->arguments);
|
||||
g_strfreev (worker->priv->extensions);
|
||||
|
||||
g_hash_table_unref (worker->priv->reauthentication_requests);
|
||||
|
||||
G_OBJECT_CLASS (gdm_session_worker_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
GdmSessionWorker *
|
||||
gdm_session_worker_new (const char *address,
|
||||
gboolean is_reauth_session)
|
||||
{
|
||||
GObject *object;
|
||||
|
||||
object = g_object_new (GDM_TYPE_SESSION_WORKER,
|
||||
"server-address", address,
|
||||
"is-reauth-session", is_reauth_session,
|
||||
NULL);
|
||||
|
||||
return GDM_SESSION_WORKER (object);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
2.33.1
|
||||
|
||||
|
@ -0,0 +1,327 @@
|
||||
From d3823a5084e12d8f342fd4cbec29e23bdb646de7 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Thu, 7 Oct 2021 18:22:11 -0700
|
||||
Subject: [PATCH 2/2] daemon: Support X servers built with -Dlisten_tcp=true
|
||||
|
||||
Xorg since version 1.17 doesn't listen to tcp sockets by default
|
||||
unless it's explicitly built with -Dlisten_tcp=true.
|
||||
|
||||
GDM currently assumes X servers 1.17 and later are always built
|
||||
without specifying -Dlisten_tcp=true and doesn't work properly
|
||||
otherwise.
|
||||
|
||||
This commit enhances GDM to better handle these non-standard builds by
|
||||
always passing '-nolisten tcp' on the command line when tcp should
|
||||
be disabled, and likewise always passing '-listen tcp' on the command
|
||||
line, assuming the X server is new enough to support it, when tcp
|
||||
should be enabled.
|
||||
|
||||
Related #704
|
||||
---
|
||||
daemon/gdm-server.c | 21 +++++++++++----------
|
||||
daemon/gdm-x-session.c | 12 ++++++------
|
||||
meson.build | 4 ++--
|
||||
3 files changed, 19 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
|
||||
index 1ba00d45..e5d23521 100644
|
||||
--- a/daemon/gdm-server.c
|
||||
+++ b/daemon/gdm-server.c
|
||||
@@ -290,72 +290,73 @@ gdm_server_resolve_command_line (GdmServer *server,
|
||||
if (strcmp (arg, "-query") == 0 ||
|
||||
strcmp (arg, "-indirect") == 0)
|
||||
query_in_arglist = TRUE;
|
||||
}
|
||||
|
||||
argv = g_renew (char *, argv, len + 12);
|
||||
/* shift args down one */
|
||||
for (i = len - 1; i >= 1; i--) {
|
||||
argv[i+1] = argv[i];
|
||||
}
|
||||
|
||||
/* server number is the FIRST argument, before any others */
|
||||
argv[1] = g_strdup (server->display_name);
|
||||
len++;
|
||||
|
||||
if (server->auth_file != NULL) {
|
||||
argv[len++] = g_strdup ("-auth");
|
||||
argv[len++] = g_strdup (server->auth_file);
|
||||
}
|
||||
|
||||
if (server->display_seat_id != NULL) {
|
||||
argv[len++] = g_strdup ("-seat");
|
||||
argv[len++] = g_strdup (server->display_seat_id);
|
||||
}
|
||||
|
||||
/* If we were compiled with Xserver >= 1.17 we need to specify
|
||||
* '-listen tcp' as the X server dosen't listen on tcp sockets
|
||||
* by default anymore. In older versions we need to pass
|
||||
* -nolisten tcp to disable listening on tcp sockets.
|
||||
*/
|
||||
-#ifdef HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY
|
||||
- if (!server->disable_tcp && ! query_in_arglist) {
|
||||
- argv[len++] = g_strdup ("-listen");
|
||||
- argv[len++] = g_strdup ("tcp");
|
||||
- }
|
||||
-#else
|
||||
- if (server->disable_tcp && ! query_in_arglist) {
|
||||
- argv[len++] = g_strdup ("-nolisten");
|
||||
- argv[len++] = g_strdup ("tcp");
|
||||
- }
|
||||
+ if (!query_in_arglist) {
|
||||
+ if (server->disable_tcp) {
|
||||
+ argv[len++] = g_strdup ("-nolisten");
|
||||
+ argv[len++] = g_strdup ("tcp");
|
||||
+ }
|
||||
|
||||
+#ifdef HAVE_XSERVER_WITH_LISTEN
|
||||
+ if (!server->disable_tcp) {
|
||||
+ argv[len++] = g_strdup ("-listen");
|
||||
+ argv[len++] = g_strdup ("tcp");
|
||||
+ }
|
||||
#endif
|
||||
+ }
|
||||
|
||||
if (vtarg != NULL && ! gotvtarg) {
|
||||
argv[len++] = g_strdup (vtarg);
|
||||
}
|
||||
|
||||
argv[len++] = NULL;
|
||||
|
||||
*argvp = argv;
|
||||
*argcp = len;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
rotate_logs (const char *path,
|
||||
guint n_copies)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = n_copies - 1; i > 0; i--) {
|
||||
char *name_n;
|
||||
char *name_n1;
|
||||
|
||||
name_n = g_strdup_printf ("%s.%d", path, i);
|
||||
if (i > 1) {
|
||||
name_n1 = g_strdup_printf ("%s.%d", path, i - 1);
|
||||
} else {
|
||||
name_n1 = g_strdup (path);
|
||||
}
|
||||
|
||||
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
|
||||
index b1548361..d2a8aeb3 100644
|
||||
--- a/daemon/gdm-x-session.c
|
||||
+++ b/daemon/gdm-x-session.c
|
||||
@@ -233,70 +233,70 @@ spawn_x_server (State *state,
|
||||
|
||||
if (g_getenv ("XDG_VTNR") != NULL) {
|
||||
int vt;
|
||||
|
||||
vt = atoi (g_getenv ("XDG_VTNR"));
|
||||
|
||||
if (vt > 0 && vt < 64) {
|
||||
vt_string = g_strdup_printf ("vt%d", vt);
|
||||
}
|
||||
}
|
||||
|
||||
display_fd_string = g_strdup_printf ("%d", DISPLAY_FILENO);
|
||||
|
||||
g_ptr_array_add (arguments, X_SERVER);
|
||||
|
||||
if (vt_string != NULL) {
|
||||
g_ptr_array_add (arguments, vt_string);
|
||||
}
|
||||
|
||||
g_ptr_array_add (arguments, "-displayfd");
|
||||
g_ptr_array_add (arguments, display_fd_string);
|
||||
|
||||
g_ptr_array_add (arguments, "-auth");
|
||||
g_ptr_array_add (arguments, auth_file);
|
||||
|
||||
/* If we were compiled with Xserver >= 1.17 we need to specify
|
||||
* '-listen tcp' as the X server doesn't listen on tcp sockets
|
||||
* by default anymore. In older versions we need to pass
|
||||
* -nolisten tcp to disable listening on tcp sockets.
|
||||
*/
|
||||
-#ifdef HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY
|
||||
- if (allow_remote_connections) {
|
||||
- g_ptr_array_add (arguments, "-listen");
|
||||
- g_ptr_array_add (arguments, "tcp");
|
||||
- }
|
||||
-#else
|
||||
if (!allow_remote_connections) {
|
||||
g_ptr_array_add (arguments, "-nolisten");
|
||||
g_ptr_array_add (arguments, "tcp");
|
||||
}
|
||||
+
|
||||
+#ifdef HAVE_XSERVER_WITH_LISTEN
|
||||
+ if (allow_remote_connections) {
|
||||
+ g_ptr_array_add (arguments, "-listen");
|
||||
+ g_ptr_array_add (arguments, "tcp");
|
||||
+ }
|
||||
#endif
|
||||
|
||||
g_ptr_array_add (arguments, "-background");
|
||||
g_ptr_array_add (arguments, "none");
|
||||
|
||||
g_ptr_array_add (arguments, "-noreset");
|
||||
g_ptr_array_add (arguments, "-keeptty");
|
||||
g_ptr_array_add (arguments, "-novtswitch");
|
||||
|
||||
g_ptr_array_add (arguments, "-verbose");
|
||||
if (state->debug_enabled) {
|
||||
g_ptr_array_add (arguments, "7");
|
||||
} else {
|
||||
g_ptr_array_add (arguments, "3");
|
||||
}
|
||||
|
||||
if (state->debug_enabled) {
|
||||
g_ptr_array_add (arguments, "-core");
|
||||
}
|
||||
g_ptr_array_add (arguments, NULL);
|
||||
|
||||
subprocess = g_subprocess_launcher_spawnv (launcher,
|
||||
(const char * const *) arguments->pdata,
|
||||
&error);
|
||||
g_free (display_fd_string);
|
||||
g_clear_object (&launcher);
|
||||
g_ptr_array_free (arguments, TRUE);
|
||||
|
||||
if (subprocess == NULL) {
|
||||
g_debug ("could not start X server: %s", error->message);
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 06d09659..8328dd97 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -44,61 +44,61 @@ glib_min_version = '2.56.0'
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
|
||||
libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
|
||||
accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
|
||||
xcb_dep = dependency('xcb')
|
||||
keyutils_dep = dependency('libkeyutils', required: false)
|
||||
libselinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||
|
||||
# udev
|
||||
if udev_dir == ''
|
||||
if udev_dep.found()
|
||||
udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
|
||||
else
|
||||
udev_prefix = gdm_prefix / 'lib' / 'udev'
|
||||
endif
|
||||
udev_dir = udev_prefix / 'rules.d'
|
||||
endif
|
||||
|
||||
# X11
|
||||
x_deps = declare_dependency(
|
||||
dependencies: [
|
||||
dependency('x11'),
|
||||
dependency('xau'),
|
||||
],
|
||||
)
|
||||
# Xserver 1.17 & later default to -nolisten and require -listen for remote access
|
||||
xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
|
||||
-xserver_nolisten_default = xserver_deps.found()
|
||||
+xserver_has_listen = xserver_deps.found()
|
||||
find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
|
||||
find_x_server_out = run_command(find_x_server_script).stdout().strip()
|
||||
if find_x_server_out != ''
|
||||
x_bin = find_x_server_out
|
||||
x_bin_path_split = x_bin.split('/')
|
||||
i = 0
|
||||
x_path = '/'
|
||||
foreach dir : x_bin_path_split
|
||||
if i < x_bin_path_split.length() - 1
|
||||
x_path = x_path / dir
|
||||
endif
|
||||
i = i + 1
|
||||
endforeach
|
||||
else
|
||||
# what to do, what to do, this is wrong, but this just sets the
|
||||
# defaults, perhaps this user is cross compiling or some such
|
||||
x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin'
|
||||
x_bin = '/usr/bin/X'
|
||||
endif
|
||||
xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
|
||||
if xdmcp_dep.found() and get_option('tcp-wrappers')
|
||||
libwrap_dep = cc.find_library('libwrap')
|
||||
endif
|
||||
# systemd
|
||||
systemd_dep = dependency('systemd')
|
||||
libsystemd_dep = dependency('libsystemd')
|
||||
if meson.version().version_compare('>= 0.53')
|
||||
systemd_multiseat_x = find_program('systemd-multi-seat-x',
|
||||
required: false,
|
||||
dirs: [
|
||||
@@ -200,61 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir'))
|
||||
conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir'))
|
||||
conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir'))
|
||||
conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir'))
|
||||
conf.set_quoted('LOGDIR', get_option('log-dir'))
|
||||
conf.set_quoted('DMCONFDIR', dmconfdir)
|
||||
conf.set_quoted('GDMCONFDIR', gdmconfdir)
|
||||
conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir)
|
||||
conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir)
|
||||
conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir)
|
||||
conf.set_quoted('GDM_RUN_DIR', gdm_run_dir)
|
||||
conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir'))
|
||||
conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir)
|
||||
conf.set_quoted('GDM_PID_FILE', gdm_pid_file)
|
||||
conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir)
|
||||
conf.set_quoted('LANG_CONFIG_FILE', lang_config_file)
|
||||
conf.set('HAVE_ADT', have_adt)
|
||||
conf.set('HAVE_UTMP_H', have_utmp_header)
|
||||
conf.set('HAVE_UTMPX_H', have_utmpx_header)
|
||||
conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r)
|
||||
conf.set('UTMP', utmp_struct)
|
||||
conf.set('HAVE_GETUTXENT', cc.has_function('getutxent'))
|
||||
conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp'))
|
||||
conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx'))
|
||||
conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil'))
|
||||
conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil'))
|
||||
conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil'))
|
||||
conf.set('HAVE_PAM_SYSLOG', have_pam_syslog)
|
||||
conf.set('HAVE_KEYUTILS', keyutils_dep.found())
|
||||
conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported)
|
||||
conf.set('HAVE_SELINUX', libselinux_dep.found())
|
||||
-conf.set('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default)
|
||||
+conf.set('HAVE_XSERVER_WITH_LISTEN', xserver_has_listen)
|
||||
conf.set('ENABLE_USER_DISPLAY_SERVER', get_option('user-display-server'))
|
||||
conf.set('ENABLE_SYSTEMD_JOURNAL', get_option('systemd-journal'))
|
||||
conf.set('ENABLE_WAYLAND_SUPPORT', get_option('wayland-support'))
|
||||
conf.set('ENABLE_PROFILING', get_option('profiling'))
|
||||
conf.set('GDM_INITIAL_VT', get_option('initial-vt'))
|
||||
conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf)
|
||||
conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf)
|
||||
conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf)
|
||||
conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path'))
|
||||
conf.set_quoted('GDM_USERNAME', get_option('user'))
|
||||
conf.set_quoted('GDM_GROUPNAME', get_option('group'))
|
||||
conf.set('HAVE_LIBXDMCP', xdmcp_dep.found())
|
||||
conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server)
|
||||
conf.set('WITH_PLYMOUTH', plymouth_dep.found())
|
||||
conf.set_quoted('X_SERVER', x_bin)
|
||||
conf.set_quoted('X_PATH', x_path)
|
||||
conf.set('HAVE_UT_UT_HOST', utmp_has_host_field)
|
||||
conf.set('HAVE_UT_UT_PID', utmp_has_pid_field)
|
||||
conf.set('HAVE_UT_UT_ID', utmp_has_id_field)
|
||||
conf.set('HAVE_UT_UT_NAME', utmp_has_name_field)
|
||||
conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field)
|
||||
conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field)
|
||||
conf.set('HAVE_UT_UT_USER', utmp_has_user_field)
|
||||
conf.set('HAVE_UT_UT_TIME', utmp_has_time_field)
|
||||
conf.set('HAVE_UT_UT_TV', utmp_has_tv_field)
|
||||
conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field)
|
||||
conf.set('ENABLE_IPV6', get_option('ipv6'))
|
||||
configure_file(output: 'config.h', configuration: conf)
|
||||
|
||||
# Subdirs
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 84b823187c8e0b23274cd1a93f4e47a2c585c75b Mon Sep 17 00:00:00 2001
|
||||
From 874b26e3674d540df37d7f145df853bcf81e5a26 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 5 Feb 2020 15:20:48 -0500
|
||||
Subject: [PATCH 2/2] gdm-x-session: run session bus on non-seat0 seats
|
||||
Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats
|
||||
|
||||
GNOME doesn't deal very well with multiple sessions
|
||||
running on a multiple seats at the moment.
|
||||
@ -9,14 +9,14 @@ running on a multiple seats at the moment.
|
||||
Until that's fixed, ensure sessions run on auxillary
|
||||
seats get their own session bus.
|
||||
---
|
||||
daemon/gdm-session.c | 17 +++++++++++++----
|
||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||
daemon/gdm-session.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index a8263ba11..55637b378 100644
|
||||
index 418240dc0..77d6b8ff0 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -2846,130 +2846,139 @@ on_start_program_cb (GdmDBusWorker *worker,
|
||||
@@ -2822,119 +2822,128 @@ on_start_program_cb (GdmDBusWorker *worker,
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
return;
|
||||
@ -25,8 +25,8 @@ index a8263ba11..55637b378 100644
|
||||
service_name = conversation->service_name;
|
||||
|
||||
if (worked) {
|
||||
self->priv->session_pid = pid;
|
||||
self->priv->session_conversation = conversation;
|
||||
self->session_pid = pid;
|
||||
self->session_conversation = conversation;
|
||||
|
||||
g_debug ("GdmSession: Emitting 'session-started' signal with pid '%d'", pid);
|
||||
g_signal_emit (self, signals[SESSION_STARTED], 0, service_name, pid);
|
||||
@ -50,9 +50,10 @@ index a8263ba11..55637b378 100644
|
||||
+ gboolean run_separate_bus = FALSE;
|
||||
char *command;
|
||||
char *program;
|
||||
gboolean register_session;
|
||||
|
||||
g_return_if_fail (GDM_IS_SESSION (self));
|
||||
g_return_if_fail (self->priv->session_conversation == NULL);
|
||||
g_return_if_fail (self->session_conversation == NULL);
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
@ -67,7 +68,7 @@ index a8263ba11..55637b378 100644
|
||||
display_mode = gdm_session_get_display_mode (self);
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
is_x11 = g_strcmp0 (self->priv->session_type, "wayland") != 0;
|
||||
is_x11 = g_strcmp0 (self->session_type, "wayland") != 0;
|
||||
#endif
|
||||
|
||||
if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
|
||||
@ -75,18 +76,20 @@ index a8263ba11..55637b378 100644
|
||||
run_launcher = TRUE;
|
||||
}
|
||||
|
||||
+ if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0 && !run_launcher) {
|
||||
register_session = !gdm_session_session_registers (self);
|
||||
|
||||
+ if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
|
||||
+ run_separate_bus = TRUE;
|
||||
+ }
|
||||
+
|
||||
if (self->priv->selected_program == NULL) {
|
||||
if (self->selected_program == NULL) {
|
||||
gboolean run_xsession_script;
|
||||
|
||||
command = get_session_command (self);
|
||||
|
||||
run_xsession_script = !gdm_session_bypasses_xsession (self);
|
||||
|
||||
if (self->priv->display_is_local) {
|
||||
if (self->display_is_local) {
|
||||
gboolean disallow_tcp = TRUE;
|
||||
gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
|
||||
allow_remote_connections = !disallow_tcp;
|
||||
@ -96,70 +99,53 @@ index a8263ba11..55637b378 100644
|
||||
|
||||
if (run_launcher) {
|
||||
if (is_x11) {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s %s\"%s\"",
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
run_xsession_script? "--run-script " : "",
|
||||
allow_remote_connections? "--allow-remote-connections " : "",
|
||||
command);
|
||||
} else {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
command);
|
||||
}
|
||||
} else if (run_xsession_script) {
|
||||
- program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
||||
+ if (run_separate_bus) {
|
||||
+ program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
|
||||
+ } else {
|
||||
+ program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
||||
+ }
|
||||
+ if (run_separate_bus) {
|
||||
+ program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
|
||||
+ } else {
|
||||
+ program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
||||
+ }
|
||||
} else {
|
||||
program = g_strdup (command);
|
||||
}
|
||||
|
||||
g_free (command);
|
||||
} else {
|
||||
/* FIXME:
|
||||
* Always use a separate DBus bus for each greeter session.
|
||||
* Firstly, this means that if we run multiple greeter session
|
||||
* (which we really should not do, but have to currently), then
|
||||
* each one will get its own DBus session bus.
|
||||
* But, we also explicitly do this for seat0, because that way
|
||||
* it cannot make use of systemd to run the GNOME session. This
|
||||
* prevents the session lookup logic from getting confused.
|
||||
* This has a similar effect as passing --builtin to gnome-session.
|
||||
*
|
||||
* We really should not be doing this. But the fix is to use
|
||||
* separate dynamically created users and that requires some
|
||||
* major refactorings.
|
||||
*/
|
||||
if (run_launcher) {
|
||||
if (is_x11) {
|
||||
- program = g_strdup_printf (LIBEXECDIR "/gdm-x-session \"%s\"",
|
||||
- self->priv->selected_program);
|
||||
+ program = g_strdup_printf (LIBEXECDIR "/gdm-x-session \"%s\"",
|
||||
+ self->priv->selected_program);
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
self->selected_program);
|
||||
} else {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
|
||||
self->priv->selected_program);
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
self->selected_program);
|
||||
}
|
||||
} else {
|
||||
- if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0) {
|
||||
+ if (run_separate_bus) {
|
||||
program = g_strdup_printf ("dbus-run-session -- %s",
|
||||
self->priv->selected_program);
|
||||
} else {
|
||||
program = g_strdup (self->priv->selected_program);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_up_session_environment (self);
|
||||
send_environment (self, conversation);
|
||||
|
||||
gdm_dbus_worker_call_start_program (conversation->worker_proxy,
|
||||
program,
|
||||
conversation->worker_cancellable,
|
||||
(GAsyncReadyCallback) on_start_program_cb,
|
||||
conversation);
|
||||
g_free (program);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_all_conversations (GdmSession *self)
|
||||
{
|
||||
stop_all_other_conversations (self, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
do_reset (GdmSession *self)
|
||||
{
|
||||
stop_all_conversations (self);
|
||||
|
||||
--
|
||||
2.21.1
|
||||
2.30.1
|
||||
|
||||
|
131
SOURCES/0002-libgdm-Sort-session-list.patch
Normal file
131
SOURCES/0002-libgdm-Sort-session-list.patch
Normal file
@ -0,0 +1,131 @@
|
||||
From c00daca1579c47f3f62894ff2378c37e6cbebfd3 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 20 Jul 2021 13:36:45 -0400
|
||||
Subject: [PATCH 2/4] libgdm: Sort session list
|
||||
|
||||
Right now the session list comes out in hash table order.
|
||||
|
||||
This commit changes the code to sort by description.
|
||||
---
|
||||
libgdm/gdm-sessions.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
|
||||
index 97ed5ef3..f078e04b 100644
|
||||
--- a/libgdm/gdm-sessions.c
|
||||
+++ b/libgdm/gdm-sessions.c
|
||||
@@ -311,92 +311,111 @@ collect_sessions (void)
|
||||
g_ptr_array_add (wayland_search_array, g_strdup (wayland_search_dirs[i]));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gdm_available_sessions_map == NULL) {
|
||||
gdm_available_sessions_map = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, (GDestroyNotify)gdm_session_file_free);
|
||||
}
|
||||
|
||||
if (!supported_session_types || g_strv_contains ((const char * const *) supported_session_types, "x11")) {
|
||||
for (i = 0; i < xorg_search_array->len; i++) {
|
||||
collect_sessions_from_directory (g_ptr_array_index (xorg_search_array, i));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
#ifdef ENABLE_USER_DISPLAY_SERVER
|
||||
if (!supported_session_types || g_strv_contains ((const char * const *) supported_session_types, "wayland")) {
|
||||
for (i = 0; i < wayland_search_array->len; i++) {
|
||||
collect_sessions_from_directory (g_ptr_array_index (wayland_search_array, i));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_hash_table_foreach_remove (gdm_available_sessions_map,
|
||||
remove_duplicate_sessions,
|
||||
names_seen_before);
|
||||
}
|
||||
|
||||
+static gint
|
||||
+compare_session_ids (gconstpointer a,
|
||||
+ gconstpointer b)
|
||||
+{
|
||||
+ GdmSessionFile *session_a, *session_b;
|
||||
+ session_a = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map, a);
|
||||
+ session_b = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map, b);
|
||||
+
|
||||
+ if (session_a == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (session_b == NULL)
|
||||
+ return 1;
|
||||
+
|
||||
+ return g_strcmp0 (session_a->translated_name, session_b->translated_name);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* gdm_get_session_ids:
|
||||
*
|
||||
* Reads /usr/share/xsessions and other relevant places for possible sessions
|
||||
* to log into and returns the complete list.
|
||||
*
|
||||
* Returns: (transfer full): a %NULL terminated list of session ids
|
||||
*/
|
||||
char **
|
||||
gdm_get_session_ids (void)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
GPtrArray *array;
|
||||
|
||||
if (!gdm_sessions_map_is_initialized) {
|
||||
collect_sessions ();
|
||||
|
||||
gdm_sessions_map_is_initialized = TRUE;
|
||||
}
|
||||
|
||||
array = g_ptr_array_new ();
|
||||
g_hash_table_iter_init (&iter, gdm_available_sessions_map);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||
GdmSessionFile *session;
|
||||
|
||||
session = (GdmSessionFile *) value;
|
||||
|
||||
g_ptr_array_add (array, g_strdup (session->id));
|
||||
}
|
||||
g_ptr_array_add (array, NULL);
|
||||
|
||||
+ g_ptr_array_sort (array, compare_session_ids);
|
||||
+
|
||||
return (char **) g_ptr_array_free (array, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdm_get_session_name_and_description:
|
||||
* @id: an id from gdm_get_session_ids()
|
||||
* @description: (out): optional returned session description
|
||||
*
|
||||
* Takes an xsession id and returns the name and comment about it.
|
||||
*
|
||||
* Returns: The session name if found, or %NULL otherwise
|
||||
*/
|
||||
char *
|
||||
gdm_get_session_name_and_description (const char *id,
|
||||
char **description)
|
||||
{
|
||||
GdmSessionFile *session;
|
||||
char *name;
|
||||
|
||||
if (!gdm_sessions_map_is_initialized) {
|
||||
collect_sessions ();
|
||||
|
||||
gdm_sessions_map_is_initialized = TRUE;
|
||||
}
|
||||
|
||||
session = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map,
|
||||
id);
|
||||
|
||||
if (session == NULL) {
|
||||
return NULL;
|
||||
--
|
||||
2.34.1
|
||||
|
227
SOURCES/0002-manager-Fix-btmp-record-accounting.patch
Normal file
227
SOURCES/0002-manager-Fix-btmp-record-accounting.patch
Normal file
@ -0,0 +1,227 @@
|
||||
From 20725e4c65555178ed64a3cb77ee979ec98998f8 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 19 Oct 2022 14:50:33 -0400
|
||||
Subject: [PATCH 2/2] manager: Fix btmp record accounting
|
||||
|
||||
Before a user logs in they don't have a display.
|
||||
|
||||
btmp records currently need a display though, and they
|
||||
get written when the user can't log in.
|
||||
|
||||
Furthermore, the display from X11 point of view is
|
||||
somewhat archaic. We use wayland by default now.
|
||||
|
||||
In lieu of a display, this commit gives the btmp record
|
||||
the seat id instead.
|
||||
---
|
||||
daemon/gdm-manager.c | 11 +++++++++--
|
||||
daemon/gdm-session-record.c | 8 ++++++--
|
||||
2 files changed, 15 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 4b62b8b1..c70248f3 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -641,113 +641,120 @@ switch_to_compatible_user_session (GdmManager *manager,
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GdmDisplay *
|
||||
get_display_for_user_session (GdmSession *session)
|
||||
{
|
||||
return g_object_get_data (G_OBJECT (session), "gdm-display");
|
||||
}
|
||||
|
||||
static GdmSession *
|
||||
get_user_session_for_display (GdmDisplay *display)
|
||||
{
|
||||
if (display == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return g_object_get_data (G_OBJECT (display), "gdm-user-session");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
add_session_record (GdmManager *manager,
|
||||
GdmSession *session,
|
||||
GPid pid,
|
||||
SessionRecord record)
|
||||
{
|
||||
const char *username;
|
||||
- char *display_name, *hostname, *display_device;
|
||||
+ char *display_name, *hostname, *display_device, *display_seat_id;
|
||||
gboolean recorded = FALSE;
|
||||
|
||||
display_name = NULL;
|
||||
username = NULL;
|
||||
hostname = NULL;
|
||||
display_device = NULL;
|
||||
+ display_seat_id = NULL;
|
||||
|
||||
username = gdm_session_get_username (session);
|
||||
|
||||
if (username == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_object_get (G_OBJECT (session),
|
||||
"display-name", &display_name,
|
||||
"display-hostname", &hostname,
|
||||
"display-device", &display_device,
|
||||
+ "display-seat-id", &display_seat_id,
|
||||
NULL);
|
||||
|
||||
if (display_name == NULL && display_device == NULL) {
|
||||
- goto out;
|
||||
+ if (display_seat_id == NULL)
|
||||
+ goto out;
|
||||
+
|
||||
+ display_name = g_strdup ("login screen");
|
||||
+ display_device = g_strdup (display_seat_id);
|
||||
}
|
||||
|
||||
switch (record) {
|
||||
case SESSION_RECORD_LOGIN:
|
||||
gdm_session_record_login (pid,
|
||||
username,
|
||||
hostname,
|
||||
display_name,
|
||||
display_device);
|
||||
break;
|
||||
case SESSION_RECORD_LOGOUT:
|
||||
gdm_session_record_logout (pid,
|
||||
username,
|
||||
hostname,
|
||||
display_name,
|
||||
display_device);
|
||||
break;
|
||||
case SESSION_RECORD_FAILED:
|
||||
gdm_session_record_failed (pid,
|
||||
username,
|
||||
hostname,
|
||||
display_name,
|
||||
display_device);
|
||||
break;
|
||||
}
|
||||
|
||||
recorded = TRUE;
|
||||
out:
|
||||
g_free (display_name);
|
||||
g_free (hostname);
|
||||
g_free (display_device);
|
||||
+ g_free (display_seat_id);
|
||||
|
||||
return recorded;
|
||||
}
|
||||
|
||||
static GdmSession *
|
||||
find_user_session_for_display (GdmManager *self,
|
||||
GdmDisplay *display)
|
||||
{
|
||||
|
||||
GList *node = self->priv->user_sessions;
|
||||
|
||||
while (node != NULL) {
|
||||
GdmSession *session = node->data;
|
||||
GdmDisplay *candidate_display;
|
||||
GList *next_node = node->next;
|
||||
|
||||
candidate_display = get_display_for_user_session (session);
|
||||
|
||||
if (candidate_display == display)
|
||||
return session;
|
||||
|
||||
node = next_node;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_manager_handle_register_display (GdmDBusManager *manager,
|
||||
GDBusMethodInvocation *invocation,
|
||||
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
|
||||
index 7719d0a8..310323b6 100644
|
||||
--- a/daemon/gdm-session-record.c
|
||||
+++ b/daemon/gdm-session-record.c
|
||||
@@ -125,66 +125,70 @@ record_set_host (UTMP *u,
|
||||
*/
|
||||
if (host_name != NULL
|
||||
&& x11_display_name != NULL
|
||||
&& g_str_has_prefix (x11_display_name, ":")) {
|
||||
hostname = g_strdup_printf ("%s%s", host_name, x11_display_name);
|
||||
} else {
|
||||
hostname = g_strdup (x11_display_name);
|
||||
}
|
||||
|
||||
if (hostname != NULL) {
|
||||
memccpy (u->ut_host, hostname, '\0', sizeof (u->ut_host));
|
||||
g_debug ("using ut_host %.*s", (int) sizeof (u->ut_host), u->ut_host);
|
||||
#ifdef HAVE_UT_UT_SYSLEN
|
||||
u->ut_syslen = MIN (strlen (hostname), sizeof (u->ut_host));
|
||||
#endif
|
||||
g_free (hostname);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
record_set_line (UTMP *u,
|
||||
const char *display_device,
|
||||
const char *x11_display_name)
|
||||
{
|
||||
/*
|
||||
* Set ut_line to the device name associated with this display
|
||||
* but remove the "/dev/" prefix. If no device, then use the
|
||||
* $DISPLAY value.
|
||||
*/
|
||||
- if (display_device != NULL
|
||||
- && g_str_has_prefix (display_device, "/dev/")) {
|
||||
+ if (display_device != NULL && g_str_has_prefix (display_device, "/dev/")) {
|
||||
memccpy (u->ut_line,
|
||||
display_device + strlen ("/dev/"),
|
||||
'\0',
|
||||
sizeof (u->ut_line));
|
||||
+ } else if (display_device != NULL && g_str_has_prefix (display_device, "seat")) {
|
||||
+ memccpy (u->ut_line,
|
||||
+ display_device,
|
||||
+ '\0',
|
||||
+ sizeof (u->ut_line));
|
||||
} else if (x11_display_name != NULL) {
|
||||
memccpy (u->ut_line,
|
||||
x11_display_name,
|
||||
'\0',
|
||||
sizeof (u->ut_line));
|
||||
}
|
||||
|
||||
g_debug ("using ut_line %.*s", (int) sizeof (u->ut_line), u->ut_line);
|
||||
}
|
||||
|
||||
void
|
||||
gdm_session_record_login (GPid session_pid,
|
||||
const char *user_name,
|
||||
const char *host_name,
|
||||
const char *x11_display_name,
|
||||
const char *display_device)
|
||||
{
|
||||
UTMP session_record = { 0 };
|
||||
|
||||
if (x11_display_name == NULL)
|
||||
x11_display_name = display_device;
|
||||
|
||||
record_set_username (&session_record, user_name);
|
||||
|
||||
g_debug ("Writing login record");
|
||||
|
||||
#if defined(HAVE_UT_UT_TYPE)
|
||||
session_record.ut_type = USER_PROCESS;
|
||||
g_debug ("using ut_type USER_PROCESS");
|
||||
#endif
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,119 @@
|
||||
From 9f4b4ef1b5e1458ca67cff235b655060b27e357b Mon Sep 17 00:00:00 2001
|
||||
From: Graham Rogers <graham@rogers.me.uk>
|
||||
Date: Sun, 18 Apr 2021 12:22:14 +0100
|
||||
Subject: [PATCH 2/2] pam_gdm: Use the last cryptsetup password instead of the
|
||||
first
|
||||
|
||||
---
|
||||
pam_gdm/pam_gdm.c | 32 ++++++++++++++++++++++++++------
|
||||
1 file changed, 26 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/pam_gdm/pam_gdm.c b/pam_gdm/pam_gdm.c
|
||||
index 767a6c8c..ef77f161 100644
|
||||
--- a/pam_gdm/pam_gdm.c
|
||||
+++ b/pam_gdm/pam_gdm.c
|
||||
@@ -11,75 +11,95 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
#include <config.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <security/_pam_macros.h>
|
||||
#include <security/pam_ext.h>
|
||||
#include <security/pam_misc.h>
|
||||
#include <security/pam_modules.h>
|
||||
#include <security/pam_modutil.h>
|
||||
|
||||
#ifdef HAVE_KEYUTILS
|
||||
#include <keyutils.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
pam_sm_authenticate (pam_handle_t *pamh,
|
||||
int flags,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
#ifdef HAVE_KEYUTILS
|
||||
- int r;
|
||||
- void *cached_password = NULL;
|
||||
+ long r;
|
||||
+ size_t cached_passwords_length;
|
||||
+ char *cached_passwords = NULL;
|
||||
+ char *last_cached_password = NULL;
|
||||
key_serial_t serial;
|
||||
+ size_t i;
|
||||
|
||||
serial = find_key_by_type_and_desc ("user", "cryptsetup", 0);
|
||||
if (serial == 0)
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
|
||||
- r = keyctl_read_alloc (serial, &cached_password);
|
||||
- if (r < 0 || r != strlen (cached_password))
|
||||
+ r = keyctl_read_alloc (serial, &cached_passwords);
|
||||
+ if (r < 0)
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
+
|
||||
+ cached_passwords_length = r;
|
||||
+
|
||||
+ /*
|
||||
+ Find the last password in the NUL-separated list of passwords.
|
||||
+ Multiple passwords are returned either when the user enters an
|
||||
+ incorrect password or there are multiple encrypted drives.
|
||||
+ In the case of an incorrect password the last one is correct.
|
||||
+ In the case of multiple drives, choosing the last drive is as
|
||||
+ arbitrary a choice as any other, but choosing the last password at
|
||||
+ least supports multiple attempts on the last drive.
|
||||
+ */
|
||||
+ last_cached_password = cached_passwords;
|
||||
+ for (i = 0; i < cached_passwords_length; i++) {
|
||||
+ last_cached_password = cached_passwords + i;
|
||||
+ i += strlen (last_cached_password);
|
||||
+ }
|
||||
|
||||
- r = pam_set_item (pamh, PAM_AUTHTOK, cached_password);
|
||||
+ r = pam_set_item (pamh, PAM_AUTHTOK, last_cached_password);
|
||||
|
||||
- free (cached_password);
|
||||
+ free (cached_passwords);
|
||||
|
||||
if (r < 0)
|
||||
return PAM_AUTH_ERR;
|
||||
else
|
||||
return PAM_SUCCESS;
|
||||
#endif
|
||||
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
}
|
||||
|
||||
int
|
||||
pam_sm_setcred (pam_handle_t *pamh,
|
||||
int flags,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
pam_sm_acct_mgmt (pam_handle_t *pamh,
|
||||
int flags,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
pam_sm_chauthtok (pam_handle_t *pamh,
|
||||
--
|
||||
2.35.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From e625a214d531635db1e48b2dc51ed0e09ef8005b Mon Sep 17 00:00:00 2001
|
||||
From 22b08727980cefd665b8805376710e9244523fe3 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 14 Aug 2018 14:52:41 -0400
|
||||
Subject: [PATCH 2/4] session: support new accountsservice Session and
|
||||
@ -12,15 +12,15 @@ a related "SessionType" property to replace "XSession".
|
||||
|
||||
This commit switches GDM over to use the new properties.
|
||||
---
|
||||
daemon/gdm-session-settings.c | 61 ++++++++++++++++++++++++---
|
||||
daemon/gdm-session-settings.c | 61 ++++++++++++++++++++++--
|
||||
daemon/gdm-session-settings.h | 3 ++
|
||||
daemon/gdm-session-worker.c | 28 +++++++++++++
|
||||
daemon/gdm-session-worker.c | 28 +++++++++++
|
||||
daemon/gdm-session-worker.xml | 3 ++
|
||||
daemon/gdm-session.c | 78 ++++++++++++++++++++++++++---------
|
||||
5 files changed, 148 insertions(+), 25 deletions(-)
|
||||
daemon/gdm-session.c | 87 +++++++++++++++++++++++++----------
|
||||
5 files changed, 153 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
|
||||
index 933f095bc..8463fad32 100644
|
||||
index 484a3b5b..f2b1addd 100644
|
||||
--- a/daemon/gdm-session-settings.c
|
||||
+++ b/daemon/gdm-session-settings.c
|
||||
@@ -12,114 +12,121 @@
|
||||
@ -79,7 +79,9 @@ index 933f095bc..8463fad32 100644
|
||||
PROP_IS_LOADED
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdmSessionSettings, gdm_session_settings, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GdmSessionSettings,
|
||||
gdm_session_settings,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gdm_session_settings_class_init (GdmSessionSettingsClass *settings_class)
|
||||
@ -91,8 +93,6 @@ index 933f095bc..8463fad32 100644
|
||||
object_class->finalize = gdm_session_settings_finalize;
|
||||
|
||||
gdm_session_settings_class_install_properties (settings_class);
|
||||
|
||||
g_type_class_add_private (settings_class, sizeof (GdmSessionSettingsPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -107,7 +107,7 @@ index 933f095bc..8463fad32 100644
|
||||
|
||||
param_spec = g_param_spec_string ("session-name", "Session Name",
|
||||
"The name of the session",
|
||||
NULL, G_PARAM_READWRITE);
|
||||
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (object_class, PROP_SESSION_NAME, param_spec);
|
||||
|
||||
+ param_spec = g_param_spec_string ("session-type", "Session Type",
|
||||
@ -118,11 +118,11 @@ index 933f095bc..8463fad32 100644
|
||||
param_spec = g_param_spec_string ("language-name", "Language Name",
|
||||
"The name of the language",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (object_class, PROP_LANGUAGE_NAME, param_spec);
|
||||
|
||||
param_spec = g_param_spec_boolean ("is-loaded", NULL, NULL,
|
||||
FALSE, G_PARAM_READABLE);
|
||||
FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (object_class, PROP_IS_LOADED, param_spec);
|
||||
}
|
||||
|
||||
@ -305,14 +305,14 @@ index 933f095bc..8463fad32 100644
|
||||
|
||||
- session_name = act_user_get_x_session (settings->priv->user);
|
||||
- g_debug ("GdmSessionSettings: saved session is %s", session_name);
|
||||
+ /* if the user doesn't have saved state, they don't have any settings worth reading */
|
||||
+ if (!act_user_get_saved (settings->priv->user))
|
||||
+ goto out;
|
||||
|
||||
- if (session_name != NULL) {
|
||||
+
|
||||
+
|
||||
+
|
||||
+ session_type = act_user_get_session_type (settings->priv->user);
|
||||
+ session_name = act_user_get_session (settings->priv->user);
|
||||
|
||||
- if (session_name != NULL) {
|
||||
+
|
||||
+ g_debug ("GdmSessionSettings: saved session is %s (type %s)", session_name, session_type);
|
||||
+
|
||||
+ if (session_type != NULL && session_type[0] != '\0') {
|
||||
@ -409,7 +409,7 @@ index 933f095bc..8463fad32 100644
|
||||
return TRUE;
|
||||
}
|
||||
diff --git a/daemon/gdm-session-settings.h b/daemon/gdm-session-settings.h
|
||||
index 20946bff1..db38ffc72 100644
|
||||
index 20946bff..db38ffc7 100644
|
||||
--- a/daemon/gdm-session-settings.h
|
||||
+++ b/daemon/gdm-session-settings.h
|
||||
@@ -33,37 +33,40 @@ G_BEGIN_DECLS
|
||||
@ -454,10 +454,10 @@ index 20946bff1..db38ffc72 100644
|
||||
G_END_DECLS
|
||||
#endif /* GDM_SESSION_SETTINGS_H */
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index e79073996..ae86d28ac 100644
|
||||
index 438348df..9cff53a5 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -2539,60 +2539,74 @@ gdm_session_worker_handle_set_language_name (GdmDBusWorker *object,
|
||||
@@ -2662,60 +2662,74 @@ gdm_session_worker_handle_set_language_name (GdmDBusWorker *object,
|
||||
gdm_dbus_worker_complete_set_language_name (object, invocation);
|
||||
return TRUE;
|
||||
}
|
||||
@ -532,7 +532,7 @@ index e79073996..ae86d28ac 100644
|
||||
static void
|
||||
do_authenticate (GdmSessionWorker *worker)
|
||||
{
|
||||
@@ -3001,158 +3015,172 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
@@ -3125,158 +3139,172 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
} else if (g_strcmp0 (key, "x11-authority-file") == 0) {
|
||||
worker->priv->x11_authority_file = g_variant_dup_string (value, NULL);
|
||||
} else if (g_strcmp0 (key, "console") == 0) {
|
||||
@ -706,7 +706,7 @@ index e79073996..ae86d28ac 100644
|
||||
const char *log_file)
|
||||
{
|
||||
diff --git a/daemon/gdm-session-worker.xml b/daemon/gdm-session-worker.xml
|
||||
index 4280fe095..a215779c8 100644
|
||||
index 4280fe09..a215779c 100644
|
||||
--- a/daemon/gdm-session-worker.xml
|
||||
+++ b/daemon/gdm-session-worker.xml
|
||||
@@ -51,40 +51,43 @@
|
||||
@ -754,12 +754,10 @@ index 4280fe095..a215779c8 100644
|
||||
</interface>
|
||||
</node>
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index 19d26c92e..e6640aac7 100644
|
||||
index 72afe7b2..f4d0bef9 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -59,60 +59,61 @@
|
||||
|
||||
#define GDM_SESSION_DBUS_ERROR_CANCEL "org.gnome.DisplayManager.Session.Error.Cancel"
|
||||
@@ -61,60 +61,61 @@
|
||||
#define GDM_SESSION_DBUS_OBJECT_PATH "/org/gnome/DisplayManager/Session"
|
||||
|
||||
#define GDM_WORKER_DBUS_PATH "/org/gnome/DisplayManager/Worker"
|
||||
@ -782,8 +780,10 @@ index 19d26c92e..e6640aac7 100644
|
||||
GPid reauth_pid_of_caller;
|
||||
} GdmSessionConversation;
|
||||
|
||||
struct _GdmSessionPrivate
|
||||
struct _GdmSession
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
/* per open scope */
|
||||
char *selected_program;
|
||||
char *selected_session;
|
||||
@ -819,25 +819,14 @@ index 19d26c92e..e6640aac7 100644
|
||||
char *display_name;
|
||||
char *display_hostname;
|
||||
char *display_device;
|
||||
@@ -312,295 +313,310 @@ on_establish_credentials_cb (GdmDBusWorker *proxy,
|
||||
return;
|
||||
|
||||
self = g_object_ref (conversation->session);
|
||||
service_name = g_strdup (conversation->service_name);
|
||||
|
||||
if (worked) {
|
||||
if (self->priv->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_verification_complete (self->priv->user_verifier_interface,
|
||||
service_name);
|
||||
g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
||||
}
|
||||
|
||||
switch (self->priv->verification_mode) {
|
||||
case GDM_SESSION_VERIFICATION_MODE_LOGIN:
|
||||
case GDM_SESSION_VERIFICATION_MODE_CHOOSER:
|
||||
gdm_session_open_session (self, service_name);
|
||||
break;
|
||||
@@ -328,309 +329,325 @@ on_establish_credentials_cb (GdmDBusWorker *proxy,
|
||||
case GDM_SESSION_VERIFICATION_MODE_REAUTHENTICATE:
|
||||
if (self->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_verification_complete (self->user_verifier_interface,
|
||||
service_name);
|
||||
g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -849,6 +838,17 @@ index 19d26c92e..e6640aac7 100644
|
||||
g_object_unref (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
supports_session_type (GdmSession *self,
|
||||
const char *session_type)
|
||||
{
|
||||
if (session_type == NULL)
|
||||
return TRUE;
|
||||
|
||||
return g_strv_contains ((const char * const *) self->supported_session_types,
|
||||
session_type);
|
||||
}
|
||||
|
||||
static char **
|
||||
-get_system_session_dirs (GdmSession *self)
|
||||
+get_system_session_dirs (GdmSession *self,
|
||||
@ -856,6 +856,8 @@ index 19d26c92e..e6640aac7 100644
|
||||
{
|
||||
GArray *search_array = NULL;
|
||||
char **search_dirs;
|
||||
int i, j;
|
||||
const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
||||
|
||||
static const char *x_search_dirs[] = {
|
||||
"/etc/X11/sessions/",
|
||||
@ -868,20 +870,33 @@ index 19d26c92e..e6640aac7 100644
|
||||
|
||||
search_array = g_array_new (TRUE, TRUE, sizeof (char *));
|
||||
|
||||
- g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
+ if (type == NULL || strcmp (type, "x11") == 0)
|
||||
+ g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
for (j = 0; self->supported_session_types[j] != NULL; j++) {
|
||||
const char *supported_type = self->supported_session_types[j];
|
||||
|
||||
- if (g_str_equal (supported_type, "x11")) {
|
||||
+ if (g_str_equal (supported_type, "x11") ||
|
||||
+ (type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
- if (!self->priv->ignore_wayland) {
|
||||
+ if ((!self->priv->ignore_wayland && type == NULL) || g_strcmp0 (type, "wayland") == 0) {
|
||||
#ifdef ENABLE_USER_DISPLAY_SERVER
|
||||
g_array_prepend_val (search_array, wayland_search_dir);
|
||||
#else
|
||||
g_array_append_val (search_array, wayland_search_dir);
|
||||
- if (g_str_equal (supported_type, "wayland")) {
|
||||
+ if (g_str_equal (supported_type, "wayland") ||
|
||||
+ (type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_val (search_array, wayland_search_dir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
search_dirs = g_strdupv ((char **) search_array->data);
|
||||
|
||||
@ -961,9 +976,9 @@ index 19d26c92e..e6640aac7 100644
|
||||
*command = NULL;
|
||||
}
|
||||
|
||||
+ if (self->priv->ignore_wayland && g_strcmp0 (type, "wayland") == 0) {
|
||||
+ g_debug ("GdmSession: ignoring wayland session command request for file '%s'",
|
||||
+ file);
|
||||
+ if (!supports_session_type (self, type)) {
|
||||
+ g_debug ("GdmSession: ignoring %s session command request for file '%s'",
|
||||
+ type, file);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
@ -1046,11 +1061,11 @@ index 19d26c92e..e6640aac7 100644
|
||||
{
|
||||
const char *default_language;
|
||||
|
||||
if (self->priv->saved_language != NULL) {
|
||||
return self->priv->saved_language;
|
||||
if (self->saved_language != NULL) {
|
||||
return self->saved_language;
|
||||
}
|
||||
|
||||
default_language = g_hash_table_lookup (self->priv->environment,
|
||||
default_language = g_hash_table_lookup (self->environment,
|
||||
"LANG");
|
||||
|
||||
if (default_language != NULL) {
|
||||
@ -1069,10 +1084,10 @@ index 19d26c92e..e6640aac7 100644
|
||||
GSequence *sessions;
|
||||
GSequenceIter *session;
|
||||
|
||||
if (self->priv->fallback_session_name != NULL) {
|
||||
if (self->fallback_session_name != NULL) {
|
||||
/* verify that the cached version still exists */
|
||||
- if (get_session_command_for_name (self, self->priv->fallback_session_name, NULL)) {
|
||||
+ if (get_session_command_for_name (self, self->priv->fallback_session_name, NULL, NULL)) {
|
||||
- if (get_session_command_for_name (self, self->fallback_session_name, NULL)) {
|
||||
+ if (get_session_command_for_name (self, self->fallback_session_name, NULL, NULL)) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -1080,8 +1095,8 @@ index 19d26c92e..e6640aac7 100644
|
||||
name = g_strdup ("gnome");
|
||||
- if (get_session_command_for_name (self, name, NULL)) {
|
||||
+ if (get_session_command_for_name (self, name, NULL, NULL)) {
|
||||
g_free (self->priv->fallback_session_name);
|
||||
self->priv->fallback_session_name = name;
|
||||
g_free (self->fallback_session_name);
|
||||
self->fallback_session_name = name;
|
||||
goto out;
|
||||
}
|
||||
g_free (name);
|
||||
@ -1136,27 +1151,24 @@ index 19d26c92e..e6640aac7 100644
|
||||
session = g_sequence_iter_next (session);
|
||||
} while (!g_sequence_iter_is_end (session));
|
||||
|
||||
g_free (self->priv->fallback_session_name);
|
||||
self->priv->fallback_session_name = g_strdup (name);
|
||||
g_free (self->fallback_session_name);
|
||||
self->fallback_session_name = g_strdup (name);
|
||||
|
||||
g_sequence_free (sessions);
|
||||
|
||||
out:
|
||||
return self->priv->fallback_session_name;
|
||||
@@ -616,60 +632,63 @@ get_default_session_name (GdmSession *self)
|
||||
return get_fallback_session_name (self);
|
||||
}
|
||||
|
||||
return self->fallback_session_name;
|
||||
@@ -649,60 +666,63 @@ get_default_session_name (GdmSession *self)
|
||||
static void
|
||||
gdm_session_defaults_changed (GdmSession *self)
|
||||
{
|
||||
|
||||
update_session_type (self);
|
||||
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_language_name_changed (self->priv->greeter_interface,
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_language_name_changed (self->greeter_interface,
|
||||
get_default_language_name (self));
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->priv->greeter_interface,
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
|
||||
get_default_session_name (self));
|
||||
}
|
||||
}
|
||||
@ -1166,19 +1178,22 @@ index 19d26c92e..e6640aac7 100644
|
||||
const char *text)
|
||||
{
|
||||
|
||||
g_debug ("GdmSession: Setting user: '%s'", text);
|
||||
g_debug ("GdmSession: selecting user '%s' for session '%s' (%p)",
|
||||
text,
|
||||
gdm_session_get_session_id (self),
|
||||
self);
|
||||
|
||||
g_free (self->priv->selected_user);
|
||||
self->priv->selected_user = g_strdup (text);
|
||||
g_free (self->selected_user);
|
||||
self->selected_user = g_strdup (text);
|
||||
|
||||
g_free (self->priv->saved_session);
|
||||
self->priv->saved_session = NULL;
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = NULL;
|
||||
|
||||
+ g_free (self->priv->saved_session_type);
|
||||
+ self->priv->saved_session_type = NULL;
|
||||
+ g_free (self->saved_session_type);
|
||||
+ self->saved_session_type = NULL;
|
||||
+
|
||||
g_free (self->priv->saved_language);
|
||||
self->priv->saved_language = NULL;
|
||||
g_free (self->saved_language);
|
||||
self->saved_language = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1207,7 +1222,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
|
||||
static void
|
||||
set_pending_query (GdmSessionConversation *conversation,
|
||||
@@ -936,80 +955,91 @@ worker_on_reauthenticated (GdmDBusWorker *worker,
|
||||
@@ -969,85 +989,96 @@ worker_on_reauthenticated (GdmDBusWorker *worker,
|
||||
GdmSession *self = conversation->session;
|
||||
g_debug ("GdmSession: Emitting 'reauthenticated' signal ");
|
||||
g_signal_emit (self, signals[REAUTHENTICATED], 0, service_name);
|
||||
@ -1221,11 +1236,11 @@ index 19d26c92e..e6640aac7 100644
|
||||
GdmSession *self = conversation->session;
|
||||
|
||||
if (strlen (language_name) > 0) {
|
||||
g_free (self->priv->saved_language);
|
||||
self->priv->saved_language = g_strdup (language_name);
|
||||
g_free (self->saved_language);
|
||||
self->saved_language = g_strdup (language_name);
|
||||
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_language_name_changed (self->priv->greeter_interface,
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_language_name_changed (self->greeter_interface,
|
||||
language_name);
|
||||
}
|
||||
}
|
||||
@ -1239,24 +1254,29 @@ index 19d26c92e..e6640aac7 100644
|
||||
GdmSession *self = conversation->session;
|
||||
|
||||
- if (! get_session_command_for_name (self, session_name, NULL)) {
|
||||
+ if (! get_session_command_for_name (self, session_name, self->priv->saved_session_type, NULL)) {
|
||||
+ if (! get_session_command_for_name (self, session_name, self->saved_session_type, NULL)) {
|
||||
/* ignore sessions that don't exist */
|
||||
g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);
|
||||
g_free (self->priv->saved_session);
|
||||
self->priv->saved_session = NULL;
|
||||
} else if (strcmp (session_name,
|
||||
get_default_session_name (self)) != 0) {
|
||||
g_free (self->priv->saved_session);
|
||||
self->priv->saved_session = g_strdup (session_name);
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = NULL;
|
||||
update_session_type (self);
|
||||
} else {
|
||||
if (strcmp (session_name,
|
||||
get_default_session_name (self)) != 0) {
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = g_strdup (session_name);
|
||||
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->priv->greeter_interface,
|
||||
session_name);
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
|
||||
session_name);
|
||||
}
|
||||
}
|
||||
if (self->saved_session_type != NULL)
|
||||
set_session_type (self, self->saved_session_type);
|
||||
else
|
||||
update_session_type (self);
|
||||
}
|
||||
|
||||
update_session_type (self);
|
||||
|
||||
}
|
||||
|
||||
+static void
|
||||
@ -1266,8 +1286,8 @@ index 19d26c92e..e6640aac7 100644
|
||||
+{
|
||||
+ GdmSession *self = conversation->session;
|
||||
+
|
||||
+ g_free (self->priv->saved_session_type);
|
||||
+ self->priv->saved_session_type = g_strdup (session_type);
|
||||
+ g_free (self->saved_session_type);
|
||||
+ self->saved_session_type = g_strdup (session_type);
|
||||
+}
|
||||
+
|
||||
static GdmSessionConversation *
|
||||
@ -1277,7 +1297,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
g_hash_table_iter_init (&iter, self->priv->conversations);
|
||||
g_hash_table_iter_init (&iter, self->conversations);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
@ -1300,7 +1320,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
uid_t connecting_user;
|
||||
|
||||
connecting_user = g_credentials_get_unix_user (credentials, NULL);
|
||||
@@ -1089,60 +1119,63 @@ register_worker (GdmDBusWorkerManager *worker_manager_interface,
|
||||
@@ -1127,60 +1158,63 @@ register_worker (GdmDBusWorkerManager *worker_manager_interface,
|
||||
g_dbus_method_invocation_return_value (invocation, NULL);
|
||||
|
||||
conversation->worker_proxy = gdm_dbus_worker_proxy_new_sync (connection,
|
||||
@ -1344,8 +1364,8 @@ index 19d26c92e..e6640aac7 100644
|
||||
g_debug ("GdmSession: Emitting conversation-started signal");
|
||||
g_signal_emit (self, signals[CONVERSATION_STARTED], 0, conversation->service_name);
|
||||
|
||||
if (self->priv->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_conversation_started (self->priv->user_verifier_interface,
|
||||
if (self->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_conversation_started (self->user_verifier_interface,
|
||||
conversation->service_name);
|
||||
}
|
||||
|
||||
@ -1364,9 +1384,9 @@ index 19d26c92e..e6640aac7 100644
|
||||
g_debug ("GdmSession: Conversation started");
|
||||
|
||||
return TRUE;
|
||||
@@ -1804,60 +1837,63 @@ static void
|
||||
free_conversation (GdmSessionConversation *conversation)
|
||||
{
|
||||
@@ -1923,60 +1957,63 @@ free_conversation (GdmSessionConversation *conversation)
|
||||
close_conversation (conversation);
|
||||
|
||||
if (conversation->job != NULL) {
|
||||
g_warning ("Freeing conversation '%s' with active job", conversation->service_name);
|
||||
}
|
||||
@ -1428,7 +1448,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
error = NULL;
|
||||
if (!g_file_get_contents (config_file, &contents, &length, &error)) {
|
||||
g_debug ("Failed to parse '%s': %s",
|
||||
@@ -2412,83 +2448,83 @@ gdm_session_send_environment (GdmSession *self,
|
||||
@@ -2535,83 +2572,83 @@ gdm_session_send_environment (GdmSession *self,
|
||||
g_return_if_fail (GDM_IS_SESSION (self));
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
@ -1442,8 +1462,8 @@ index 19d26c92e..e6640aac7 100644
|
||||
{
|
||||
/* FIXME: test the session names before we use them? */
|
||||
|
||||
if (self->priv->selected_session != NULL) {
|
||||
return self->priv->selected_session;
|
||||
if (self->selected_session != NULL) {
|
||||
return self->selected_session;
|
||||
}
|
||||
|
||||
return get_default_session_name (self);
|
||||
@ -1476,7 +1496,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
GKeyFile *keyfile;
|
||||
gchar *desktop_names = NULL;
|
||||
|
||||
if (self->priv->selected_program != NULL) {
|
||||
if (self->selected_program != NULL) {
|
||||
return g_strdup ("GNOME-Greeter:GNOME");
|
||||
}
|
||||
|
||||
@ -1509,13 +1529,12 @@ index 19d26c92e..e6640aac7 100644
|
||||
g_return_if_fail (key != NULL);
|
||||
g_return_if_fail (value != NULL);
|
||||
|
||||
g_hash_table_replace (self->priv->environment,
|
||||
g_hash_table_replace (self->environment,
|
||||
g_strdup (key),
|
||||
g_strdup (value));
|
||||
}
|
||||
|
||||
@@ -3008,115 +3044,117 @@ gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
|
||||
@@ -3181,148 +3218,150 @@ gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
@ -1545,11 +1564,16 @@ index 19d26c92e..e6640aac7 100644
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
- key_file = load_key_file_for_file (self, filename, &full_path);
|
||||
+ key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
|
||||
if (supports_session_type (self, "wayland")) {
|
||||
- key_file = load_key_file_for_file (self, filename, &full_path);
|
||||
+ key_file = load_key_file_for_file (self, filename, NULL, &full_path);
|
||||
|
||||
if (key_file == NULL) {
|
||||
goto out;
|
||||
- if (key_file == NULL) {
|
||||
- goto out;
|
||||
- }
|
||||
+ if (key_file == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
@ -1558,7 +1582,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
|
||||
out:
|
||||
g_clear_pointer (&key_file, (GDestroyNotify) g_key_file_free);
|
||||
g_clear_pointer (&key_file, g_key_file_free);
|
||||
g_free (filename);
|
||||
return is_wayland_session;
|
||||
}
|
||||
@ -1571,7 +1595,7 @@ index 19d26c92e..e6640aac7 100644
|
||||
- gboolean is_wayland_session;
|
||||
+ gboolean is_wayland_session = FALSE;
|
||||
+
|
||||
+ if (!self->priv->ignore_wayland)
|
||||
+ if (supports_session_type (self, "wayland"))
|
||||
+ is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
|
||||
- is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
@ -1583,6 +1607,39 @@ index 19d26c92e..e6640aac7 100644
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_session_registers (GdmSession *self)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GKeyFile) key_file = NULL;
|
||||
gboolean session_registers = FALSE;
|
||||
g_autofree char *filename = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
- key_file = load_key_file_for_file (self, filename, NULL);
|
||||
+ key_file = load_key_file_for_file (self, filename, NULL, NULL);
|
||||
|
||||
session_registers = g_key_file_get_boolean (key_file,
|
||||
G_KEY_FILE_DESKTOP_GROUP,
|
||||
"X-GDM-SessionRegisters",
|
||||
&error);
|
||||
if (!session_registers &&
|
||||
error != NULL &&
|
||||
!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
|
||||
g_warning ("GdmSession: Couldn't read session file '%s'", filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_debug ("GdmSession: '%s' %s self", filename,
|
||||
session_registers ? "registers" : "does not register");
|
||||
|
||||
return session_registers;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_bypasses_xsession (GdmSession *self)
|
||||
{
|
||||
@ -1632,10 +1689,10 @@ index 19d26c92e..e6640aac7 100644
|
||||
gdm_session_get_display_mode (GdmSession *self)
|
||||
{
|
||||
g_debug ("GdmSession: type %s, program? %s, seat %s",
|
||||
self->priv->session_type,
|
||||
self->priv->is_program_session? "yes" : "no",
|
||||
self->priv->display_seat_id);
|
||||
self->session_type,
|
||||
self->is_program_session? "yes" : "no",
|
||||
self->display_seat_id);
|
||||
|
||||
--
|
||||
2.17.1
|
||||
2.33.1
|
||||
|
||||
|
@ -1,922 +0,0 @@
|
||||
From 4db5bf628396a7191f2392e7d09ab9bbd7c2b533 Mon Sep 17 00:00:00 2001
|
||||
From: Xiaoguang Wang <xwang@suse.com>
|
||||
Date: Thu, 16 May 2019 13:26:16 +0800
|
||||
Subject: [PATCH 2/3] session-worker: kill user sessions when stop gdm service
|
||||
|
||||
At the moment the session worker exits as soon as it gets SIGTERM.
|
||||
That means it may fail to stop the user session (which only happens
|
||||
in the orderly shutdown path).
|
||||
|
||||
This commit sets up a SIGTERM handler that integrates with and
|
||||
quits the main loop after the session is started.
|
||||
|
||||
It still retains the _exit-on-SIGTERM behavior before the session
|
||||
is started, to ensure a stuck pam module doesn't prevent the
|
||||
process from dying.
|
||||
|
||||
Some small changes to commit by Ray Strode.
|
||||
|
||||
Closes #400
|
||||
---
|
||||
daemon/gdm-session-worker.c | 39 +++++++++++++++++++++++++++---------
|
||||
daemon/session-worker-main.c | 33 ++++++++++++++++++++++++++++++
|
||||
2 files changed, 63 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index f6935ab1d..aa288ac8e 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -159,60 +159,61 @@ struct GdmSessionWorkerPrivate
|
||||
guint32 display_is_initial : 1;
|
||||
guint state_change_idle_id;
|
||||
GdmSessionDisplayMode display_mode;
|
||||
|
||||
char *server_address;
|
||||
GDBusConnection *connection;
|
||||
GdmDBusWorkerManager *manager;
|
||||
|
||||
GHashTable *reauthentication_requests;
|
||||
|
||||
GdmSessionAuditor *auditor;
|
||||
GdmSessionSettings *user_settings;
|
||||
|
||||
GDBusMethodInvocation *pending_invocation;
|
||||
};
|
||||
|
||||
#ifdef SUPPORTS_PAM_EXTENSIONS
|
||||
static char gdm_pam_extension_environment_block[_POSIX_ARG_MAX];
|
||||
|
||||
static const char * const
|
||||
gdm_supported_pam_extensions[] = {
|
||||
GDM_PAM_EXTENSION_CHOICE_LIST,
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_SERVER_ADDRESS,
|
||||
PROP_IS_REAUTH_SESSION,
|
||||
+ PROP_STATE,
|
||||
};
|
||||
|
||||
static void gdm_session_worker_class_init (GdmSessionWorkerClass *klass);
|
||||
static void gdm_session_worker_init (GdmSessionWorker *session_worker);
|
||||
static void gdm_session_worker_finalize (GObject *object);
|
||||
|
||||
static void gdm_session_worker_set_environment_variable (GdmSessionWorker *worker,
|
||||
const char *key,
|
||||
const char *value);
|
||||
|
||||
static void queue_state_change (GdmSessionWorker *worker);
|
||||
|
||||
static void worker_interface_init (GdmDBusWorkerIface *iface);
|
||||
|
||||
|
||||
typedef int (* GdmSessionWorkerPamNewMessagesFunc) (int,
|
||||
const struct pam_message **,
|
||||
struct pam_response **,
|
||||
gpointer);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdmSessionWorker,
|
||||
gdm_session_worker,
|
||||
GDM_DBUS_TYPE_WORKER_SKELETON,
|
||||
G_IMPLEMENT_INTERFACE (GDM_DBUS_TYPE_WORKER,
|
||||
worker_interface_init))
|
||||
|
||||
/* adapted from glib script_execute */
|
||||
static void
|
||||
script_execute (const gchar *file,
|
||||
char **argv,
|
||||
@@ -971,100 +972,111 @@ jump_to_vt (GdmSessionWorker *worker,
|
||||
|
||||
g_debug ("GdmSessionWorker: first setting graphics mode to prevent flicker");
|
||||
if (ioctl (fd, KDSETMODE, KD_GRAPHICS) < 0) {
|
||||
g_debug ("GdmSessionWorker: couldn't set graphics mode: %m");
|
||||
}
|
||||
|
||||
/* It's possible that the current VT was left in a broken
|
||||
* combination of states (KD_GRAPHICS with VT_AUTO), that
|
||||
* can't be switched away from. This call makes sure things
|
||||
* are set in a way that VT_ACTIVATE should work and
|
||||
* VT_WAITACTIVE shouldn't hang.
|
||||
*/
|
||||
fix_terminal_vt_mode (worker, active_vt_tty_fd);
|
||||
} else {
|
||||
fd = active_vt_tty_fd;
|
||||
}
|
||||
|
||||
handle_terminal_vt_switches (worker, fd);
|
||||
|
||||
if (ioctl (fd, VT_ACTIVATE, vt_number) < 0) {
|
||||
g_debug ("GdmSessionWorker: couldn't initiate jump to VT %d: %m",
|
||||
vt_number);
|
||||
} else if (ioctl (fd, VT_WAITACTIVE, vt_number) < 0) {
|
||||
g_debug ("GdmSessionWorker: couldn't finalize jump to VT %d: %m",
|
||||
vt_number);
|
||||
}
|
||||
|
||||
close (active_vt_tty_fd);
|
||||
}
|
||||
|
||||
+static void
|
||||
+gdm_session_worker_set_state (GdmSessionWorker *worker,
|
||||
+ GdmSessionWorkerState state)
|
||||
+{
|
||||
+ if (worker->priv->state == state)
|
||||
+ return;
|
||||
+
|
||||
+ worker->priv->state = state;
|
||||
+ g_object_notify (G_OBJECT (worker), "state");
|
||||
+}
|
||||
+
|
||||
static void
|
||||
gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
|
||||
int status)
|
||||
{
|
||||
g_debug ("GdmSessionWorker: uninitializing PAM");
|
||||
|
||||
if (worker->priv->pam_handle == NULL)
|
||||
return;
|
||||
|
||||
gdm_session_worker_get_username (worker, NULL);
|
||||
|
||||
if (worker->priv->state >= GDM_SESSION_WORKER_STATE_SESSION_OPENED) {
|
||||
pam_close_session (worker->priv->pam_handle, 0);
|
||||
gdm_session_auditor_report_logout (worker->priv->auditor);
|
||||
} else {
|
||||
gdm_session_auditor_report_login_failure (worker->priv->auditor,
|
||||
status,
|
||||
pam_strerror (worker->priv->pam_handle, status));
|
||||
}
|
||||
|
||||
if (worker->priv->state >= GDM_SESSION_WORKER_STATE_ACCREDITED) {
|
||||
pam_setcred (worker->priv->pam_handle, PAM_DELETE_CRED);
|
||||
}
|
||||
|
||||
pam_end (worker->priv->pam_handle, status);
|
||||
worker->priv->pam_handle = NULL;
|
||||
|
||||
gdm_session_worker_stop_auditor (worker);
|
||||
|
||||
if (g_strcmp0 (worker->priv->display_seat_id, "seat0") == 0) {
|
||||
if (worker->priv->login_vt != worker->priv->session_vt) {
|
||||
jump_to_vt (worker, worker->priv->login_vt);
|
||||
}
|
||||
}
|
||||
|
||||
worker->priv->login_vt = 0;
|
||||
worker->priv->session_vt = 0;
|
||||
|
||||
g_debug ("GdmSessionWorker: state NONE");
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_NONE;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_NONE);
|
||||
}
|
||||
|
||||
static char *
|
||||
_get_tty_for_pam (const char *x11_display_name,
|
||||
const char *display_device)
|
||||
{
|
||||
#ifdef __sun
|
||||
return g_strdup (display_device);
|
||||
#else
|
||||
return g_strdup (x11_display_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PAM_XAUTHDATA
|
||||
static struct pam_xauth_data *
|
||||
_get_xauth_for_pam (const char *x11_authority_file)
|
||||
{
|
||||
FILE *fh;
|
||||
Xauth *auth = NULL;
|
||||
struct pam_xauth_data *retval = NULL;
|
||||
gsize len = sizeof (*retval) + 1;
|
||||
|
||||
fh = fopen (x11_authority_file, "r");
|
||||
if (fh) {
|
||||
auth = XauReadAuth (fh);
|
||||
fclose (fh);
|
||||
}
|
||||
if (auth) {
|
||||
len += auth->name_length + auth->data_length;
|
||||
retval = g_malloc0 (len);
|
||||
@@ -1173,61 +1185,61 @@ gdm_session_worker_initialize_pam (GdmSessionWorker *worker,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* set RHOST */
|
||||
if (hostname != NULL && hostname[0] != '\0') {
|
||||
error_code = pam_set_item (worker->priv->pam_handle, PAM_RHOST, hostname);
|
||||
g_debug ("error informing authentication system of user's hostname %s: %s",
|
||||
hostname,
|
||||
pam_strerror (worker->priv->pam_handle, error_code));
|
||||
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_AUTHENTICATING,
|
||||
"%s", "");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* set seat ID */
|
||||
if (seat_id != NULL && seat_id[0] != '\0') {
|
||||
gdm_session_worker_set_environment_variable (worker, "XDG_SEAT", seat_id);
|
||||
}
|
||||
|
||||
if (strcmp (service, "gdm-launch-environment") == 0) {
|
||||
gdm_session_worker_set_environment_variable (worker, "XDG_SESSION_CLASS", "greeter");
|
||||
}
|
||||
|
||||
g_debug ("GdmSessionWorker: state SETUP_COMPLETE");
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_SETUP_COMPLETE;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_SETUP_COMPLETE);
|
||||
|
||||
/* Temporarily set PAM_TTY with the currently active VT (login screen)
|
||||
PAM_TTY will be reset with the users VT right before the user session is opened */
|
||||
ensure_login_vt (worker);
|
||||
g_snprintf (tty_string, 256, "/dev/tty%d", worker->priv->login_vt);
|
||||
pam_set_item (worker->priv->pam_handle, PAM_TTY, tty_string);
|
||||
if (!display_is_local)
|
||||
worker->priv->password_is_required = TRUE;
|
||||
|
||||
out:
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
gdm_session_worker_uninitialize_pam (worker, error_code);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_worker_authenticate_user (GdmSessionWorker *worker,
|
||||
gboolean password_is_required,
|
||||
GError **error)
|
||||
{
|
||||
int error_code;
|
||||
int authentication_flags;
|
||||
|
||||
g_debug ("GdmSessionWorker: authenticating user %s", worker->priv->username);
|
||||
|
||||
authentication_flags = 0;
|
||||
|
||||
@@ -1238,61 +1250,61 @@ gdm_session_worker_authenticate_user (GdmSessionWorker *worker,
|
||||
/* blocking call, does the actual conversation */
|
||||
error_code = pam_authenticate (worker->priv->pam_handle, authentication_flags);
|
||||
|
||||
if (error_code == PAM_AUTHINFO_UNAVAIL) {
|
||||
g_debug ("GdmSessionWorker: authentication service unavailable");
|
||||
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_SERVICE_UNAVAILABLE,
|
||||
"%s", "");
|
||||
goto out;
|
||||
} else if (error_code != PAM_SUCCESS) {
|
||||
g_debug ("GdmSessionWorker: authentication returned %d: %s", error_code, pam_strerror (worker->priv->pam_handle, error_code));
|
||||
|
||||
/*
|
||||
* Do not display a different message for user unknown versus
|
||||
* a failed password for a valid user.
|
||||
*/
|
||||
if (error_code == PAM_USER_UNKNOWN) {
|
||||
error_code = PAM_AUTH_ERR;
|
||||
}
|
||||
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_AUTHENTICATING,
|
||||
"%s", get_friendly_error_message (error_code));
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_debug ("GdmSessionWorker: state AUTHENTICATED");
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_AUTHENTICATED;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_AUTHENTICATED);
|
||||
|
||||
out:
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
gdm_session_worker_uninitialize_pam (worker, error_code);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_worker_authorize_user (GdmSessionWorker *worker,
|
||||
gboolean password_is_required,
|
||||
GError **error)
|
||||
{
|
||||
int error_code;
|
||||
int authentication_flags;
|
||||
|
||||
g_debug ("GdmSessionWorker: determining if authenticated user (password required:%d) is authorized to session",
|
||||
password_is_required);
|
||||
|
||||
authentication_flags = 0;
|
||||
|
||||
if (password_is_required) {
|
||||
authentication_flags |= PAM_DISALLOW_NULL_AUTHTOK;
|
||||
}
|
||||
|
||||
/* check that the account isn't disabled or expired
|
||||
*/
|
||||
error_code = pam_acct_mgmt (worker->priv->pam_handle, authentication_flags);
|
||||
@@ -1303,61 +1315,61 @@ gdm_session_worker_authorize_user (GdmSessionWorker *worker,
|
||||
g_debug ("GdmSessionWorker: authenticated user requires new auth token");
|
||||
error_code = pam_chauthtok (worker->priv->pam_handle, PAM_CHANGE_EXPIRED_AUTHTOK);
|
||||
|
||||
gdm_session_worker_get_username (worker, NULL);
|
||||
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
gdm_session_auditor_report_password_change_failure (worker->priv->auditor);
|
||||
} else {
|
||||
gdm_session_auditor_report_password_changed (worker->priv->auditor);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the user is reauthenticating, then authorization isn't required to
|
||||
* proceed, the user is already logged in after all.
|
||||
*/
|
||||
if (worker->priv->is_reauth_session) {
|
||||
error_code = PAM_SUCCESS;
|
||||
}
|
||||
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
g_debug ("GdmSessionWorker: user is not authorized to log in: %s",
|
||||
pam_strerror (worker->priv->pam_handle, error_code));
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_AUTHORIZING,
|
||||
"%s", get_friendly_error_message (error_code));
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_debug ("GdmSessionWorker: state AUTHORIZED");
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_AUTHORIZED;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_AUTHORIZED);
|
||||
|
||||
out:
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
gdm_session_worker_uninitialize_pam (worker, error_code);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_set_environment_variable (GdmSessionWorker *worker,
|
||||
const char *key,
|
||||
const char *value)
|
||||
{
|
||||
int error_code;
|
||||
char *environment_entry;
|
||||
|
||||
if (value != NULL) {
|
||||
environment_entry = g_strdup_printf ("%s=%s", key, value);
|
||||
} else {
|
||||
/* empty value means "remove from environment" */
|
||||
environment_entry = g_strdup (key);
|
||||
}
|
||||
|
||||
error_code = pam_putenv (worker->priv->pam_handle,
|
||||
environment_entry);
|
||||
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
g_warning ("cannot put %s in pam environment: %s\n",
|
||||
@@ -1716,61 +1728,61 @@ gdm_session_worker_accredit_user (GdmSessionWorker *worker,
|
||||
|
||||
/* If the user is reauthenticating and they've made it this far, then there
|
||||
* is no reason we should lock them out of their session. They've already
|
||||
* proved they are they same person who logged in, and that's all we care
|
||||
* about.
|
||||
*/
|
||||
if (worker->priv->is_reauth_session) {
|
||||
error_code = PAM_SUCCESS;
|
||||
}
|
||||
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_GIVING_CREDENTIALS,
|
||||
"%s",
|
||||
pam_strerror (worker->priv->pam_handle, error_code));
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
out:
|
||||
g_free (home);
|
||||
g_free (shell);
|
||||
if (ret) {
|
||||
g_debug ("GdmSessionWorker: state ACCREDITED");
|
||||
ret = TRUE;
|
||||
|
||||
gdm_session_worker_get_username (worker, NULL);
|
||||
gdm_session_auditor_report_user_accredited (worker->priv->auditor);
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_ACCREDITED;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_ACCREDITED);
|
||||
} else {
|
||||
gdm_session_worker_uninitialize_pam (worker, error_code);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const char * const *
|
||||
gdm_session_worker_get_environment (GdmSessionWorker *worker)
|
||||
{
|
||||
return (const char * const *) pam_getenvlist (worker->priv->pam_handle);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
run_script (GdmSessionWorker *worker,
|
||||
const char *dir)
|
||||
{
|
||||
/* scripts are for non-program sessions only */
|
||||
if (worker->priv->is_program_session) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return gdm_run_script (dir,
|
||||
worker->priv->username,
|
||||
worker->priv->x11_display_name,
|
||||
worker->priv->display_is_local? NULL : worker->priv->hostname,
|
||||
worker->priv->x11_authority_file);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2145,61 +2157,61 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
|
||||
(char **)
|
||||
environment,
|
||||
TRUE);
|
||||
|
||||
gdm_log_init ();
|
||||
g_debug ("GdmSessionWorker: child '%s' could not be started: %s",
|
||||
worker->priv->arguments[0],
|
||||
g_strerror (errno));
|
||||
|
||||
_exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (worker->priv->session_tty_fd > 0) {
|
||||
close (worker->priv->session_tty_fd);
|
||||
worker->priv->session_tty_fd = -1;
|
||||
}
|
||||
|
||||
/* If we end up execing again, make sure we don't use the executable context set up
|
||||
* by pam_selinux durin pam_open_session
|
||||
*/
|
||||
#ifdef HAVE_SELINUX
|
||||
setexeccon (NULL);
|
||||
#endif
|
||||
|
||||
worker->priv->child_pid = session_pid;
|
||||
|
||||
g_debug ("GdmSessionWorker: session opened creating reply...");
|
||||
g_assert (sizeof (GPid) <= sizeof (int));
|
||||
|
||||
g_debug ("GdmSessionWorker: state SESSION_STARTED");
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_SESSION_STARTED;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_SESSION_STARTED);
|
||||
|
||||
gdm_session_worker_watch_child (worker);
|
||||
|
||||
out:
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
gdm_session_worker_uninitialize_pam (worker, error_code);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
set_up_for_new_vt (GdmSessionWorker *worker)
|
||||
{
|
||||
int fd;
|
||||
char vt_string[256], tty_string[256];
|
||||
int session_vt = 0;
|
||||
|
||||
fd = open ("/dev/tty0", O_RDWR | O_NOCTTY);
|
||||
|
||||
if (fd < 0) {
|
||||
g_debug ("GdmSessionWorker: couldn't open VT master: %m");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (worker->priv->display_is_initial) {
|
||||
session_vt = atoi (GDM_INITIAL_VT);
|
||||
} else {
|
||||
if (ioctl(fd, VT_OPENQRY, &session_vt) < 0) {
|
||||
@@ -2368,61 +2380,61 @@ gdm_session_worker_open_session (GdmSessionWorker *worker,
|
||||
break;
|
||||
case GDM_SESSION_DISPLAY_MODE_NEW_VT:
|
||||
case GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED:
|
||||
if (!set_up_for_new_vt (worker)) {
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_OPENING_SESSION,
|
||||
"Unable to open VT");
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
|
||||
if (worker->priv->is_program_session) {
|
||||
flags |= PAM_SILENT;
|
||||
}
|
||||
|
||||
error_code = pam_open_session (worker->priv->pam_handle, flags);
|
||||
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
g_set_error (error,
|
||||
GDM_SESSION_WORKER_ERROR,
|
||||
GDM_SESSION_WORKER_ERROR_OPENING_SESSION,
|
||||
"%s", pam_strerror (worker->priv->pam_handle, error_code));
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_debug ("GdmSessionWorker: state SESSION_OPENED");
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_SESSION_OPENED;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_SESSION_OPENED);
|
||||
|
||||
session_id = gdm_session_worker_get_environment_variable (worker, "XDG_SESSION_ID");
|
||||
|
||||
if (session_id != NULL) {
|
||||
g_free (worker->priv->session_id);
|
||||
worker->priv->session_id = session_id;
|
||||
}
|
||||
|
||||
out:
|
||||
if (error_code != PAM_SUCCESS) {
|
||||
gdm_session_worker_uninitialize_pam (worker, error_code);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdm_session_worker_get_username (worker, NULL);
|
||||
gdm_session_auditor_report_login (worker->priv->auditor);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_set_server_address (GdmSessionWorker *worker,
|
||||
const char *address)
|
||||
{
|
||||
g_free (worker->priv->server_address);
|
||||
worker->priv->server_address = g_strdup (address);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_set_is_reauth_session (GdmSessionWorker *worker,
|
||||
@@ -2445,61 +2457,61 @@ gdm_session_worker_set_property (GObject *object,
|
||||
case PROP_SERVER_ADDRESS:
|
||||
gdm_session_worker_set_server_address (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_IS_REAUTH_SESSION:
|
||||
gdm_session_worker_set_is_reauth_session (self, g_value_get_boolean (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdmSessionWorker *self;
|
||||
|
||||
self = GDM_SESSION_WORKER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_SERVER_ADDRESS:
|
||||
g_value_set_string (value, self->priv->server_address);
|
||||
break;
|
||||
case PROP_IS_REAUTH_SESSION:
|
||||
g_value_set_boolean (value, self->priv->is_reauth_session);
|
||||
break;
|
||||
case PROP_STATE:
|
||||
- g_value_set_int (value, self->priv->state);
|
||||
+ g_value_set_enum (value, self->priv->state);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_worker_handle_set_environment_variable (GdmDBusWorker *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *key,
|
||||
const char *value)
|
||||
{
|
||||
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
|
||||
gdm_session_worker_set_environment_variable (worker, key, value);
|
||||
gdm_dbus_worker_complete_set_environment_variable (object, invocation);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_worker_handle_set_session_name (GdmDBusWorker *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *session_name)
|
||||
{
|
||||
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
|
||||
g_debug ("GdmSessionWorker: session name set to %s", session_name);
|
||||
if (worker->priv->user_settings != NULL)
|
||||
gdm_session_settings_set_session_name (worker->priv->user_settings,
|
||||
session_name);
|
||||
gdm_dbus_worker_complete_set_session_name (object, invocation);
|
||||
@@ -2646,61 +2658,61 @@ do_authorize (GdmSessionWorker *worker)
|
||||
g_dbus_method_invocation_take_error (worker->priv->pending_invocation, error);
|
||||
}
|
||||
worker->priv->pending_invocation = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
do_accredit (GdmSessionWorker *worker)
|
||||
{
|
||||
GError *error;
|
||||
gboolean res;
|
||||
|
||||
/* get kerberos tickets, setup group lists, etc
|
||||
*/
|
||||
error = NULL;
|
||||
res = gdm_session_worker_accredit_user (worker, &error);
|
||||
|
||||
if (res) {
|
||||
gdm_dbus_worker_complete_establish_credentials (GDM_DBUS_WORKER (worker), worker->priv->pending_invocation);
|
||||
} else {
|
||||
g_dbus_method_invocation_take_error (worker->priv->pending_invocation, error);
|
||||
}
|
||||
worker->priv->pending_invocation = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
save_account_details_now (GdmSessionWorker *worker)
|
||||
{
|
||||
g_assert (worker->priv->state == GDM_SESSION_WORKER_STATE_ACCREDITED);
|
||||
|
||||
g_debug ("GdmSessionWorker: saving account details for user %s", worker->priv->username);
|
||||
- worker->priv->state = GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED;
|
||||
+ gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED);
|
||||
if (worker->priv->user_settings != NULL) {
|
||||
if (!gdm_session_settings_save (worker->priv->user_settings,
|
||||
worker->priv->username)) {
|
||||
g_warning ("could not save session and language settings");
|
||||
}
|
||||
}
|
||||
queue_state_change (worker);
|
||||
}
|
||||
|
||||
static void
|
||||
on_settings_is_loaded_changed (GdmSessionSettings *user_settings,
|
||||
GParamSpec *pspec,
|
||||
GdmSessionWorker *worker)
|
||||
{
|
||||
if (!gdm_session_settings_is_loaded (worker->priv->user_settings)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* These signal handlers should be disconnected after the loading,
|
||||
* so that gdm_session_settings_set_* APIs don't cause the emitting
|
||||
* of Saved*NameRead D-Bus signals any more.
|
||||
*/
|
||||
g_signal_handlers_disconnect_by_func (worker->priv->user_settings,
|
||||
G_CALLBACK (on_saved_session_name_read),
|
||||
worker);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (worker->priv->user_settings,
|
||||
G_CALLBACK (on_saved_language_name_read),
|
||||
worker);
|
||||
|
||||
@@ -3461,60 +3473,69 @@ worker_interface_init (GdmDBusWorkerIface *interface)
|
||||
interface->handle_start_reauthentication = gdm_session_worker_handle_start_reauthentication;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_class_init (GdmSessionWorkerClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->get_property = gdm_session_worker_get_property;
|
||||
object_class->set_property = gdm_session_worker_set_property;
|
||||
object_class->constructor = gdm_session_worker_constructor;
|
||||
object_class->finalize = gdm_session_worker_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GdmSessionWorkerPrivate));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_SERVER_ADDRESS,
|
||||
g_param_spec_string ("server-address",
|
||||
"server address",
|
||||
"server address",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_IS_REAUTH_SESSION,
|
||||
g_param_spec_boolean ("is-reauth-session",
|
||||
"is reauth session",
|
||||
"is reauth session",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
||||
+
|
||||
+ g_object_class_install_property (object_class,
|
||||
+ PROP_STATE,
|
||||
+ g_param_spec_enum ("state",
|
||||
+ "state",
|
||||
+ "state",
|
||||
+ GDM_TYPE_SESSION_WORKER_STATE,
|
||||
+ GDM_SESSION_WORKER_STATE_NONE,
|
||||
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
static void
|
||||
reauthentication_request_free (ReauthenticationRequest *request)
|
||||
{
|
||||
|
||||
g_signal_handlers_disconnect_by_func (request->session,
|
||||
G_CALLBACK (on_reauthentication_client_connected),
|
||||
request);
|
||||
g_signal_handlers_disconnect_by_func (request->session,
|
||||
G_CALLBACK (on_reauthentication_client_disconnected),
|
||||
request);
|
||||
g_signal_handlers_disconnect_by_func (request->session,
|
||||
G_CALLBACK (on_reauthentication_cancelled),
|
||||
request);
|
||||
g_signal_handlers_disconnect_by_func (request->session,
|
||||
G_CALLBACK (on_reauthentication_conversation_started),
|
||||
request);
|
||||
g_signal_handlers_disconnect_by_func (request->session,
|
||||
G_CALLBACK (on_reauthentication_conversation_stopped),
|
||||
request);
|
||||
g_signal_handlers_disconnect_by_func (request->session,
|
||||
G_CALLBACK (on_reauthentication_verification_complete),
|
||||
request);
|
||||
g_clear_object (&request->session);
|
||||
g_slice_free (ReauthenticationRequest, request);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_session_worker_init (GdmSessionWorker *worker)
|
||||
diff --git a/daemon/session-worker-main.c b/daemon/session-worker-main.c
|
||||
index 4a3a8ebbe..d96844d2d 100644
|
||||
--- a/daemon/session-worker-main.c
|
||||
+++ b/daemon/session-worker-main.c
|
||||
@@ -37,104 +37,137 @@
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "gdm-common.h"
|
||||
#include "gdm-log.h"
|
||||
#include "gdm-session-worker.h"
|
||||
|
||||
#include "gdm-settings.h"
|
||||
#include "gdm-settings-direct.h"
|
||||
#include "gdm-settings-keys.h"
|
||||
|
||||
static GdmSettings *settings = NULL;
|
||||
|
||||
static gboolean
|
||||
on_sigusr1_cb (gpointer user_data)
|
||||
{
|
||||
g_debug ("Got USR1 signal");
|
||||
|
||||
gdm_log_toggle_debug ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_debug_set (void)
|
||||
{
|
||||
gboolean debug;
|
||||
gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
|
||||
return debug;
|
||||
}
|
||||
|
||||
+static gboolean
|
||||
+on_shutdown_signal_cb (gpointer user_data)
|
||||
+{
|
||||
+ GMainLoop *mainloop = user_data;
|
||||
+
|
||||
+ g_main_loop_quit (mainloop);
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+on_state_changed (GdmSessionWorker *worker,
|
||||
+ GParamSpec *pspec,
|
||||
+ GMainLoop *main_loop)
|
||||
+{
|
||||
+ GdmSessionWorkerState state;
|
||||
+
|
||||
+ g_object_get (G_OBJECT (worker), "state", &state, NULL);
|
||||
+
|
||||
+ if (state != GDM_SESSION_WORKER_STATE_SESSION_STARTED)
|
||||
+ return;
|
||||
+
|
||||
+ g_unix_signal_add (SIGTERM, on_shutdown_signal_cb, main_loop);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
on_sigterm_cb (int signal_number)
|
||||
{
|
||||
_exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GMainLoop *main_loop;
|
||||
GOptionContext *context;
|
||||
GdmSessionWorker *worker;
|
||||
const char *address;
|
||||
gboolean is_for_reauth;
|
||||
static GOptionEntry entries [] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
signal (SIGTERM, on_sigterm_cb);
|
||||
|
||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
/* Translators: worker is a helper process that does the work
|
||||
of starting up a session */
|
||||
context = g_option_context_new (_("GNOME Display Manager Session Worker"));
|
||||
g_option_context_add_main_entries (context, entries, NULL);
|
||||
|
||||
g_option_context_parse (context, &argc, &argv, NULL);
|
||||
g_option_context_free (context);
|
||||
|
||||
gdm_log_init ();
|
||||
|
||||
settings = gdm_settings_new ();
|
||||
if (settings == NULL) {
|
||||
g_warning ("Unable to initialize settings");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (! gdm_settings_direct_init (settings, DATADIR "/gdm/gdm.schemas", "/")) {
|
||||
g_warning ("Unable to initialize settings");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
gdm_log_set_debug (is_debug_set ());
|
||||
|
||||
address = g_getenv ("GDM_SESSION_DBUS_ADDRESS");
|
||||
if (address == NULL) {
|
||||
g_warning ("GDM_SESSION_DBUS_ADDRESS not set");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
is_for_reauth = g_getenv ("GDM_SESSION_FOR_REAUTH") != NULL;
|
||||
|
||||
worker = gdm_session_worker_new (address, is_for_reauth);
|
||||
|
||||
main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
+ g_signal_connect (G_OBJECT (worker),
|
||||
+ "notify::state",
|
||||
+ G_CALLBACK (on_state_changed),
|
||||
+ main_loop);
|
||||
+
|
||||
g_unix_signal_add (SIGUSR1, on_sigusr1_cb, NULL);
|
||||
|
||||
g_main_loop_run (main_loop);
|
||||
|
||||
if (worker != NULL) {
|
||||
+ g_signal_handlers_disconnect_by_func (worker,
|
||||
+ G_CALLBACK (on_state_changed),
|
||||
+ main_loop);
|
||||
g_object_unref (worker);
|
||||
}
|
||||
|
||||
g_main_loop_unref (main_loop);
|
||||
|
||||
g_debug ("Worker finished");
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.18.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From f12d17a6f4f76ba037e9126113684777a070a8f4 Mon Sep 17 00:00:00 2001
|
||||
From de95917e0e9d142703a86f94961ef9fd4151739d Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 20 Aug 2018 14:30:59 -0400
|
||||
Subject: [PATCH 3/4] daemon: save os-release in accountsservice
|
||||
@ -8,167 +8,31 @@ when they logged in (to detect upgrades).
|
||||
|
||||
This commit saves that information in accountsservice.
|
||||
---
|
||||
daemon/Makefile.am | 10 ++
|
||||
daemon/gdm-session-settings.c | 98 +++++++++++++++++++
|
||||
data/Makefile.am | 2 +
|
||||
.../com.redhat.AccountsServiceUser.System.xml | 10 ++
|
||||
4 files changed, 120 insertions(+)
|
||||
create mode 100644 data/com.redhat.AccountsServiceUser.System.xml
|
||||
daemon/gdm-session-settings.c | 98 +++++++++++++++++++
|
||||
daemon/gdm-session.c | 4 +-
|
||||
daemon/meson.build | 8 ++
|
||||
4 files changed, 118 insertions(+), 2 deletions(-)
|
||||
create mode 100644 daemon/com.redhat.AccountsServiceUser.System.xml
|
||||
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index 3b1b15122..b77c9276e 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -14,137 +14,147 @@ AM_CPPFLAGS = \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\" \
|
||||
-DLOCALSTATEDIR=\"$(localstatedir)\" \
|
||||
-DLOGDIR=\"$(logdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\" \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
|
||||
-DGDM_RUN_DIR=\"$(GDM_RUN_DIR)\" \
|
||||
-DGDM_XAUTH_DIR=\"$(GDM_XAUTH_DIR)\" \
|
||||
-DGDM_SCREENSHOT_DIR=\"$(GDM_SCREENSHOT_DIR)\" \
|
||||
-DGDM_CACHE_DIR=\""$(localstatedir)/cache/gdm"\" \
|
||||
-DGDM_SESSION_DEFAULT_PATH=\"$(GDM_SESSION_DEFAULT_PATH)\" \
|
||||
$(DISABLE_DEPRECATED_CFLAGS) \
|
||||
$(DAEMON_CFLAGS) \
|
||||
$(XLIB_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(SYSTEMD_CFLAGS) \
|
||||
$(JOURNALD_CFLAGS) \
|
||||
$(LIBSELINUX_CFLAGS) \
|
||||
-DLANG_CONFIG_FILE=\"$(LANG_CONFIG_FILE)\" \
|
||||
$(NULL)
|
||||
|
||||
BUILT_SOURCES = \
|
||||
gdm-display-glue.h \
|
||||
gdm-manager-glue.h \
|
||||
gdm-local-display-glue.h \
|
||||
gdm-local-display-factory-glue.h \
|
||||
gdm-session-glue.h \
|
||||
gdm-session-worker-glue.h \
|
||||
gdm-session-enum-types.h \
|
||||
+ com.redhat.AccountsServiceUser.System.h \
|
||||
$(NULL)
|
||||
|
||||
gdm-session-enum-types.h: gdm-session-enum-types.h.in gdm-session.h
|
||||
$(AM_V_GEN) glib-mkenums --template $^ > $@
|
||||
|
||||
gdm-session-enum-types.c: gdm-session-enum-types.c.in gdm-session.h
|
||||
$(AM_V_GEN) glib-mkenums --template $^ > $@
|
||||
|
||||
gdm-display-glue.c gdm-display-glue.h: gdm-display.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-display-glue \
|
||||
$(srcdir)/gdm-display.xml
|
||||
|
||||
gdm-local-display-glue.c gdm-local-display-glue.h: gdm-local-display.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-local-display-glue \
|
||||
$(srcdir)/gdm-local-display.xml
|
||||
|
||||
gdm-local-display-factory-glue.c gdm-local-display-factory-glue.h : gdm-local-display-factory.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-local-display-factory-glue \
|
||||
$(srcdir)/gdm-local-display-factory.xml
|
||||
|
||||
gdm-manager-glue.c gdm-manager-glue.h : gdm-manager.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-manager-glue \
|
||||
$(srcdir)/gdm-manager.xml
|
||||
|
||||
gdm-session-glue.c gdm-session-glue.h : gdm-session.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-session-glue \
|
||||
$(srcdir)/gdm-session.xml
|
||||
|
||||
gdm-session-worker-glue.c gdm-session-worker-glue.h : gdm-session-worker.xml Makefile.am
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
--c-namespace=GdmDBus \
|
||||
--interface-prefix=org.gnome.DisplayManager \
|
||||
--generate-c-code=gdm-session-worker-glue \
|
||||
$(srcdir)/gdm-session-worker.xml
|
||||
|
||||
+com.redhat.AccountsServiceUser.System.c com.redhat.AccountsServiceUser.System.h: $(top_srcdir)/data/com.redhat.AccountsServiceUser.System.xml Makefile.am
|
||||
+ $(AM_V_GEN)gdbus-codegen \
|
||||
+ --c-namespace=Gdm \
|
||||
+ --interface-prefix=com.redhat \
|
||||
+ --generate-c-code=com.redhat.AccountsServiceUser.System \
|
||||
+ $(top_srcdir)/data/com.redhat.AccountsServiceUser.System.xml
|
||||
diff --git a/daemon/com.redhat.AccountsServiceUser.System.xml b/daemon/com.redhat.AccountsServiceUser.System.xml
|
||||
new file mode 100644
|
||||
index 00000000..67f5f302
|
||||
--- /dev/null
|
||||
+++ b/daemon/com.redhat.AccountsServiceUser.System.xml
|
||||
@@ -0,0 +1,10 @@
|
||||
+<node>
|
||||
+ <interface name="com.redhat.AccountsServiceUser.System">
|
||||
+
|
||||
noinst_PROGRAMS = \
|
||||
test-session-client \
|
||||
$(NULL)
|
||||
|
||||
test_session_client_SOURCES = \
|
||||
test-session-client.c \
|
||||
$(NULL)
|
||||
|
||||
nodist_test_session_client_SOURCES = \
|
||||
gdm-session-glue.h \
|
||||
gdm-session-glue.c \
|
||||
gdm-manager-glue.h \
|
||||
gdm-manager-glue.c \
|
||||
$(NULL)
|
||||
|
||||
test_session_client_LDADD = \
|
||||
$(DAEMON_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
libexec_PROGRAMS = \
|
||||
gdm-session-worker \
|
||||
gdm-wayland-session \
|
||||
gdm-x-session \
|
||||
$(NULL)
|
||||
|
||||
gdm_session_worker_SOURCES = \
|
||||
session-worker-main.c \
|
||||
+ com.redhat.AccountsServiceUser.System.h \
|
||||
+ com.redhat.AccountsServiceUser.System.c \
|
||||
gdm-session.c \
|
||||
gdm-session.h \
|
||||
gdm-session-settings.h \
|
||||
gdm-session-settings.c \
|
||||
gdm-session-auditor.h \
|
||||
gdm-session-auditor.c \
|
||||
gdm-session-record.c \
|
||||
gdm-session-record.h \
|
||||
gdm-session-worker.h \
|
||||
gdm-session-worker.c \
|
||||
gdm-session-worker-job.c \
|
||||
gdm-session-worker-common.c \
|
||||
gdm-session-worker-common.h \
|
||||
gdm-dbus-util.c \
|
||||
gdm-dbus-util.h \
|
||||
$(NULL)
|
||||
|
||||
if SUPPORTS_PAM_EXTENSIONS
|
||||
gdm_session_worker_SOURCES += $(top_srcdir)/pam-extensions/gdm-pam-extensions.h
|
||||
endif
|
||||
|
||||
nodist_gdm_session_worker_SOURCES = \
|
||||
gdm-session-glue.h \
|
||||
gdm-session-glue.c \
|
||||
gdm-session-worker-glue.c \
|
||||
gdm-session-worker-glue.h \
|
||||
gdm-session-enum-types.c \
|
||||
gdm-session-enum-types.h \
|
||||
$(NULL)
|
||||
|
||||
+ <annotation name="org.freedesktop.Accounts.VendorExtension" value="true"/>
|
||||
+
|
||||
+ <property name="id" type="s" access="readwrite"/>
|
||||
+ <property name="version-id" type="s" access="readwrite"/>
|
||||
+
|
||||
+ </interface>
|
||||
+</node>
|
||||
diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
|
||||
index 8463fad32..921e4d501 100644
|
||||
index f2b1addd..a4b7f1a6 100644
|
||||
--- a/daemon/gdm-session-settings.c
|
||||
+++ b/daemon/gdm-session-settings.c
|
||||
@@ -1,70 +1,77 @@
|
||||
@ -245,15 +109,15 @@ index 8463fad32..921e4d501 100644
|
||||
PROP_IS_LOADED
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdmSessionSettings, gdm_session_settings, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GdmSessionSettings,
|
||||
gdm_session_settings,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gdm_session_settings_class_init (GdmSessionSettingsClass *settings_class)
|
||||
@@ -107,60 +114,62 @@ gdm_session_settings_class_install_properties (GdmSessionSettingsClass *settings
|
||||
g_object_class_install_property (object_class, PROP_LANGUAGE_NAME, param_spec);
|
||||
|
||||
param_spec = g_param_spec_boolean ("is-loaded", NULL, NULL,
|
||||
FALSE, G_PARAM_READABLE);
|
||||
FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (object_class, PROP_IS_LOADED, param_spec);
|
||||
}
|
||||
|
||||
@ -369,9 +233,9 @@ index 8463fad32..921e4d501 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* if the user doesn't have saved state, they don't have any settings worth reading */
|
||||
if (!act_user_get_saved (settings->priv->user))
|
||||
goto out;
|
||||
|
||||
|
||||
|
||||
|
||||
session_type = act_user_get_session_type (settings->priv->user);
|
||||
session_name = act_user_get_session (settings->priv->user);
|
||||
@ -536,89 +400,212 @@ index 8463fad32..921e4d501 100644
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
diff --git a/data/Makefile.am b/data/Makefile.am
|
||||
index 192dfa052..d69021985 100644
|
||||
--- a/data/Makefile.am
|
||||
+++ b/data/Makefile.am
|
||||
@@ -8,60 +8,62 @@ SUBDIRS = \
|
||||
$(NULL)
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index f4d0bef9..d1e2c301 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -351,72 +351,72 @@ supports_session_type (GdmSession *self,
|
||||
if (session_type == NULL)
|
||||
return TRUE;
|
||||
|
||||
initdir = $(gdmconfdir)/Init
|
||||
postdir = $(gdmconfdir)/PostSession
|
||||
predir = $(gdmconfdir)/PreSession
|
||||
postlogindir = $(gdmconfdir)/PostLogin
|
||||
workingdir = $(GDM_WORKING_DIR)
|
||||
xauthdir = $(GDM_XAUTH_DIR)
|
||||
screenshotdir = $(GDM_SCREENSHOT_DIR)
|
||||
cachedir = $(localstatedir)/cache/gdm
|
||||
return g_strv_contains ((const char * const *) self->supported_session_types,
|
||||
session_type);
|
||||
}
|
||||
|
||||
Init: $(srcdir)/Init.in
|
||||
sed -e 's,[@]X_PATH[@],$(X_PATH),g' \
|
||||
<$(srcdir)/Init.in >Init
|
||||
static char **
|
||||
get_system_session_dirs (GdmSession *self,
|
||||
const char *type)
|
||||
{
|
||||
GArray *search_array = NULL;
|
||||
char **search_dirs;
|
||||
int i, j;
|
||||
const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
||||
|
||||
PreSession: $(srcdir)/PreSession.in
|
||||
sed -e 's,[@]X_PATH[@],$(X_PATH),g' \
|
||||
<$(srcdir)/PreSession.in >PreSession
|
||||
PostSession: $(srcdir)/PostSession.in
|
||||
sed -e 's,[@]X_PATH[@],$(X_PATH),g' \
|
||||
<$(srcdir)/PostSession.in >PostSession
|
||||
static const char *x_search_dirs[] = {
|
||||
"/etc/X11/sessions/",
|
||||
DMCONFDIR "/Sessions/",
|
||||
DATADIR "/gdm/BuiltInSessions/",
|
||||
DATADIR "/xsessions/",
|
||||
};
|
||||
|
||||
gdm.conf-custom: $(srcdir)/gdm.conf-custom.in
|
||||
sed -e 's,[@]GDM_DEFAULTS_CONF[@],$(GDM_DEFAULTS_CONF),g' \
|
||||
<$(srcdir)/gdm.conf-custom.in >gdm.conf-custom
|
||||
static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
|
||||
|
||||
dbusconfdir = $(DBUS_SYS_DIR)
|
||||
dbusconf_in_files = gdm.conf.in
|
||||
dbusconf_DATA = $(dbusconf_in_files:.conf.in=.conf)
|
||||
search_array = g_array_new (TRUE, TRUE, sizeof (char *));
|
||||
|
||||
+EXTRA_DIST += com.redhat.AccountsServiceUser.System.xml
|
||||
for (j = 0; self->supported_session_types[j] != NULL; j++) {
|
||||
const char *supported_type = self->supported_session_types[j];
|
||||
|
||||
- if (g_str_equal (supported_type, "x11") ||
|
||||
+ if (g_str_equal (supported_type, "x11") &&
|
||||
(type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
- if (g_str_equal (supported_type, "wayland") ||
|
||||
+ if (g_str_equal (supported_type, "wayland") &&
|
||||
(type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_val (search_array, wayland_search_dir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
search_dirs = g_strdupv ((char **) search_array->data);
|
||||
|
||||
g_array_free (search_array, TRUE);
|
||||
|
||||
return search_dirs;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_prog_in_path (const char *prog)
|
||||
{
|
||||
char *f;
|
||||
gboolean ret;
|
||||
|
||||
f = g_find_program_in_path (prog);
|
||||
ret = (f != NULL);
|
||||
g_free (f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/daemon/meson.build b/daemon/meson.build
|
||||
index 2e61b644..71c65039 100644
|
||||
--- a/daemon/meson.build
|
||||
+++ b/daemon/meson.build
|
||||
@@ -15,114 +15,122 @@ local_display_dbus_gen = gnome.gdbus_codegen('gdm-local-display-glue',
|
||||
'gdm-local-display.xml',
|
||||
namespace: 'GdmDBus',
|
||||
interface_prefix: 'org.gnome.DisplayManager',
|
||||
autocleanup: 'all',
|
||||
)
|
||||
local_display_factory_dbus_gen = gnome.gdbus_codegen('gdm-local-display-factory-glue',
|
||||
'gdm-local-display-factory.xml',
|
||||
namespace: 'GdmDBus',
|
||||
interface_prefix: 'org.gnome.DisplayManager',
|
||||
autocleanup: 'all',
|
||||
)
|
||||
manager_dbus_gen = gnome.gdbus_codegen('gdm-manager-glue',
|
||||
'gdm-manager.xml',
|
||||
namespace: 'GdmDBus',
|
||||
interface_prefix: 'org.gnome.DisplayManager',
|
||||
autocleanup: 'all',
|
||||
)
|
||||
session_dbus_gen = gnome.gdbus_codegen('gdm-session-glue',
|
||||
'gdm-session.xml',
|
||||
namespace: 'GdmDBus',
|
||||
interface_prefix: 'org.gnome.DisplayManager',
|
||||
autocleanup: 'all',
|
||||
)
|
||||
session_worker_dbus_gen = gnome.gdbus_codegen('gdm-session-worker-glue',
|
||||
'gdm-session-worker.xml',
|
||||
namespace: 'GdmDBus',
|
||||
interface_prefix: 'org.gnome.DisplayManager',
|
||||
autocleanup: 'all',
|
||||
)
|
||||
|
||||
+accountsservice_system_user_dbus_gen = gnome.gdbus_codegen('com.redhat.AccountsServiceUser.System',
|
||||
+ 'com.redhat.AccountsServiceUser.System.xml',
|
||||
+ namespace: 'Gdm',
|
||||
+ interface_prefix: 'com.redhat',
|
||||
+ autocleanup: 'all',
|
||||
+)
|
||||
+
|
||||
@INTLTOOL_SCHEMAS_RULE@
|
||||
@INTLTOOL_XML_NOMERGE_RULE@
|
||||
gdm_session_enums = gnome.mkenums('gdm-session-enum-types',
|
||||
h_template: 'gdm-session-enum-types.h.in',
|
||||
c_template: 'gdm-session-enum-types.c.in',
|
||||
sources: 'gdm-session.h',
|
||||
)
|
||||
gdm_session_worker_enums = gnome.mkenums('gdm-session-worker-enum-types',
|
||||
h_template: 'gdm-session-worker-enum-types.h.in',
|
||||
c_template: 'gdm-session-worker-enum-types.c.in',
|
||||
sources: 'gdm-session-worker.h',
|
||||
)
|
||||
|
||||
# dconf database and profile
|
||||
dconf_db_files = \
|
||||
dconf/defaults/00-upstream-settings \
|
||||
dconf/defaults/locks/00-upstream-settings-locks
|
||||
# Daemons deps
|
||||
gdm_daemon_deps = [
|
||||
libgdmcommon_dep,
|
||||
accountsservice_dep,
|
||||
gobject_dep,
|
||||
gio_dep,
|
||||
gio_unix_dep,
|
||||
libpam_dep,
|
||||
x_deps,
|
||||
xcb_dep,
|
||||
]
|
||||
|
||||
dconfdbdir = $(pkgdatadir)
|
||||
dconfdb_DATA = greeter-dconf-defaults
|
||||
greeter-dconf-defaults: $(dconf_db_files)
|
||||
$(AM_V_GEN) dconf compile $@ $(srcdir)/dconf/defaults
|
||||
if xdmcp_dep.found() and get_option('tcp-wrappers')
|
||||
gdm_daemon_deps += libwrap_dep
|
||||
endif
|
||||
|
||||
dconfprofiledir = $(DATADIR)/dconf/profile
|
||||
dconfprofile_DATA = dconf/gdm
|
||||
# test-session-client
|
||||
test_session_client_src = [
|
||||
'test-session-client.c',
|
||||
session_dbus_gen,
|
||||
manager_dbus_gen,
|
||||
]
|
||||
|
||||
gsettings_SCHEMAS = org.gnome.login-screen.gschema.xml
|
||||
@GSETTINGS_RULES@
|
||||
test_session_client = executable('test-session-client',
|
||||
test_session_client_src,
|
||||
dependencies: gdm_daemon_deps,
|
||||
include_directories: config_h_dir,
|
||||
)
|
||||
|
||||
schemasdir = $(pkgdatadir)
|
||||
schemas_in_files = gdm.schemas.in
|
||||
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
|
||||
# Session worker
|
||||
gdm_session_worker_src = [
|
||||
'session-worker-main.c',
|
||||
'gdm-session.c',
|
||||
'gdm-session-settings.c',
|
||||
'gdm-session-auditor.c',
|
||||
'gdm-session-record.c',
|
||||
'gdm-session-worker.c',
|
||||
'gdm-session-worker-job.c',
|
||||
'gdm-session-worker-common.c',
|
||||
'gdm-dbus-util.c',
|
||||
dbus_gen,
|
||||
session_dbus_gen,
|
||||
session_worker_dbus_gen,
|
||||
+ accountsservice_system_user_dbus_gen,
|
||||
gdm_session_enums,
|
||||
gdm_session_worker_enums,
|
||||
]
|
||||
|
||||
gdm.schemas.in: $(srcdir)/gdm.schemas.in.in
|
||||
sed -e 's,[@]GDMPREFETCHCMD[@],$(GDMPREFETCHCMD),g' \
|
||||
-e 's,[@]GDM_CUSTOM_CONF[@],$(GDM_CUSTOM_CONF),g' \
|
||||
-e 's,[@]GDM_USER_PATH[@],$(GDM_USER_PATH),g' \
|
||||
-e 's,[@]GDM_USERNAME[@],$(GDM_USERNAME),g' \
|
||||
-e 's,[@]GDM_GROUPNAME[@],$(GDM_GROUPNAME),g' \
|
||||
-e 's,[@]HALT_COMMAND[@],$(HALT_COMMAND),g' \
|
||||
diff --git a/data/com.redhat.AccountsServiceUser.System.xml b/data/com.redhat.AccountsServiceUser.System.xml
|
||||
new file mode 100644
|
||||
index 000000000..67f5f302c
|
||||
--- /dev/null
|
||||
+++ b/data/com.redhat.AccountsServiceUser.System.xml
|
||||
@@ -0,0 +1,10 @@
|
||||
+<node>
|
||||
+ <interface name="com.redhat.AccountsServiceUser.System">
|
||||
+
|
||||
+ <annotation name="org.freedesktop.Accounts.VendorExtension" value="true"/>
|
||||
+
|
||||
+ <property name="id" type="s" access="readwrite"/>
|
||||
+ <property name="version-id" type="s" access="readwrite"/>
|
||||
+
|
||||
+ </interface>
|
||||
+</node>
|
||||
gdm_session_worker_deps = [
|
||||
gdm_daemon_deps,
|
||||
]
|
||||
|
||||
gdm_session_worker_includes = [
|
||||
config_h_dir,
|
||||
]
|
||||
|
||||
if pam_extensions_supported
|
||||
gdm_session_worker_src += '../pam-extensions/gdm-pam-extensions.h'
|
||||
gdm_session_worker_includes += pam_extensions_inc
|
||||
endif
|
||||
|
||||
if libaudit_dep.found()
|
||||
gdm_session_worker_deps += libaudit_dep
|
||||
|
||||
gdm_session_worker_src += [
|
||||
'gdm-session-linux-auditor.c',
|
||||
]
|
||||
endif
|
||||
|
||||
if have_adt
|
||||
gdm_session_worker_src += 'gdm-session-solaris-auditor.c'
|
||||
endif
|
||||
|
||||
gdm_session_worker = executable('gdm-session-worker',
|
||||
--
|
||||
2.17.1
|
||||
2.33.1
|
||||
|
||||
|
@ -1,227 +0,0 @@
|
||||
From 7b83c1dc9645cabadfeb253d7eca427f6a26d10f Mon Sep 17 00:00:00 2001
|
||||
From: Iain Lane <iainl@gnome.org>
|
||||
Date: Thu, 31 Jan 2019 17:51:52 +0000
|
||||
Subject: [PATCH 3/4] session: Don't allow greeter operations on an running
|
||||
session
|
||||
|
||||
If a client has a reference to a session that starts running,
|
||||
refuse to allow further operations on the session.
|
||||
|
||||
CVE-2019-3825
|
||||
---
|
||||
daemon/gdm-session.c | 75 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 75 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index f23a83c5e..a8263ba11 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -1401,130 +1401,205 @@ gdm_session_handle_client_begin_verification_for_user (GdmDBusUserVerifier *u
|
||||
static gboolean
|
||||
gdm_session_handle_client_answer_query (GdmDBusUserVerifier *user_verifier_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *service_name,
|
||||
const char *answer,
|
||||
GdmSession *self)
|
||||
{
|
||||
gdm_dbus_user_verifier_complete_answer_query (user_verifier_interface,
|
||||
invocation);
|
||||
gdm_session_answer_query (self, service_name, answer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_handle_client_cancel (GdmDBusUserVerifier *user_verifier_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GdmSession *self)
|
||||
{
|
||||
gdm_dbus_user_verifier_complete_cancel (user_verifier_interface,
|
||||
invocation);
|
||||
gdm_session_cancel (self);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_handle_client_select_session (GdmDBusGreeter *greeter_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *session,
|
||||
GdmSession *self)
|
||||
{
|
||||
+ if (gdm_session_is_running (self)) {
|
||||
+ const char *username;
|
||||
+
|
||||
+ username = gdm_session_get_username (self);
|
||||
+ g_debug ("GdmSession: refusing to select session %s since it's already running (for user %s)",
|
||||
+ session,
|
||||
+ username);
|
||||
+ g_dbus_method_invocation_return_error (invocation,
|
||||
+ G_DBUS_ERROR,
|
||||
+ G_DBUS_ERROR_INVALID_ARGS,
|
||||
+ "Session already running for user %s",
|
||||
+ username);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_complete_select_session (greeter_interface,
|
||||
invocation);
|
||||
}
|
||||
gdm_session_select_session (self, session);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_handle_client_select_user (GdmDBusGreeter *greeter_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *username,
|
||||
GdmSession *self)
|
||||
{
|
||||
+ if (gdm_session_is_running (self)) {
|
||||
+ const char *session_username;
|
||||
+
|
||||
+ session_username = gdm_session_get_username (self);
|
||||
+ g_debug ("GdmSession: refusing to select user %s, since session (%p) already running (for user %s)",
|
||||
+ username,
|
||||
+ self,
|
||||
+ session_username);
|
||||
+ g_dbus_method_invocation_return_error (invocation,
|
||||
+ G_DBUS_ERROR,
|
||||
+ G_DBUS_ERROR_INVALID_ARGS,
|
||||
+ "Session already running for user %s",
|
||||
+ session_username);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_complete_select_user (greeter_interface,
|
||||
invocation);
|
||||
}
|
||||
g_debug ("GdmSession: client selected user '%s' on session (%p)", username, self);
|
||||
gdm_session_select_user (self, username);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_handle_client_start_session_when_ready (GdmDBusGreeter *greeter_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *service_name,
|
||||
gboolean client_is_ready,
|
||||
GdmSession *self)
|
||||
{
|
||||
+ if (gdm_session_is_running (self)) {
|
||||
+ const char *username;
|
||||
+
|
||||
+ username = gdm_session_get_username (self);
|
||||
+ g_debug ("GdmSession: refusing to start session (%p), since it's already running (for user %s)",
|
||||
+ self,
|
||||
+ username);
|
||||
+ g_dbus_method_invocation_return_error (invocation,
|
||||
+ G_DBUS_ERROR,
|
||||
+ G_DBUS_ERROR_INVALID_ARGS,
|
||||
+ "Session already running for user %s",
|
||||
+ username);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_complete_start_session_when_ready (greeter_interface,
|
||||
invocation);
|
||||
}
|
||||
g_signal_emit (G_OBJECT (self),
|
||||
signals [CLIENT_READY_FOR_SESSION_TO_START],
|
||||
0,
|
||||
service_name,
|
||||
client_is_ready);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_handle_get_timed_login_details (GdmDBusGreeter *greeter_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GdmSession *self)
|
||||
{
|
||||
+ if (gdm_session_is_running (self)) {
|
||||
+ const char *username;
|
||||
+
|
||||
+ username = gdm_session_get_username (self);
|
||||
+ g_debug ("GdmSession: refusing to give timed login details, session (%p) already running (for user %s)",
|
||||
+ self,
|
||||
+ username);
|
||||
+ g_dbus_method_invocation_return_error (invocation,
|
||||
+ G_DBUS_ERROR,
|
||||
+ G_DBUS_ERROR_INVALID_ARGS,
|
||||
+ "Session already running for user %s",
|
||||
+ username);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_complete_get_timed_login_details (greeter_interface,
|
||||
invocation,
|
||||
self->priv->timed_login_username != NULL,
|
||||
self->priv->timed_login_username != NULL? self->priv->timed_login_username : "",
|
||||
self->priv->timed_login_delay);
|
||||
if (self->priv->timed_login_username != NULL) {
|
||||
gdm_dbus_greeter_emit_timed_login_requested (self->priv->greeter_interface,
|
||||
self->priv->timed_login_username,
|
||||
self->priv->timed_login_delay);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_session_handle_client_begin_auto_login (GdmDBusGreeter *greeter_interface,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *username,
|
||||
GdmSession *self)
|
||||
{
|
||||
+ const char *session_username;
|
||||
+
|
||||
+ if (gdm_session_is_running (self)) {
|
||||
+ session_username = gdm_session_get_username (self);
|
||||
+ g_debug ("GdmSession: refusing auto login operation, session (%p) already running for user %s (%s requested)",
|
||||
+ self,
|
||||
+ session_username,
|
||||
+ username);
|
||||
+ g_dbus_method_invocation_return_error (invocation,
|
||||
+ G_DBUS_ERROR,
|
||||
+ G_DBUS_ERROR_INVALID_ARGS,
|
||||
+ "Session already owned by user %s",
|
||||
+ session_username);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
if (self->priv->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_complete_begin_auto_login (greeter_interface,
|
||||
invocation);
|
||||
}
|
||||
|
||||
g_debug ("GdmSession: client requesting automatic login for user '%s' on session '%s' (%p)",
|
||||
username,
|
||||
gdm_session_get_session_id (self),
|
||||
self);
|
||||
|
||||
gdm_session_setup_for_user (self, "gdm-autologin", username);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
export_user_verifier_interface (GdmSession *self,
|
||||
GDBusConnection *connection)
|
||||
{
|
||||
GdmDBusUserVerifier *user_verifier_interface;
|
||||
user_verifier_interface = GDM_DBUS_USER_VERIFIER (gdm_dbus_user_verifier_skeleton_new ());
|
||||
|
||||
g_object_set_data (G_OBJECT (connection), "gdm-session", self);
|
||||
|
||||
g_signal_connect (user_verifier_interface,
|
||||
"handle-enable-extensions",
|
||||
G_CALLBACK (gdm_session_handle_client_enable_extensions),
|
||||
connection);
|
||||
g_signal_connect (user_verifier_interface,
|
||||
"handle-begin-verification",
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,7 +1,7 @@
|
||||
From b8c942b5f191eaa39ac1e578fa019b32a516cd5c Mon Sep 17 00:00:00 2001
|
||||
From 64e8db8432158e5115df18a03bb87ecc1d58ae63 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 11 Feb 2019 10:32:55 -0500
|
||||
Subject: [PATCH] session: ensure login screen over XDMCP connects to its
|
||||
Subject: [PATCH 3/3] session: ensure login screen over XDMCP connects to its
|
||||
session
|
||||
|
||||
Right now GTK preferentially picks the wayland display over an
|
||||
@ -17,10 +17,10 @@ the session is X11.
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index e6640aac7..0f821e390 100644
|
||||
index 77d6b8ff0..357e4a297 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -2614,60 +2614,79 @@ set_up_session_environment (GdmSession *self)
|
||||
@@ -2697,60 +2697,79 @@ set_up_session_environment (GdmSession *self)
|
||||
}
|
||||
|
||||
static void
|
||||
@ -42,8 +42,8 @@ index e6640aac7..0f821e390 100644
|
||||
{
|
||||
const char *session_type = "x11";
|
||||
|
||||
if (self->priv->session_type != NULL) {
|
||||
session_type = self->priv->session_type;
|
||||
if (self->session_type != NULL) {
|
||||
session_type = self->session_type;
|
||||
}
|
||||
|
||||
gdm_dbus_worker_call_set_environment_variable (conversation->worker_proxy,
|
||||
@ -101,5 +101,5 @@ index e6640aac7..0f821e390 100644
|
||||
gpointer key, value;
|
||||
|
||||
--
|
||||
2.18.1
|
||||
2.30.1
|
||||
|
@ -1,85 +0,0 @@
|
||||
From 1987a539495f38ade3efc561f65b56316080356e Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 24 Jun 2019 16:21:59 -0400
|
||||
Subject: [PATCH 3/3] session-worker: uninitialize pam if worker is killed
|
||||
|
||||
Right nowe don't uninitialize pam or switch back to the
|
||||
starting VT if the worker is killed before the session.
|
||||
|
||||
This commit fixes that.
|
||||
---
|
||||
daemon/gdm-session-worker.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index aa288ac8e..0322037e0 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -3552,60 +3552,64 @@ gdm_session_worker_init (GdmSessionWorker *worker)
|
||||
static void
|
||||
gdm_session_worker_unwatch_child (GdmSessionWorker *worker)
|
||||
{
|
||||
if (worker->priv->child_watch_id == 0)
|
||||
return;
|
||||
|
||||
g_source_remove (worker->priv->child_watch_id);
|
||||
worker->priv->child_watch_id = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gdm_session_worker_finalize (GObject *object)
|
||||
{
|
||||
GdmSessionWorker *worker;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_SESSION_WORKER (object));
|
||||
|
||||
worker = GDM_SESSION_WORKER (object);
|
||||
|
||||
g_return_if_fail (worker->priv != NULL);
|
||||
|
||||
gdm_session_worker_unwatch_child (worker);
|
||||
|
||||
if (worker->priv->child_pid > 0) {
|
||||
gdm_signal_pid (worker->priv->child_pid, SIGTERM);
|
||||
gdm_wait_on_pid (worker->priv->child_pid);
|
||||
}
|
||||
|
||||
+ if (worker->priv->pam_handle != NULL) {
|
||||
+ gdm_session_worker_uninitialize_pam (worker, PAM_SUCCESS);
|
||||
+ }
|
||||
+
|
||||
g_clear_object (&worker->priv->user_settings);
|
||||
g_free (worker->priv->service);
|
||||
g_free (worker->priv->x11_display_name);
|
||||
g_free (worker->priv->x11_authority_file);
|
||||
g_free (worker->priv->display_device);
|
||||
g_free (worker->priv->display_seat_id);
|
||||
g_free (worker->priv->hostname);
|
||||
g_free (worker->priv->username);
|
||||
g_free (worker->priv->server_address);
|
||||
g_strfreev (worker->priv->arguments);
|
||||
g_strfreev (worker->priv->extensions);
|
||||
|
||||
g_hash_table_unref (worker->priv->reauthentication_requests);
|
||||
|
||||
G_OBJECT_CLASS (gdm_session_worker_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
GdmSessionWorker *
|
||||
gdm_session_worker_new (const char *address,
|
||||
gboolean is_reauth_session)
|
||||
{
|
||||
GObject *object;
|
||||
|
||||
object = g_object_new (GDM_TYPE_SESSION_WORKER,
|
||||
"server-address", address,
|
||||
"is-reauth-session", is_reauth_session,
|
||||
NULL);
|
||||
|
||||
return GDM_SESSION_WORKER (object);
|
||||
}
|
||||
--
|
||||
2.18.1
|
||||
|
@ -0,0 +1,122 @@
|
||||
From b5472a30b1a71aec537ac309e2985cbac61b3136 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 14 Sep 2021 11:00:33 -0400
|
||||
Subject: [PATCH 3/4] xdmcp-display-factory: Set supported session types for
|
||||
XDMCP displays
|
||||
|
||||
The lower levels of GDM now expect the session types supported by a
|
||||
display to be specified up front.
|
||||
|
||||
This commit makes sure XDMCP displays do that.
|
||||
---
|
||||
daemon/gdm-xdmcp-display-factory.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
|
||||
index ce8f026e..abb58fae 100644
|
||||
--- a/daemon/gdm-xdmcp-display-factory.c
|
||||
+++ b/daemon/gdm-xdmcp-display-factory.c
|
||||
@@ -2104,94 +2104,100 @@ on_display_status_changed (GdmDisplay *display,
|
||||
break;
|
||||
case GDM_DISPLAY_MANAGED:
|
||||
if (session != NULL) {
|
||||
g_signal_connect_object (G_OBJECT (session),
|
||||
"client-disconnected",
|
||||
G_CALLBACK (on_client_disconnected),
|
||||
display, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (G_OBJECT (session),
|
||||
"disconnected",
|
||||
G_CALLBACK (on_client_disconnected),
|
||||
display, G_CONNECT_SWAPPED);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
g_clear_object (&launch_environment);
|
||||
}
|
||||
|
||||
static GdmDisplay *
|
||||
gdm_xdmcp_display_create (GdmXdmcpDisplayFactory *factory,
|
||||
const char *hostname,
|
||||
GdmAddress *address,
|
||||
int displaynum)
|
||||
{
|
||||
GdmDisplay *display;
|
||||
GdmDisplayStore *store;
|
||||
gboolean use_chooser;
|
||||
+ const char *session_types[] = { "x11", NULL };
|
||||
|
||||
g_debug ("GdmXdmcpDisplayFactory: Creating xdmcp display for %s:%d",
|
||||
hostname ? hostname : "(null)", displaynum);
|
||||
|
||||
use_chooser = FALSE;
|
||||
if (factory->honor_indirect) {
|
||||
IndirectClient *ic;
|
||||
|
||||
ic = indirect_client_lookup (factory, address);
|
||||
|
||||
/* This was an indirect thingie and nothing was yet chosen,
|
||||
* use a chooser */
|
||||
if (ic != NULL && ic->chosen_address == NULL) {
|
||||
use_chooser = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (use_chooser) {
|
||||
display = gdm_xdmcp_chooser_display_new (hostname,
|
||||
displaynum,
|
||||
address,
|
||||
get_next_session_serial (factory));
|
||||
g_signal_connect (display, "hostname-selected", G_CALLBACK (on_hostname_selected), factory);
|
||||
} else {
|
||||
display = gdm_xdmcp_display_new (hostname,
|
||||
displaynum,
|
||||
address,
|
||||
get_next_session_serial (factory));
|
||||
}
|
||||
|
||||
if (display == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ g_object_set (G_OBJECT (display),
|
||||
+ "session-type", session_types[0],
|
||||
+ "supported-session-types", session_types,
|
||||
+ NULL);
|
||||
+
|
||||
if (! gdm_display_prepare (display)) {
|
||||
gdm_display_unmanage (display);
|
||||
g_object_unref (display);
|
||||
display = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_signal_connect_after (display,
|
||||
"notify::status",
|
||||
G_CALLBACK (on_display_status_changed),
|
||||
factory);
|
||||
|
||||
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
||||
gdm_display_store_add (store, display);
|
||||
|
||||
factory->num_pending_sessions++;
|
||||
out:
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_xdmcp_send_accept (GdmXdmcpDisplayFactory *factory,
|
||||
GdmAddress *address,
|
||||
CARD32 session_id,
|
||||
ARRAY8Ptr authentication_name,
|
||||
ARRAY8Ptr authentication_data,
|
||||
ARRAY8Ptr authorization_name,
|
||||
ARRAY8Ptr authorization_data)
|
||||
{
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,105 +0,0 @@
|
||||
From 15a19ac7856c539aa9cfbf76997d18b0275aae35 Mon Sep 17 00:00:00 2001
|
||||
From: Iain Lane <iainl@gnome.org>
|
||||
Date: Mon, 4 Feb 2019 15:12:38 +0000
|
||||
Subject: [PATCH 4/4] GdmManager: Don't perform timed login if session gets
|
||||
started
|
||||
|
||||
At the moment it's possible for the login screen to initiate
|
||||
a timed login operation shortly after a user successfully starts
|
||||
their session.
|
||||
|
||||
GDM won't complete the timed login operation, since a session is
|
||||
already running, but will erroneously overwrite the username
|
||||
associated with the session, misattributing the users session
|
||||
to the timed login user.
|
||||
|
||||
Later, attempts to log in as the timed user will instead unlock the
|
||||
session for the other user, since that session is now associated
|
||||
with the timed login user.
|
||||
|
||||
This commit refuses timed login requests on sessions that are
|
||||
already running, so the username doesn't get corrupted.
|
||||
|
||||
CVE-2019-3825
|
||||
|
||||
Closes https://gitlab.gnome.org/GNOME/gdm/issues/460
|
||||
---
|
||||
daemon/gdm-manager.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 0cc06a978..056560b20 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -2116,60 +2116,68 @@ on_session_client_ready_for_session_to_start (GdmSession *session,
|
||||
} else {
|
||||
g_debug ("GdmManager: Will start session when ready and told");
|
||||
}
|
||||
|
||||
waiting_to_start_user_session = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (session),
|
||||
"waiting-to-start"));
|
||||
|
||||
g_object_set_data (G_OBJECT (session),
|
||||
"start-when-ready",
|
||||
GINT_TO_POINTER (client_is_ready));
|
||||
|
||||
if (client_is_ready && waiting_to_start_user_session) {
|
||||
start_user_session_if_ready (manager, session, service_name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_session_client_connected (GdmSession *session,
|
||||
GCredentials *credentials,
|
||||
GPid pid_of_client,
|
||||
GdmManager *manager)
|
||||
{
|
||||
GdmDisplay *display;
|
||||
char *username;
|
||||
int delay;
|
||||
gboolean enabled;
|
||||
gboolean allow_timed_login = FALSE;
|
||||
|
||||
g_debug ("GdmManager: client with pid %d connected", (int) pid_of_client);
|
||||
|
||||
+ if (gdm_session_is_running (session)) {
|
||||
+ const char *session_username;
|
||||
+ session_username = gdm_session_get_username (session);
|
||||
+ g_debug ("GdmManager: ignoring connection, since session already running (for user %s)",
|
||||
+ session_username);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
display = get_display_for_user_session (session);
|
||||
|
||||
if (display == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!display_is_on_seat0 (display)) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef WITH_PLYMOUTH
|
||||
if (manager->priv->plymouth_is_running) {
|
||||
plymouth_quit_with_transition ();
|
||||
manager->priv->plymouth_is_running = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_object_get (G_OBJECT (display), "allow-timed-login", &allow_timed_login, NULL);
|
||||
|
||||
if (!allow_timed_login) {
|
||||
return;
|
||||
}
|
||||
|
||||
enabled = get_timed_login_details (manager, &username, &delay);
|
||||
|
||||
if (! enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
gdm_session_set_timed_login_details (session, username, delay);
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c673a7dd781da5ae0d64e13eb83c17e130231931 Mon Sep 17 00:00:00 2001
|
||||
From 738a10ca78e154ad4c3df9a1298eaad01516457e Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 20 Aug 2018 14:30:59 -0400
|
||||
Subject: [PATCH 4/4] daemon: handle upgrades from RHEL 7
|
||||
@ -12,10 +12,11 @@ or not they were using RHEL 7 and in the event they were
|
||||
try to get the right settings.
|
||||
---
|
||||
daemon/gdm-session-settings.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
daemon/gdm-session.c | 19 ++++++++-----------
|
||||
2 files changed, 27 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
|
||||
index 921e4d501..0ce2e7de2 100644
|
||||
index a4b7f1a6..a84b2ffa 100644
|
||||
--- a/daemon/gdm-session-settings.c
|
||||
+++ b/daemon/gdm-session-settings.c
|
||||
@@ -270,95 +270,114 @@ gdm_session_settings_get_property (GObject *object,
|
||||
@ -79,9 +80,9 @@ index 921e4d501..0ce2e7de2 100644
|
||||
}
|
||||
}
|
||||
|
||||
/* if the user doesn't have saved state, they don't have any settings worth reading */
|
||||
if (!act_user_get_saved (settings->priv->user))
|
||||
goto out;
|
||||
|
||||
|
||||
|
||||
|
||||
session_type = act_user_get_session_type (settings->priv->user);
|
||||
session_name = act_user_get_session (settings->priv->user);
|
||||
@ -133,6 +134,117 @@ index 921e4d501..0ce2e7de2 100644
|
||||
G_CALLBACK (on_user_is_loaded_changed),
|
||||
settings);
|
||||
}
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index d1e2c301..d4a46d87 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -3207,98 +3207,95 @@ gdm_session_get_session_id (GdmSession *self)
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
const char *
|
||||
gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
const char *service_name)
|
||||
{
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), NULL);
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_session_filename (GdmSession *self)
|
||||
{
|
||||
return g_strdup_printf ("%s.desktop", get_session_name (self));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
static gboolean
|
||||
gdm_session_is_wayland_session (GdmSession *self)
|
||||
{
|
||||
- GKeyFile *key_file;
|
||||
+ g_autoptr (GKeyFile) key_file = NULL;
|
||||
gboolean is_wayland_session = FALSE;
|
||||
- char *filename;
|
||||
- char *full_path = NULL;
|
||||
+ g_autofree char *filename = NULL;
|
||||
+ g_autofree char *full_path = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
if (supports_session_type (self, "wayland")) {
|
||||
key_file = load_key_file_for_file (self, filename, NULL, &full_path);
|
||||
|
||||
if (key_file == NULL) {
|
||||
goto out;
|
||||
}
|
||||
- }
|
||||
|
||||
- if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
- is_wayland_session = TRUE;
|
||||
+ if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
+ is_wayland_session = TRUE;
|
||||
+ }
|
||||
}
|
||||
- g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
|
||||
out:
|
||||
- g_clear_pointer (&key_file, g_key_file_free);
|
||||
- g_free (filename);
|
||||
+ g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
return is_wayland_session;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
update_session_type (GdmSession *self)
|
||||
{
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
gboolean is_wayland_session = FALSE;
|
||||
|
||||
- if (supports_session_type (self, "wayland"))
|
||||
- is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
+ is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
|
||||
if (is_wayland_session) {
|
||||
set_session_type (self, "wayland");
|
||||
} else {
|
||||
set_session_type (self, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_session_registers (GdmSession *self)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GKeyFile) key_file = NULL;
|
||||
gboolean session_registers = FALSE;
|
||||
g_autofree char *filename = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
key_file = load_key_file_for_file (self, filename, NULL, NULL);
|
||||
|
||||
session_registers = g_key_file_get_boolean (key_file,
|
||||
G_KEY_FILE_DESKTOP_GROUP,
|
||||
"X-GDM-SessionRegisters",
|
||||
&error);
|
||||
if (!session_registers &&
|
||||
error != NULL &&
|
||||
--
|
||||
2.17.1
|
||||
2.33.1
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
From f32adbe9bf26d502cb055b3a6cb98fc57e06bf13 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Fri, 26 Jul 2019 14:06:16 -0400
|
||||
Subject: [PATCH 4/4] data: reap gdm sessions on shutdown
|
||||
|
||||
If GDM gets shutdown we should make sure all sessions get shutdown too.
|
||||
|
||||
This is a bit of a safety net in case any processes in the session are
|
||||
lingering after the orderly shutdown.
|
||||
---
|
||||
data/gdm.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/data/gdm.service.in b/data/gdm.service.in
|
||||
index 72201c1fd..202ab6753 100644
|
||||
--- a/data/gdm.service.in
|
||||
+++ b/data/gdm.service.in
|
||||
@@ -21,6 +21,7 @@ OnFailure=plymouth-quit.service
|
||||
|
||||
[Service]
|
||||
ExecStart=@sbindir@/gdm
|
||||
+ExecStopPost=-/usr/bin/bash -c 'for f in /run/systemd/sessions/*; do [ -f $f ] && /usr/bin/fgrep -q SERVICE=gdm $f && loginctl terminate-session $(basename $f); done'
|
||||
KillMode=mixed
|
||||
Restart=always
|
||||
IgnoreSIGPIPE=no
|
||||
--
|
||||
2.18.1
|
||||
|
@ -0,0 +1,96 @@
|
||||
From dfca67899ea33da08d3aa9e84c1b4487991adad0 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 7 Oct 2021 15:34:27 -0400
|
||||
Subject: [PATCH 4/4] local-display-factory: Don't crash if Xorg and Wayland
|
||||
are both unavailable
|
||||
|
||||
At the moment if Wayland doesn't work, the login screen will fall back
|
||||
to Xorg, and if Xorg doesn't work the login screen will fall back to
|
||||
Wayland.
|
||||
|
||||
But if the fall back choice is disabled explicitly, GDM will just crash.
|
||||
|
||||
This commit fixes the crash.
|
||||
|
||||
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/739
|
||||
---
|
||||
daemon/gdm-local-display-factory.c | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
||||
index eba38671..120847f9 100644
|
||||
--- a/daemon/gdm-local-display-factory.c
|
||||
+++ b/daemon/gdm-local-display-factory.c
|
||||
@@ -651,62 +651,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
|
||||
gdm_settings_direct_get_boolean (GDM_KEY_XORG_ENABLE, &xorg_enabled);
|
||||
|
||||
preferred_display_server = get_preferred_display_server (factory);
|
||||
|
||||
if (g_strcmp0 (preferred_display_server, "none") == 0) {
|
||||
g_debug ("GdmLocalDisplayFactory: Preferred display server is none, so not creating display");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = sd_seat_can_graphical (seat_id);
|
||||
|
||||
if (ret < 0) {
|
||||
g_critical ("Failed to query CanGraphical information for seat %s", seat_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
g_debug ("GdmLocalDisplayFactory: System doesn't currently support graphics");
|
||||
seat_supports_graphics = FALSE;
|
||||
} else {
|
||||
g_debug ("GdmLocalDisplayFactory: System supports graphics");
|
||||
seat_supports_graphics = TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0 (seat_id, "seat0") == 0) {
|
||||
is_seat0 = TRUE;
|
||||
|
||||
falling_back = factory->num_failures > 0;
|
||||
session_types = gdm_local_display_factory_get_session_types (factory, falling_back);
|
||||
|
||||
- g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
|
||||
- session_types[0], falling_back? " fallback" : "");
|
||||
+ if (session_types == NULL) {
|
||||
+ g_debug ("GdmLocalDisplayFactory: Both Wayland and Xorg are unavailable");
|
||||
+ seat_supports_graphics = FALSE;
|
||||
+ } else {
|
||||
+ g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
|
||||
+ session_types[0], falling_back? " fallback" : "");
|
||||
+ }
|
||||
} else {
|
||||
is_seat0 = FALSE;
|
||||
|
||||
g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id);
|
||||
/* Force legacy X11 for all auxiliary seats */
|
||||
seat_supports_graphics = TRUE;
|
||||
session_types = g_strdupv ((char **) legacy_session_types);
|
||||
}
|
||||
|
||||
/* For seat0, we have a fallback logic to still try starting it after
|
||||
* SEAT0_GRAPHICS_CHECK_TIMEOUT seconds. i.e. we simply continue even if
|
||||
* CanGraphical is unset.
|
||||
* This is ugly, but it means we'll come up eventually in some
|
||||
* scenarios where no master device is present.
|
||||
* Note that we'll force an X11 fallback even though there might be
|
||||
* cases where an wayland capable device is present and simply not marked as
|
||||
* master-of-seat. In these cases, this should likely be fixed in the
|
||||
* udev rules.
|
||||
*
|
||||
* At the moment, systemd always sets CanGraphical for non-seat0 seats.
|
||||
* This is because non-seat0 seats are defined by having master-of-seat
|
||||
* set. This means we can avoid the fallback check for non-seat0 seats,
|
||||
* which simplifies the code.
|
||||
*/
|
||||
if (is_seat0) {
|
||||
if (!seat_supports_graphics) {
|
||||
if (!factory->seat0_graphics_check_timed_out) {
|
||||
if (factory->seat0_graphics_check_timeout_id == 0) {
|
||||
g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics. Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT);
|
||||
factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT,
|
||||
--
|
||||
2.34.1
|
||||
|
@ -3,7 +3,6 @@ load-module module-card-restore
|
||||
load-module module-udev-detect
|
||||
load-module module-native-protocol-unix
|
||||
load-module module-default-device-restore
|
||||
load-module module-rescue-streams
|
||||
load-module module-always-sink
|
||||
load-module module-intended-roles
|
||||
load-module module-suspend-on-idle
|
||||
|
290
SPECS/gdm.spec
290
SPECS/gdm.spec
@ -7,72 +7,95 @@
|
||||
%define desktop_file_utils_version 0.2.90
|
||||
%define nss_version 3.11.1
|
||||
|
||||
%global tarball_version %%(echo %{version} | tr '~' '.')
|
||||
|
||||
Name: gdm
|
||||
Epoch: 1
|
||||
Version: 3.28.3
|
||||
Release: 29%{?dist}
|
||||
Version: 40.0
|
||||
Release: 27%{?dist}
|
||||
Summary: The GNOME Display Manager
|
||||
|
||||
License: GPLv2+
|
||||
URL: https://wiki.gnome.org/Projects/GDM
|
||||
Source0: http://download.gnome.org/sources/gdm/3.28/gdm-%{version}.tar.xz
|
||||
Source0: http://download.gnome.org/sources/gdm/40/gdm-%{version}.tar.xz
|
||||
Source1: org.gnome.login-screen.gschema.override
|
||||
Patch00001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch
|
||||
|
||||
Patch10001: 0001-utils-add-new-gdm-disable-wayland-binary.patch
|
||||
# Lets customers using vendor nvidia driver pick wayland sessions from the login screen
|
||||
Patch10001: 0001-local-display-factory-Provide-more-flexibility-for-c.patch
|
||||
Patch10002: 0002-libgdm-Sort-session-list.patch
|
||||
Patch10003: 0003-xdmcp-display-factory-Set-supported-session-types-fo.patch
|
||||
Patch10004: 0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch
|
||||
|
||||
Patch20001: 0001-display-access-file-drop-unused-function.patch
|
||||
# Race fix
|
||||
Patch40001: 0001-display-Handle-failure-before-display-registration.patch
|
||||
|
||||
Patch30001: 0001-data-disable-wayland-for-proprietary-nvidia-machines.patch
|
||||
Patch30002: 0001-data-disable-wayland-on-server-chips-and-dual-gpu-se.patch
|
||||
Patch30003: 0001-data-enable-wayland-on-cirrus.patch
|
||||
Patch30004: 0001-data-only-disable-wayland-on-passthrough-virt-setups.patch
|
||||
# Don't bother building gdm-screenshot, nothing uses it
|
||||
Patch50001: 0001-utils-Drop-gdm-screenshot.patch
|
||||
|
||||
Patch40001: 0001-local-display-factory-pause-for-a-few-seconds-before.patch
|
||||
# Questionable feature to support logging in over multiple XDMCP consoles at the same time
|
||||
Patch60001: 0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch
|
||||
Patch60002: 0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch
|
||||
Patch60003: 0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch
|
||||
|
||||
Patch50001: 0001-manager-ensure-is-initial-is-transfered-to-autologin.patch
|
||||
# Upstream change that's moderately risky so revert it
|
||||
Patch70001: 0001-Revert-gdm-wayland-x-session-don-t-overwrite-user-en.patch
|
||||
|
||||
Patch60001: 0001-session-ensure-login-screen-over-XDMCP-connects-to-i.patch
|
||||
# Crash fix
|
||||
Patch80001: 0001-local-display-factory-Don-t-try-to-respawn-displays-.patch
|
||||
|
||||
Patch70001: 0001-worker-don-t-load-user-settings-for-program-sessions.patch
|
||||
Patch70002: 0002-session-support-new-accountsservice-Session-and-Sess.patch
|
||||
Patch70003: 0003-daemon-save-os-release-in-accountsservice.patch
|
||||
Patch70004: 0004-daemon-handle-upgrades-from-RHEL-7.patch
|
||||
# VT handling fix from upstream
|
||||
Patch90001: 0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch
|
||||
|
||||
Patch80001: 0001-session-worker-expose-worker-state-enum-to-type-syst.patch
|
||||
Patch80002: 0002-session-worker-kill-user-sessions-when-stop-gdm-serv.patch
|
||||
Patch80003: 0003-session-worker-uninitialize-pam-if-worker-is-killed.patch
|
||||
Patch80004: 0004-data-reap-gdm-sessions-on-shutdown.patch
|
||||
# Wayland fix from upstream
|
||||
Patch100001: 0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch
|
||||
|
||||
# CVE-2019-3825
|
||||
Patch90001: 0001-manager-don-t-kill-timed-login-session-immediately-a.patch
|
||||
Patch90002: 0002-manager-session-Add-some-debugging-around-starting-r.patch
|
||||
Patch90003: 0003-session-Don-t-allow-greeter-operations-on-an-running.patch
|
||||
Patch90004: 0004-GdmManager-Don-t-perform-timed-login-if-session-gets.patch
|
||||
# Fix DisallowTcp=false from upstream
|
||||
Patch110001: 0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch
|
||||
Patch110002: 0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch
|
||||
|
||||
Patch100001: 0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch
|
||||
Patch100002: 0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch
|
||||
# Fix btmp accounting
|
||||
Patch120001: 0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch
|
||||
Patch120002: 0002-manager-Fix-btmp-record-accounting.patch
|
||||
|
||||
Patch110001: 0001-display-ask-accountservice-if-there-are-users-rather.patch
|
||||
# Fix status error when stoppping gdm quickly after starting it
|
||||
Patch130001: 0001-daemon-Don-t-error-on-shutdown.patch
|
||||
|
||||
Patch120001: 0001-daemon-fix-wayland-detection-when-deciding-to-bypass.patch
|
||||
# Fix LUKS password propagation
|
||||
Patch140001: 0001-build-Support-keyutils-1.5.11-and-older.patch
|
||||
Patch140002: 0002-pam_gdm-Use-the-last-cryptsetup-password-instead-of-.patch
|
||||
|
||||
Patch999999: system-dconf.patch
|
||||
# Non-upstreamable workarounds
|
||||
Patch66620001: 0001-data-reap-gdm-sessions-on-shutdown.patch
|
||||
|
||||
BuildRequires: pam-devel >= 0:%{pam_version}
|
||||
# Non-upstreamable integration patches
|
||||
Patch99910001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch
|
||||
|
||||
Patch99920001: 0001-worker-don-t-load-user-settings-for-program-sessions.patch
|
||||
Patch99920002: 0002-session-support-new-accountsservice-Session-and-Sess.patch
|
||||
Patch99920003: 0003-daemon-save-os-release-in-accountsservice.patch
|
||||
Patch99920004: 0004-daemon-handle-upgrades-from-RHEL-7.patch
|
||||
|
||||
Patch99920006: 0001-data-Disable-network-configuration-on-login-screen.patch
|
||||
|
||||
Patch99930001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
|
||||
|
||||
Patch99940001: 0001-data-disable-wayland-on-certain-hardware.patch
|
||||
|
||||
|
||||
BuildRequires: accountsservice-devel
|
||||
BuildRequires: audit-libs-devel >= %{libauditver}
|
||||
BuildRequires: dconf
|
||||
BuildRequires: desktop-file-utils >= %{desktop_file_utils_version}
|
||||
BuildRequires: libtool automake autoconf
|
||||
BuildRequires: libattr-devel
|
||||
BuildRequires: gettext
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: git
|
||||
BuildRequires: keyutils-libs-devel
|
||||
BuildRequires: libXdmcp-devel
|
||||
BuildRequires: libattr-devel
|
||||
BuildRequires: libdmx-devel
|
||||
BuildRequires: audit-libs-devel >= %{libauditver}
|
||||
BuildRequires: autoconf automake libtool
|
||||
BuildRequires: intltool
|
||||
%ifnarch s390 s390x ppc ppc64
|
||||
BuildRequires: xorg-x11-server-Xorg
|
||||
%endif
|
||||
BuildRequires: meson
|
||||
BuildRequires: nss-devel >= %{nss_version}
|
||||
BuildRequires: pam-devel >= 0:%{pam_version}
|
||||
BuildRequires: pkgconfig(accountsservice) >= 0.6.3
|
||||
BuildRequires: pkgconfig(check)
|
||||
BuildRequires: pkgconfig(gobject-introspection-1.0)
|
||||
@ -86,10 +109,15 @@ BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: pkgconfig(x11)
|
||||
BuildRequires: pkgconfig(xau)
|
||||
BuildRequires: pkgconfig(xorg-server)
|
||||
BuildRequires: libXdmcp-devel
|
||||
BuildRequires: plymouth-devel
|
||||
BuildRequires: systemd
|
||||
BuildRequires: keyutils-libs-devel
|
||||
BuildRequires: dconf
|
||||
BuildRequires: systemd-devel
|
||||
BuildRequires: which
|
||||
%ifnarch s390 s390x ppc ppc64
|
||||
BuildRequires: xorg-x11-server-Xorg
|
||||
%endif
|
||||
BuildRequires: xorg-x11-server-devel
|
||||
BuildRequires: yelp-tools
|
||||
|
||||
Requires(pre): /usr/sbin/useradd
|
||||
%{?systemd_requires}
|
||||
@ -111,11 +139,16 @@ Requires: libXau >= 1.0.4-4
|
||||
Requires: pam >= 0:%{pam_version}
|
||||
Requires: /sbin/nologin
|
||||
Requires: setxkbmap
|
||||
Requires: systemd >= 186
|
||||
Requires: systemd >= 239-50
|
||||
Requires: system-logos
|
||||
Requires: xorg-x11-server-utils
|
||||
Requires: xorg-x11-xinit
|
||||
Recommends: xorg-x11-server-Xorg
|
||||
Conflicts: xorg-x11-server-Xorg < 1.20.8-4
|
||||
|
||||
# Until the greeter gets dynamic user support, it can't
|
||||
# use a user bus
|
||||
Requires: /usr/bin/dbus-run-session
|
||||
|
||||
Obsoletes: gdm-libs < 1:3.12.0-3
|
||||
Provides: gdm-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
@ -164,33 +197,22 @@ GDM specific authentication features.
|
||||
%prep
|
||||
%autosetup -S git
|
||||
|
||||
autoreconf -i -f
|
||||
intltoolize -f
|
||||
|
||||
%build
|
||||
|
||||
%configure --with-pam-prefix=%{_sysconfdir} \
|
||||
--with-run-dir=/run/gdm \
|
||||
--with-default-path=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin \
|
||||
--enable-split-authentication \
|
||||
--enable-profiling \
|
||||
--enable-console-helper \
|
||||
--with-plymouth \
|
||||
--with-selinux
|
||||
|
||||
# drop unneeded direct library deps with --as-needed
|
||||
# libtool doesn't make this easy, so we do it the hard way
|
||||
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/ func_append compile_command " -Wl,-O1,--as-needed"\n func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool
|
||||
|
||||
%make_build
|
||||
|
||||
%meson -Dpam-prefix=%{_sysconfdir} \
|
||||
-Drun-dir=/run/gdm \
|
||||
-Dudev-dir=%{_udevrulesdir} \
|
||||
-Ddefault-path=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin \
|
||||
-Dprofiling=true \
|
||||
-Dplymouth=enabled \
|
||||
-Dselinux=enabled
|
||||
%meson_build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/gdm/Init
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/gdm/PreSession
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/gdm/PostSession
|
||||
|
||||
%make_install
|
||||
%meson_install
|
||||
|
||||
install -p -m644 -D %{SOURCE5} %{buildroot}%{_localstatedir}/lib/gdm/.config/pulse/default.pa
|
||||
|
||||
@ -202,6 +224,9 @@ cp -a %{SOURCE1} %{buildroot}%{_datadir}/glib-2.0/schemas
|
||||
# docs go elsewhere
|
||||
rm -rf %{buildroot}/%{_prefix}/doc
|
||||
|
||||
# we're not doing user sessions in rhel 8
|
||||
rm -rf %{buildroot}%{_prefix}/lib/systemd/user
|
||||
|
||||
# create log dir
|
||||
mkdir -p %{buildroot}/var/log/gdm
|
||||
|
||||
@ -211,10 +236,13 @@ mkdir -p %{buildroot}%{_datadir}/gdm/autostart/LoginWindow
|
||||
|
||||
mkdir -p %{buildroot}/run/gdm
|
||||
|
||||
rm -f %{buildroot}%{_bindir}/gdm-screenshot
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/dconf/db/gdm.d/locks
|
||||
|
||||
find %{buildroot} -name '*.a' -delete
|
||||
find %{buildroot} -name '*.la' -delete
|
||||
cat << EOF > %{buildroot}%{_libexecdir}/gdm-disable-wayland
|
||||
#!/bin/sh
|
||||
%{_libexecdir}/gdm-runtime-config set daemon WaylandEnable false
|
||||
EOF
|
||||
chmod a+x %{buildroot}%{_libexecdir}/gdm-disable-wayland
|
||||
|
||||
%find_lang gdm --with-gnome
|
||||
|
||||
@ -285,7 +313,7 @@ fi
|
||||
%systemd_postun gdm.service
|
||||
|
||||
%files -f gdm.lang
|
||||
%doc AUTHORS NEWS README
|
||||
%doc AUTHORS NEWS README.md
|
||||
%license COPYING
|
||||
%dir %{_sysconfdir}/gdm
|
||||
%config(noreplace) %{_sysconfdir}/gdm/custom.conf
|
||||
@ -303,10 +331,12 @@ fi
|
||||
%dir %{_sysconfdir}/gdm/PreSession
|
||||
%dir %{_sysconfdir}/gdm/PostSession
|
||||
%dir %{_sysconfdir}/gdm/PostLogin
|
||||
%{_datadir}/pixmaps/*.png
|
||||
%dir %{_sysconfdir}/dconf/db/gdm.d
|
||||
%dir %{_sysconfdir}/dconf/db/gdm.d/locks
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.login-screen.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.login-screen.gschema.override
|
||||
%{_libexecdir}/gdm-disable-wayland
|
||||
%{_libexecdir}/gdm-runtime-config
|
||||
%{_libexecdir}/gdm-host-chooser
|
||||
%{_libexecdir}/gdm-session-worker
|
||||
%{_libexecdir}/gdm-simple-chooser
|
||||
@ -326,17 +356,16 @@ fi
|
||||
%{_datadir}/gdm/locale.alias
|
||||
%{_datadir}/gdm/gdb-cmd
|
||||
%{_datadir}/gnome-session/sessions/gnome-login.session
|
||||
%{_datadir}/polkit-1/rules.d/org.gnome.gdm.rules
|
||||
%{_libdir}/girepository-1.0/Gdm-1.0.typelib
|
||||
%{_libdir}/security/pam_gdm.so
|
||||
%{_libdir}/libgdm*.so*
|
||||
%dir %{_localstatedir}/log/gdm
|
||||
%attr(0711, root, gdm) %dir %{_localstatedir}/log/gdm
|
||||
%attr(1770, gdm, gdm) %dir %{_localstatedir}/lib/gdm
|
||||
%attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.config
|
||||
%attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.config/pulse
|
||||
%attr(0600, gdm, gdm) %{_localstatedir}/lib/gdm/.config/pulse/default.pa
|
||||
%attr(0711, root, gdm) %dir /run/gdm
|
||||
%attr(1755, root, gdm) %dir %{_localstatedir}/cache/gdm
|
||||
%{_datadir}/icons/hicolor/*/*/*.png
|
||||
%config %{_sysconfdir}/pam.d/gdm-pin
|
||||
%config %{_sysconfdir}/pam.d/gdm-smartcard
|
||||
%config %{_sysconfdir}/pam.d/gdm-fingerprint
|
||||
@ -357,6 +386,123 @@ fi
|
||||
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
|
||||
|
||||
%changelog
|
||||
* Mon Dec 12 2022 Ray Strode <rstrode@redhat.com> - 40.0-27
|
||||
- Fix LUKs password handling
|
||||
Resolves: #2150649
|
||||
|
||||
* Mon Dec 12 2022 Ray Strode <rstrode@redhat.com> - 40.0-26
|
||||
- Fix error in service status log
|
||||
Resolves: #1924079
|
||||
|
||||
* Wed Oct 19 2022 Ray Strode <rstrode@redhat.com> - 40.0-25
|
||||
- Fix btmp accounting
|
||||
Resolves: #2030043
|
||||
|
||||
* Mon May 16 2022 Ray Strode <rstrode@redhat.com> - 40.0-24
|
||||
- Fix typo that prevents the correct session type from being
|
||||
used when user switching.
|
||||
Resolves: #2034092
|
||||
|
||||
* Thu Jan 27 2022 Ray Strode <rstrode@redhat.com> - 40.0-23
|
||||
- Fix crash when neither Xorg nor wayland is working great
|
||||
Resolves: #2032180
|
||||
|
||||
* Wed Dec 22 2021 Ray Strode <rstrode@redhat.com> - 40.1-22
|
||||
- Fix DisallowTCP
|
||||
Resolves: #2025768
|
||||
|
||||
* Tue Dec 21 2021 Ray Strode <rstrode@redhat.com> - 40.1-21
|
||||
- Fix Xorg/Wayland selection in some cases
|
||||
Resolves: #2009045
|
||||
|
||||
* Mon Oct 25 2021 Ray Strode <rstrode@redhat.com> - 40.1-20
|
||||
- Remove module-rescue-stream from default.pa
|
||||
Resolves: #1969846
|
||||
|
||||
* Mon Oct 25 2021 Ray Strode <rstrode@redhat.com> - 40.0-19
|
||||
- Synchronize permission and group ownership for log dir between
|
||||
rpm file manifest and daemon expectations.
|
||||
Resolves: #1878119
|
||||
|
||||
* Mon Oct 25 2021 Ray Strode <rstrode@redhat.com> - 40.0-18
|
||||
- Drop usleep workaround for problem that's now fixed properly in systemd
|
||||
Resolves: #1921732
|
||||
|
||||
* Wed Oct 13 2021 Ray Strode <rstrode@redhat.com> - 40.0-17
|
||||
- Properly switch VTs when jumping to multi-user target
|
||||
Related: #1988958
|
||||
|
||||
* Wed Sep 15 2021 Ray Strode <rstrode@redhat.com> - 40.0-16
|
||||
- Fix XDMCP
|
||||
Resolves: #2005011
|
||||
- Fix crash at shutdown
|
||||
Related: #2005011
|
||||
|
||||
* Wed Sep 01 2021 Ray Strode <rstrode@redhat.com> - 40.0-14
|
||||
- Disable Wayland on HyperV
|
||||
- Fix Xorg fallback
|
||||
Related: #2000904
|
||||
|
||||
* Thu Aug 19 2021 Ray Strode <rstrode@redhat.com> - 40.0-12
|
||||
- Redisable on server chips since rebase
|
||||
Related: #1909300
|
||||
|
||||
* Wed Aug 04 2021 Ray Strode <rstrode@redhat.com> - 40.0-11
|
||||
- Read session settings from users even if they've never saved
|
||||
before. Needed to support accountsservice templated user
|
||||
defaults.
|
||||
Related: #1812788
|
||||
|
||||
* Tue Jul 27 2021 Ray Strode <rstrode@redhat.com> - 40.0-10
|
||||
- Let customers using vendor nvidia driver choose wayland sessions
|
||||
Resolves: #1962211
|
||||
- Drop unused patches
|
||||
|
||||
* Tue Jun 08 2021 Florian Müllner <fmuellner@redhat.com> - 40.0-3
|
||||
- Disable network items on login screen
|
||||
Resolves: #1935261
|
||||
|
||||
* Wed May 19 2021 Ray Strode <rstrode@redhat.com> - 40.0-2
|
||||
- Fix workaround for systemd bug that's breaking X11 fallback
|
||||
Resolves: #1962049
|
||||
|
||||
* Wed May 05 2021 Ray Strode <rstrode@redhat.com> - 40.0-1
|
||||
- Rebase to 40.0
|
||||
Resolves: #1909300
|
||||
|
||||
* Wed Jan 27 2021 Ray Strode <rstrode@redhat.com> - 3.28.3-39
|
||||
- Ensure login screen display server is is killed at log in
|
||||
- Pull in fixes for two security issues
|
||||
Resolves: #1918391
|
||||
|
||||
* Tue Nov 10 2020 Jonas Ådahl <jadahl@redhat.com> - 3.28.3-38
|
||||
- Re-add disabling Wayland for server GPUs
|
||||
Related: #1670273
|
||||
|
||||
* Tue Nov 10 2020 Jonas Ådahl <jadahl@redhat.com> - 3.28.3-35
|
||||
- Stop disabling Wayland for server GPUs
|
||||
Related: #1670273
|
||||
|
||||
* Tue Sep 15 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-34
|
||||
- Fix file descriptor leak
|
||||
Resolves: #1877853
|
||||
|
||||
* Tue Sep 01 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-33
|
||||
- Fix problem with Xorg fallback
|
||||
Resolves: #1868260
|
||||
|
||||
* Tue Aug 11 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-32
|
||||
- Add dconf db to file manifest
|
||||
Related: #1833158
|
||||
|
||||
* Thu Jul 23 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-31
|
||||
- add back gdm system db to dconf profile
|
||||
Resolves: #1833158
|
||||
|
||||
* Mon Jul 13 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-30
|
||||
- Make sure login screen is killed during login
|
||||
Resolves: #1618481
|
||||
|
||||
* Wed Feb 05 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-29
|
||||
- Make GNOME work slightly better in the multiple logins case.
|
||||
Related: #1710882
|
||||
|
Loading…
Reference in New Issue
Block a user