Commit 22de2518 authored by Ray Strode's avatar Ray Strode

daemon: add knob to disable starting X server as user

Some deployments need to be able to turn off running X servers as a
user for backward compatibility.

This commit adds some #ifdef goop to that end.

Note wayland requires running as the user, so this option, merely
deprioritizes wayland sessions under X sessions.

https://bugzilla.gnome.org/show_bug.cgi?id=779338
parent 5b1e6254
......@@ -195,6 +195,16 @@ if test x$enable_split_authentication = xyes; then
AC_DEFINE(ENABLE_SPLIT_AUTHENTICATION, 1, [Define if split authentication is enabled])
fi
AC_ARG_ENABLE(user-display-server,
AS_HELP_STRING([--enable-user-display-server],
[Enable running X server as user @<:@default=yes@:>@]),,
enable_user_display_server=yes)
AM_CONDITIONAL(ENABLE_USER_DISPLAY_SERVER, test x$user_display_server = xyes)
if test x$enable_user_display_server = xyes; then
AC_DEFINE(ENABLE_USER_DISPLAY_SERVER, 1, [Define if user display servers are supported])
fi
AC_ARG_WITH(default-pam-config,
AS_HELP_STRING([--with-default-pam-config: One of redhat, openembedded, exherbo, lfs, arch, none @<:@default=auto@:>@]))
dnl If not given, try autodetecting from release files (see NetworkManager source)
......
......@@ -206,7 +206,17 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact
g_debug ("GdmLocalDisplayFactory: Creating transient display");
#ifdef ENABLE_USER_DISPLAY_SERVER
display = gdm_local_display_new ();
#else
if (display == NULL) {
guint32 num;
num = take_next_display_number (factory);
display = gdm_legacy_display_new (num);
}
#endif
g_object_set (display,
"seat-id", "seat0"
......@@ -358,13 +368,14 @@ create_display (GdmLocalDisplayFactory *factory,
g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id);
#ifdef ENABLE_USER_DISPLAY_SERVER
if (g_strcmp0 (seat_id, "seat0") == 0) {
display = gdm_local_display_new ();
if (session_type != NULL) {
g_object_set (G_OBJECT (display), "session-type", session_type, NULL);
}
}
#endif
if (display == NULL) {
guint32 num;
......
......@@ -358,7 +358,11 @@ get_system_session_dirs (GdmSession *self)
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
#ifdef ENABLE_WAYLAND_SUPPORT
#ifdef ENABLE_USER_DISPLAY_SERVER
g_array_prepend_val (search_array, wayland_search_dir);
#else
g_array_append_val (search_array, wayland_search_dir);
#endif
#endif
}
......@@ -3107,6 +3111,7 @@ gdm_session_get_display_mode (GdmSession *self)
return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
}
#ifdef ENABLE_USER_DISPLAY_SERVER
/* All other cases (wayland login screen, X login screen,
* wayland user session, X user session) use the NEW_VT
* display mode. That display mode means that GDM allocates
......@@ -3129,6 +3134,18 @@ gdm_session_get_display_mode (GdmSession *self)
* are paused when handed out.
*/
return GDM_SESSION_DISPLAY_MODE_NEW_VT;
#else
#ifdef ENABLE_WAYLAND_SUPPORT
/* Wayland sessions are for now assumed to run in a
* mutter-launch-like environment, so we allocate
* a new VT for them. */
if (g_strcmp0 (self->priv->session_type, "wayland") == 0) {
return GDM_SESSION_DISPLAY_MODE_NEW_VT;
}
#endif
return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
#endif
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment