diff options
author | Lukasz Zalewski <lukas@dcs.qmul.ac.uk> | 2007-01-22 04:31:10 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2007-01-22 04:31:10 +0000 |
commit | 0916f4b7621ee1557f21d7e1240e7fb8c4a34be3 (patch) | |
tree | 05337fee25626e986c1d54bbbad9798a89d5f573 | |
parent | d41c6930665331d611fb522b8ee3fc39b0c20342 (diff) | |
download | gdm-0916f4b7621ee1557f21d7e1240e7fb8c4a34be3.tar.gz |
Fix for bug #352263 Created more verbose warnings when defaults.conf or
2007-01-21 Lukasz Zalewski <lukas@dcs.qmul.ac.uk>
Fix for bug #352263
* gui/gdmsetup.c: Created more verbose warnings when defaults.conf or
custom.conf are missing before terminating. Also all the error
messages are displayed using dialogs rather than stdout. This is
especially useful when gdmsetup is run from within login mamaner as
it doesn't leave users wondering why it didnt start-up. Also check if
gdm daemon is running is made before check for config files. In such
setup appropriate message is displayed rather than config file not
found.
* daemon/gdmconfig.c: Daemon will not start if main configuration file
(defaults.conf) is missing
* daemon/slave.c: gdmsetup will not be launched if coustom.conf config
file is missing
svn path=/trunk/; revision=4533
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | daemon/gdmconfig.c | 9 | ||||
-rw-r--r-- | daemon/slave.c | 14 | ||||
-rw-r--r-- | gui/gdmsetup.c | 36 |
4 files changed, 66 insertions, 9 deletions
@@ -1,3 +1,19 @@ +2007-01-21 Lukasz Zalewski <lukas@dcs.qmul.ac.uk> + + Fix for bug #352263 + * gui/gdmsetup.c: Created more verbose warnings when defaults.conf or + custom.conf are missing before terminating. Also all the error + messages are displayed using dialogs rather than stdout. This is + especially useful when gdmsetup is run from within login mamaner as + it doesn't leave users wondering why it didnt start-up. Also check if + gdm daemon is running is made before check for config files. In such + setup appropriate message is displayed rather than config file not + found. + * daemon/gdmconfig.c: Daemon will not start if main configuration file + (defaults.conf) is missing + * daemon/slave.c: gdmsetup will not be launched if coustom.conf config + file is missing + 2006-01-22 Brian Cameron <brian.cameron@sun.com> * gui/gdmsetup.desktop.in.in: Remove GenericName since the diff --git a/daemon/gdmconfig.c b/daemon/gdmconfig.c index f698153b..9f8b7ea4 100644 --- a/daemon/gdmconfig.c +++ b/daemon/gdmconfig.c @@ -2013,10 +2013,15 @@ gdm_config_parse (void) /* * It is okay if the custom_cfg file is missing, then just use - * main configuration file. If cfg is missing, then GDM will - * use the built-in defaults found in gdm.h. + * main configuration file. However if main config file does + * not exist we cannot continue and need to bail out. */ + cfg = gdm_get_default_config (&statbuf); + + if (cfg == NULL) + gdm_fail (_("%s: Main config file (defaults.conf) is missing. Aborting!"), "gdm_config_parse"); + config_file_mtime = statbuf.st_mtime; custom_cfg = gdm_get_custom_config (&statbuf); custom_config_file_mtime = statbuf.st_mtime; diff --git a/daemon/slave.c b/daemon/slave.c index 143b189b..97d46b12 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -1711,6 +1711,20 @@ run_config (GdmDisplay *display, struct passwd *pwent) { pid_t pid; + /* Lets check if custom.conf exists. If not there + is no point in launching gdmsetup as it will fail. + We don't need to worry about defaults.conf as + the daemon wont start without it + */ + if (gdm_get_custom_config_file() == NULL) { + gdm_error_box (d, + GTK_MESSAGE_ERROR, + _("Could not access configuration file (custom.conf). " + "Make sure that the file exists before launching " + " login manager config utility.")); + return; + } + /* Set the busy cursor */ if (d->dsp != NULL) { Cursor xcursor = XCreateFontCursor (d->dsp, GDK_WATCH); diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c index 534b3a8e..7a5af4d3 100644 --- a/gui/gdmsetup.c +++ b/gui/gdmsetup.c @@ -8370,28 +8370,50 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); + /* Lets check if gdm daemon is running + if no there is no point in continuing + */ + gdm_running = gdmcomm_check (TRUE); + if (gdm_running == FALSE) + exit (EXIT_FAILURE); + gtk_window_set_default_icon_from_file (DATADIR"/pixmaps/gdm-setup.png", NULL); glade_gnome_init(); - + /* Start using socket */ gdmcomm_comm_bulk_start (); - + config_file = gdm_common_get_config_file (); if (config_file == NULL) { /* Done using socket */ gdmcomm_comm_bulk_stop (); - g_print (_("Could not access GDM configuration file.\n")); + GtkWidget *dialog = ve_hig_dialog_new (NULL /* parent */, + GTK_DIALOG_MODAL /* flags */, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Could not access configuration file (defaults.conf)" + ""), + _("Make sure that the file exists before launching login manager config utility.")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); exit (EXIT_FAILURE); } custom_config_file = gdm_common_get_custom_config_file (); if (custom_config_file == NULL) { /* Done using socket */ gdmcomm_comm_bulk_stop (); - g_print (_("Could not access GDM configuration file.\n")); + GtkWidget *dialog = ve_hig_dialog_new (NULL /* parent */, + GTK_DIALOG_MODAL /* flags */, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Could not access configuration file (custom.conf)" + ""), + _("Make sure that the file exists before launching login manager config utility.")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); exit (EXIT_FAILURE); - } - - gdm_running = gdmcomm_check (FALSE); + } if (RUNNING_UNDER_GDM) { char *gtkrc; |