summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--daemon/slave.c19
-rw-r--r--gui/gdmconfig.c58
-rw-r--r--gui/gdmsetup.c4
4 files changed, 78 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 484e4e76..2b946b42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2006-01-04 Brian Cameron <brian.cameron@sun.com>
+ * daemon/slave.c: Make error message more clear when session file
+ is invalid. Now it says what session file had the problem.
+ This fixes bug #322699.
+ * gui/gdmconfig.c: Now the gdm_config_get_xserver_details
+ function is more robust, and handles NULL return values
+ better and supports PRIORITY.
+ * gui/gdmsetup.c: Now that gdmconfig reads in the priority value,
+ gdmsetup will write it back out if that server is modified.
+ However, gdmsetup still doesn't allow you to modify the
+ priority value. Probably should add a spinbutton to the
+ dialog.
+
+2006-01-04 Brian Cameron <brian.cameron@sun.com>
+
* configure.ac, gui/gdmsetup.c, vicious-extensions/Makefile.am: No
longer require libgnome or libgnomeui at all in GDM2. Patch
provided by Jani Monoses.
diff --git a/daemon/slave.c b/daemon/slave.c
index cc3074de..d9b789df 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -3522,21 +3522,24 @@ session_child_run (struct passwd *pwent,
if (strcmp (session, GDM_SESSION_FAILSAFE_XTERM) != 0 &&
strcmp (session, GDM_SESSION_FAILSAFE_GNOME) != 0) {
exec = gdm_get_session_exec (session,
- FALSE /* check_try_exec */);
+ FALSE /* check_try_exec */);
+
if G_UNLIKELY (exec == NULL) {
- gdm_error (_("%s: No Exec line in the session file: %s. Starting failsafe GNOME"),
- "session_child_run",
- session);
+ gchar *msg = g_strdup_printf (
+ _("No Exec line in the session file: %s. Running the GNOME failsafe session instead"),
+ session);
+
+ gdm_error (_("%s: %s"), "session_child_run", msg);
+ gdm_error_box (d, GTK_MESSAGE_ERROR, msg);
+ g_free (msg);
+
session = GDM_SESSION_FAILSAFE_GNOME;
- gdm_error_box
- (d, GTK_MESSAGE_ERROR,
- _("The session you selected does not look valid. Running the GNOME failsafe session instead."));
} else {
/* HACK!, if failsafe, we really wish to run the
internal one */
if (strcmp (exec, "failsafe") == 0) {
session = GDM_SESSION_FAILSAFE_XTERM;
- exec = NULL;
+ exec = NULL;
}
}
}
diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c
index bf4f4e64..b9446b2d 100644
--- a/gui/gdmconfig.c
+++ b/gui/gdmconfig.c
@@ -193,7 +193,6 @@ gdm_config_get_xservers (gboolean flexible)
gchar *command = NULL;
gchar *result = NULL;
gchar *temp;
- gboolean tempbool;
command = g_strdup_printf ("GET_SERVER_LIST");
result = gdmcomm_call_gdm (command, NULL /* auth cookie */,
@@ -221,37 +220,78 @@ gdm_config_get_xservers (gboolean flexible)
while (*sec != NULL) {
GdmXserver *svr = g_new0 (GdmXserver, 1);
+ gchar *temp;
- svr->id = gdm_config_get_xserver_details (*sec, "ID");
- svr->name = gdm_config_get_xserver_details (*sec, "NAME");
- svr->command = gdm_config_get_xserver_details (*sec, "COMMAND");
+ temp = gdm_config_get_xserver_details (*sec, "ID");
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ }
+ svr->id = temp;
+ temp = gdm_config_get_xserver_details (*sec, "NAME");
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ }
+ svr->name = temp;
+ temp = gdm_config_get_xserver_details (*sec, "COMMAND");
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ }
+ svr->command = temp;
temp = gdm_config_get_xserver_details (*sec, "FLEXIBLE");
- if (g_strncasecmp (temp, "true", 4) == 0)
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ } else if (g_strncasecmp (ve_sure_string (temp), "true", 4) == 0)
svr->flexible = TRUE;
else
svr->flexible = FALSE;
+
temp = gdm_config_get_xserver_details (*sec, "CHOOSABLE");
- if (g_strncasecmp (temp, "true", 4) == 0)
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ } else if (g_strncasecmp (temp, "true", 4) == 0)
svr->choosable = TRUE;
else
svr->choosable = FALSE;
+
temp = gdm_config_get_xserver_details (*sec, "HANDLED");
- if (g_strncasecmp (temp, "true", 4) == 0)
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ } else if (g_strncasecmp (temp, "true", 4) == 0)
svr->handled = TRUE;
else
svr->handled = FALSE;
+
temp = gdm_config_get_xserver_details (*sec, "CHOOSER");
- if (g_strncasecmp (temp, "true", 4) == 0)
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ } else if (g_strncasecmp (temp, "true", 4) == 0)
svr->chooser = TRUE;
else
svr->chooser = FALSE;
+ temp = gdm_config_get_xserver_details (*sec, "PRIORITY");
+ if (temp == NULL) {
+ g_free (svr);
+ continue;
+ } else {
+ svr->priority = atoi (temp);
+ }
+
sec++;
/* If only flexible was requested, then skip if not flexible */
- if (flexible && !svr->flexible)
+ if (flexible && !svr->flexible) {
+ g_free (svr);
continue;
+ }
xservers = g_slist_append (xservers, svr);
}
diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c
index 1f8332ab..c6818840 100644
--- a/gui/gdmsetup.c
+++ b/gui/gdmsetup.c
@@ -896,6 +896,10 @@ update_xserver (gchar *section, GdmXserver *svr)
ve_config_set_bool (custom_cfg, key, svr->flexible);
g_free (key);
+ key = g_strconcat (real_section, "/" GDM_KEY_SERVER_PRIORITY, NULL);
+ ve_config_set_int (custom_cfg, key, svr->priority);
+ g_free (key);
+
g_free (real_section);
ve_config_save (custom_cfg, FALSE);