summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2009-02-26 20:05:01 +0000
committerBrian Cameron <bcameron@src.gnome.org>2009-02-26 20:05:01 +0000
commitc96c651ec28f5593625b96f7d5bbf5914646ae74 (patch)
tree10f4832445e3d159f3fdc90bbb2556d8afc85088
parent1cad284aa993b849eb0d517ce752860331e1e8ac (diff)
downloadgdm-c96c651ec28f5593625b96f7d5bbf5914646ae74.tar.gz
Provide better error reporting when GDM is unable to parse the command.
2009-02-26 Brian Cameron <brian.cameron@sun.com> * daemon/gdm.c, daemon/server.c: Provide better error reporting when GDM is unable to parse the command. Another partial fix for bug #530585. svn path=/branches/gnome-2-20/; revision=6734
-rw-r--r--ChangeLog6
-rw-r--r--daemon/gdm.c24
-rw-r--r--daemon/server.c19
3 files changed, 36 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index cb78c784..26d2d1a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-26 Brian Cameron <brian.cameron@sun.com>
+
+ * daemon/gdm.c, daemon/server.c: Provide better error reporting when
+ GDM is unable to parse the command. Another partial fix for bug
+ #530585.
+
2009-02-24 Brian Cameron <brian.cameron@sun.com>
* utils/gdm-ssh-session: Patch code so that the port value can be
diff --git a/daemon/gdm.c b/daemon/gdm.c
index 94ceeb6e..6bba5784 100644
--- a/daemon/gdm.c
+++ b/daemon/gdm.c
@@ -1874,16 +1874,24 @@ write_x_servers (GdmDisplay *d)
}
if (SERVER_IS_LOCAL (d)) {
- char **argv;
- char *command;
- int argc;
+ char **argv;
+ char *command;
+ int argc;
+ gboolean rc;
+
argc = 0;
argv = NULL;
- gdm_server_resolve_command_line (d,
- FALSE, /* resolve_flags */
- NULL, /* vtarg */
- &argc,
- &argv);
+ rc = gdm_server_resolve_command_line (d,
+ FALSE, /* resolve_flags */
+ NULL, /* vtarg */
+ &argc,
+ &argv);
+
+ if (rc == FALSE) {
+ g_free (file);
+ return;
+ }
+
command = g_strjoinv (" ", argv);
g_strfreev (argv);
VE_IGNORE_EINTR (fprintf (fp, "%s local %s\n", d->name, command));
diff --git a/daemon/server.c b/daemon/server.c
index ad0becb9..ed69f90e 100644
--- a/daemon/server.c
+++ b/daemon/server.c
@@ -988,6 +988,12 @@ gdm_server_resolve_command_line (GdmDisplay *disp,
g_shell_parse_argv (disp->command, &argc,
&argv, &error_p);
+ if (argv == NULL) {
+ gdm_debug ("Problem parsing server command <%s>",
+ disp->command ? disp->command : "(null)");
+ return FALSE;
+ }
+
if (argv[0] == NULL || argv[1] == NULL) {
g_strfreev (argv);
argv = svr_command;
@@ -1102,6 +1108,7 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg)
int logfd;
char *command;
pid_t pid;
+ gboolean rc;
if (d == NULL ||
ve_string_empty (d->command)) {
@@ -1124,11 +1131,13 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg)
/* Figure out the server command */
argv = NULL;
argc = 0;
- gdm_server_resolve_command_line (d,
- TRUE /* resolve flags */,
- vtarg,
- &argc,
- &argv);
+ rc = gdm_server_resolve_command_line (d,
+ TRUE /* resolve flags */,
+ vtarg,
+ &argc,
+ &argv);
+ if (rc == FALSE)
+ return;
/* Do not support additional session arguments with Xnest. */
if (d->type != TYPE_FLEXI_XNEST) {