Commit 0916f4b7 authored by Lukasz Zalewski's avatar Lukasz Zalewski Committed by Brian Cameron

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
parent d41c6930
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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment