summaryrefslogtreecommitdiff
path: root/daemon/gdm-x-session.c
diff options
context:
space:
mode:
authorNathaniel Roach <nroach44@gmail.com>2015-11-10 09:11:08 -0500
committerRay Strode <rstrode@redhat.com>2015-11-10 09:26:15 -0500
commit3f59fa0da5168451898db63e51e312ce894af0c1 (patch)
treef8d6d6c6964e0a89c74955b7e890ee79454e491d /daemon/gdm-x-session.c
parenta6e3166899368f97ab7d1779b865f930058b1c32 (diff)
downloadgdm-3f59fa0da5168451898db63e51e312ce894af0c1.tar.gz
Use -listen instead of -nolisten for new Xorg
Newer Xorg versions don't listen to tcp sockets by default, so instead of explicitly passing -nolisten to disable tcp sockets by default, we need to explicitly pass -listen to enable tcp sockets when DisallowTCP=false. Older versions don't support the -listen flag, so we check the version and if it's >= 1.17 then we specify -listen tcp Signed-off-by: Nathaniel Roach <nroach44@gmail.com> https://bugzilla.gnome.org/show_bug.cgi?id=750026
Diffstat (limited to 'daemon/gdm-x-session.c')
-rw-r--r--daemon/gdm-x-session.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
index 58646fa3..624f67ca 100644
--- a/daemon/gdm-x-session.c
+++ b/daemon/gdm-x-session.c
@@ -249,10 +249,22 @@ spawn_x_server (State *state,
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 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 (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");
}
+#endif
g_ptr_array_add (arguments, "-background");
g_ptr_array_add (arguments, "none");