diff -Nuar gdm-2.30.2.is.2.30.0.orig/daemon/gdm-slave.c gdm-2.30.2.is.2.30.0/daemon/gdm-slave.c --- gdm-2.30.2.is.2.30.0.orig/daemon/gdm-slave.c 2010-06-28 10:47:04.805144654 +0200 +++ gdm-2.30.2.is.2.30.0/daemon/gdm-slave.c 2010-06-28 10:53:51.833142699 +0200 @@ -254,6 +254,10 @@ const char *login) { char *script; + char ext[10]=".lliurex"; + char *script_custom; + char dispname[500]; + char disphost[500]; char **argv; gint status; GError *error; @@ -267,6 +271,9 @@ g_assert (login != NULL); script = g_build_filename (dir, slave->priv->display_name, NULL); + snprintf(dispname, sizeof(dispname), "%s%s", slave->priv->display_name, ext); + script_custom = g_build_filename (dir, dispname, NULL); + g_debug ("GdmSlave: Trying script %s", script); if (! (g_file_test (script, G_FILE_TEST_IS_REGULAR) && g_file_test (script, G_FILE_TEST_IS_EXECUTABLE))) { @@ -275,6 +282,15 @@ script = NULL; } + g_debug ("GdmSlave: Trying script_custom %s", script_custom); + if (! (g_file_test (script_custom, G_FILE_TEST_IS_REGULAR) + && g_file_test (script_custom, G_FILE_TEST_IS_EXECUTABLE))) { + g_debug ("GdmSlave: script_custom %s not found; skipping", script_custom); + g_free (script_custom); + script_custom = NULL; + } + + if (script == NULL && slave->priv->display_hostname != NULL && slave->priv->display_hostname[0] != '\0') { @@ -288,6 +304,21 @@ } } + if (script_custom == NULL + && slave->priv->display_hostname != NULL + && slave->priv->display_hostname[0] != '\0') { + snprintf(disphost, sizeof(disphost), "%s%s", slave->priv->display_hostname, ext); + script_custom = g_build_filename (dir, disphost, NULL); + g_debug ("GdmSlave: Trying script_custom %s", script_custom); + if (! (g_file_test (script_custom, G_FILE_TEST_IS_REGULAR) + && g_file_test (script_custom, G_FILE_TEST_IS_EXECUTABLE))) { + g_debug ("GdmSlave: script_custom %s not found; skipping", script_custom); + g_free (script_custom); + script_custom = NULL; + } + } + + if (script == NULL) { script = g_build_filename (dir, "Default", NULL); g_debug ("GdmSlave: Trying script %s", script); @@ -299,16 +330,35 @@ } } - if (script == NULL) { + if (script_custom == NULL) { + script_custom = g_build_filename (dir, "Default.lliurex", NULL); + g_debug ("GdmSlave: Trying script_custom %s", script_custom); + if (! (g_file_test (script_custom, G_FILE_TEST_IS_REGULAR) + && g_file_test (script_custom, G_FILE_TEST_IS_EXECUTABLE))) { + g_debug ("GdmSlave: script_custom %s not found; skipping", script_custom); + g_free (script_custom); + script_custom = NULL; + } + } + + if (script == NULL && script_custom == NULL) { g_debug ("GdmSlave: no script found"); return TRUE; } create_temp_auth_file (slave); - g_debug ("GdmSlave: Running process: %s", script); + g_debug ("GdmSlave: Running process: %s %s", script, login); + error = NULL; + if (script != NULL && ! g_shell_parse_argv (script, NULL, &argv, &error)) { + g_warning ("Could not parse command: %s", error->message); + g_error_free (error); + goto out; + } + + g_debug ("GdmSlave: Running process: %s %s", script_custom, login); error = NULL; - if (! g_shell_parse_argv (script, NULL, &argv, &error)) { + if (script_custom != NULL && ! g_shell_parse_argv (script_custom, NULL, &argv, &error)) { g_warning ("Could not parse command: %s", error->message); g_error_free (error); goto out; @@ -346,6 +396,7 @@ out: g_free (script); + g_free (script_custom); return ret; } diff -Nuar gdm-2.30.2.is.2.30.0.orig/daemon/gdm-xdmcp-display-factory.c gdm-2.30.2.is.2.30.0/daemon/gdm-xdmcp-display-factory.c --- gdm-2.30.2.is.2.30.0.orig/daemon/gdm-xdmcp-display-factory.c 2010-06-28 10:47:04.809143208 +0200 +++ gdm-2.30.2.is.2.30.0/daemon/gdm-xdmcp-display-factory.c 2010-06-28 10:54:55.885642318 +0200 @@ -2844,12 +2844,14 @@ return TRUE; } + ss_len = (int)gdm_sockaddr_len (&clnt_ss); + res = XdmcpFill (factory->priv->socket_fd, &factory->priv->buf, (XdmcpNetaddr)&clnt_ss, &ss_len); if G_UNLIKELY (! res) { g_debug ("GdmXdmcpDisplayFactory: Could not create XDMCP buffer!"); return TRUE; } - ss_len = (int)gdm_sockaddr_len (&clnt_ss); + //ss_len = (int)gdm_sockaddr_len (&clnt_ss); res = XdmcpReadHeader (&factory->priv->buf, &header); if G_UNLIKELY (! res) { diff -Nuar gdm-2.30.2.is.2.30.0.orig/gui/simple-chooser/gdm-host-chooser-widget.c gdm-2.30.2.is.2.30.0/gui/simple-chooser/gdm-host-chooser-widget.c --- gdm-2.30.2.is.2.30.0.orig/gui/simple-chooser/gdm-host-chooser-widget.c 2010-03-29 23:42:03.000000000 +0200 +++ gdm-2.30.2.is.2.30.0/gui/simple-chooser/gdm-host-chooser-widget.c 2010-06-28 10:55:12.789142480 +0200 @@ -208,12 +208,14 @@ return TRUE; } + ss_len = (int)gdm_sockaddr_len (&clnt_ss); + res = XdmcpFill (widget->priv->socket_fd, &buf, (XdmcpNetaddr)&clnt_ss, &ss_len); if G_UNLIKELY (! res) { g_debug (_("XDMCP: Could not create XDMCP buffer!")); return TRUE; } - ss_len = (int)gdm_sockaddr_len (&clnt_ss); + //ss_len = (int)gdm_sockaddr_len (&clnt_ss); res = XdmcpReadHeader (&buf, &header); if G_UNLIKELY (! res) {