summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2001-12-28 00:15:05 +0000
committerGeorge Lebl <jirka@src.gnome.org>2001-12-28 00:15:05 +0000
commita474faf10fcae4dd0183c992d5df8d00bd71588a (patch)
treea224b298de9013c86aec0b0cd71bb4b990583fe7
parentd875ba070c9cd26b35bec080f04675020d24ac95 (diff)
downloadgdm-a474faf10fcae4dd0183c992d5df8d00bd71588a.tar.gz
don't link libgnomeui and libglade to the daemon any more
Thu Dec 27 16:43:21 2001 George Lebl <jirka@5z.com> * configure.in: don't link libgnomeui and libglade to the daemon any more * daemon/errorgui.[ch], daemon/gdm.c, daemon/slave.c, daemon/verify-*.c: Whack the exec hack for failsafe dialogs, we now yet again do this all just by fork and gtk_init. This seems to work and is truly failsafe * daemon/gdm-net.c: fix hanging caused by some new crack in giochannel, we just do a libc 'read' and that works * daemon/server.c, daemon/gdm.[ch]: again some new crack in glib's mainloop was causing g_main_loop_quit to not work right if called from a signal handler (sometimes). So I just switched to using a simple select call and a dummy pipe. * daemon/Makefile.am, daemon/auth.c, daemon/errorgui.c, daemon/gdm-net.c, daemon/gdm.c, daemon/server.c, daemon/slave.c, daemon/verify-crypt.c, daemon/verify-pam.c, daemon/verify-shadow.c, daemon/xdmcp.c: Compile without any deprecated stuff from glib up
-rw-r--r--ChangeLog23
-rw-r--r--NEWS21
-rw-r--r--configure.in2
-rw-r--r--daemon/Makefile.am6
-rw-r--r--daemon/auth.c12
-rw-r--r--daemon/errorgui.c523
-rw-r--r--daemon/errorgui.h24
-rw-r--r--daemon/gdm-net.c19
-rw-r--r--daemon/gdm.c71
-rw-r--r--daemon/gdm.h3
-rw-r--r--daemon/server.c58
-rw-r--r--daemon/slave.c77
-rw-r--r--daemon/verify-crypt.c4
-rw-r--r--daemon/verify-pam.c17
-rw-r--r--daemon/verify-shadow.c4
-rw-r--r--daemon/xdmcp.c2
16 files changed, 416 insertions, 450 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ae04407..92686d84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+Thu Dec 27 16:43:21 2001 George Lebl <jirka@5z.com>
+
+ * configure.in: don't link libgnomeui and libglade to the
+ daemon any more
+
+ * daemon/errorgui.[ch], daemon/gdm.c, daemon/slave.c,
+ daemon/verify-*.c: Whack the exec hack for failsafe dialogs,
+ we now yet again do this all just by fork and gtk_init. This
+ seems to work and is truly failsafe
+
+ * daemon/gdm-net.c: fix hanging caused by some new crack in
+ giochannel, we just do a libc 'read' and that works
+
+ * daemon/server.c, daemon/gdm.[ch]: again some new crack in glib's
+ mainloop was causing g_main_loop_quit to not work right if called
+ from a signal handler (sometimes). So I just switched to using
+ a simple select call and a dummy pipe.
+
+ * daemon/Makefile.am, daemon/auth.c, daemon/errorgui.c,
+ daemon/gdm-net.c, daemon/gdm.c, daemon/server.c, daemon/slave.c,
+ daemon/verify-crypt.c, daemon/verify-pam.c, daemon/verify-shadow.c,
+ daemon/xdmcp.c: Compile without any deprecated stuff from glib up
+
Thu Dec 27 14:04:27 2001 George Lebl <jirka@5z.com>
* gui/Makefile.am: remove gdmchooser.h
diff --git a/NEWS b/NEWS
index 846066f3..7ffa11cc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,26 @@
Ahh news...
+2.3.90.0 stuff:
+
+- All changes up to 2.2.5.3
+
+- Ported to GNOME 2, still uses some deprecated widgets and such,
+ but it should be fully functional
+
+- A little bit of code restructuring and cleanup
+
+- Add option to preserve LD_ variables to allow easy debugging
+
+- Docs use XML and bunch of other doc updates (Trevor Curtis)
+
+- Removed font for welcome message, the welcome message now supports
+ standard pango xml-like markup
+
+- Failsafe gui dialogs are pure gtk now and do not require an exec
+
+- Translation updates mostly overlap 2.2.5.3. It's also probably
+ all broken now, I think we need to convert to utf8 or some such
+
2.2.5.3 stuff:
- PAM support revamped. Session open and credentials are done before
diff --git a/configure.in b/configure.in
index 75c18831..83a4d2c4 100644
--- a/configure.in
+++ b/configure.in
@@ -106,7 +106,7 @@ AM_PROG_LIBTOOL
GNOME_PLATFORM_GNOME_2(yes)
GNOME_COMPILE_WARNINGS(maximum)
-PKG_CHECK_MODULES(DAEMON, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
+PKG_CHECK_MODULES(DAEMON, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED gtk+-2.0 >= $GTK_REQUIRED libgnome-2.0 >= $LIBGNOME_REQUIRED)
AC_SUBST(DAEMON_CFLAGS)
AC_SUBST(DAEMON_LIBS)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index abfe8cff..12d7cbe0 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -8,6 +8,11 @@ DEFS = @DEFS@ -DGDM_CONFIG_FILE=\"@sysconfdir@/gdm/gdm.conf\"
INCLUDES = \
-I. \
-I.. \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED \
+ -DGNOME_DISABLE_DEPRECATED \
-I$(top_srcdir)/vicious-extensions \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DLOCALEDIR=\"$(datadir)/locale\" \
@@ -15,6 +20,7 @@ INCLUDES = \
-DPAM_PREFIX=\"$(PAM_PREFIX)\" \
$(GNOME_INCLUDEDIR)
+
bin_PROGRAMS = gdm
gdm_SOURCES = \
diff --git a/daemon/auth.c b/daemon/auth.c
index b6a92b7e..9e81779a 100644
--- a/daemon/auth.c
+++ b/daemon/auth.c
@@ -445,7 +445,7 @@ void
gdm_auth_user_remove (GdmDisplay *d, uid_t user)
{
FILE *af;
- const gchar *authfile;
+ gchar *authfile;
gchar *authdir;
if (!d || !d->userauth)
@@ -462,22 +462,24 @@ gdm_auth_user_remove (GdmDisplay *d, uid_t user)
return;
}
- authfile = g_basename (d->userauth);
- authdir = g_dirname (d->userauth);
+ authfile = g_path_get_basename (d->userauth);
+ authdir = g_path_get_dirname (d->userauth);
/* Now, the cookie file could be owned by a malicious user who
* decided to concatenate something like his entire MP3 collection
* to it. So we better play it safe... */
- if (! gdm_file_check ("gdm_auth_user_remove", user, authdir, authfile,
- TRUE, GdmUserMaxFile, GdmRelaxPerms)) {
+ if ( ! gdm_file_check ("gdm_auth_user_remove", user, authdir, authfile,
+ TRUE, GdmUserMaxFile, GdmRelaxPerms)) {
g_free (authdir);
+ g_free (authfile);
gdm_error (_("gdm_auth_user_remove: Ignoring suspiciously looking cookie file %s"), d->userauth);
return;
}
g_free (authdir);
+ g_free (authfile);
/* Lock user's cookie jar and open it for writing */
if (XauLockAuth (d->userauth, 3, 3, 0) != LOCK_SUCCESS)
diff --git a/daemon/errorgui.c b/daemon/errorgui.c
index c387d142..7c98522e 100644
--- a/daemon/errorgui.c
+++ b/daemon/errorgui.c
@@ -21,7 +21,7 @@
#include <config.h>
#include <libgnome/libgnome.h>
-#include <libgnomeui/libgnomeui.h>
+#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <unistd.h>
#include <sys/types.h>
@@ -61,83 +61,23 @@ gdm_event (GSignalInvocationHint *ihint,
}
void
-gdm_run_errorgui (const char *error,
- const char *dialog_type,
- int screenx,
- int screeny,
- int screenwidth,
- int screenheight)
-{
- GtkWidget *dialog;
- GtkRequisition req;
- guint sid;
- char *argv[2] = { "gdm-error-box", NULL };
-
- gnome_program_init ("gdm-error-box", VERSION,
- LIBGNOMEUI_MODULE,
- 1, argv,
- /* Avoid creating ~gdm/.gnome stuff */
- "create-directories", FALSE,
- NULL);
-
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- dialog = gnome_message_box_new (error,
- dialog_type,
- GNOME_STOCK_BUTTON_OK,
- NULL);
- gtk_widget_show (dialog);
-
- gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
- GTK_SIGNAL_FUNC(gtk_main_quit),
- NULL);
-
- gtk_widget_size_request (dialog, &req);
-
- if (screenwidth <= 0)
- screenwidth = gdk_screen_width ();
- if (screenheight <= 0)
- screenheight = gdk_screen_height ();
-
- gtk_widget_set_uposition (dialog,
- screenx +
- (screenwidth / 2) -
- (req.width / 2),
- screeny +
- (screenheight / 2) -
- (req.height / 2));
-
- gtk_widget_show_now (dialog);
-
- if (dialog->window != NULL) {
- gdk_error_trap_push ();
- XSetInputFocus (GDK_DISPLAY (),
- GDK_WINDOW_XWINDOW (dialog->window),
- RevertToPointerRoot,
- CurrentTime);
- gdk_flush ();
- gdk_error_trap_pop ();
- }
-
- gtk_main ();
-}
-
-void
-gdm_error_box (GdmDisplay *d, const char *dialog_type, const char *error)
+gdm_error_box (GdmDisplay *d, GtkMessageType type, const char *error)
{
pid_t pid;
pid = gdm_fork_extra ();
if (pid == 0) {
- char *geom;
+ guint sid;
int i;
+ int argc = 1;
+ char **argv;
+ GtkWidget *dlg;
+ GtkRequisition req;
+ int screenx = 0;
+ int screeny = 0;
+ int screenwidth = 0;
+ int screenheight = 0;
for (i = 0; i < sysconf (_SC_OPEN_MAX); i++)
close(i);
@@ -151,27 +91,63 @@ gdm_error_box (GdmDisplay *d, const char *dialog_type, const char *error)
seteuid (getuid ());
setegid (getgid ());
- if (d != NULL)
- geom = g_strdup_printf ("%d:%d:%d:%d",
- d->screenx,
- d->screeny,
- d->screenwidth,
- d->screenheight);
- else
- geom = "0:0:0:0";
-
- if (stored_path != NULL)
- gnome_setenv ("PATH", stored_path, TRUE);
-
- execlp (stored_argv[0],
- stored_argv[0],
- "--run-error-dialog",
- error,
- dialog_type,
- geom,
- NULL);
- gdm_error (_("gdm_error_box: Failed to execute self"));
- _exit (1);
+ argv = g_new0 (char *, 2);
+ argv[0] = "gtk-error-box";
+
+ gtk_init (&argc, &argv);
+
+ if (d != NULL) {
+ screenx = d->screenx;
+ screeny = d->screeny;
+ screenwidth = d->screenwidth;
+ screenheight = d->screenheight;
+ }
+
+ if (screenwidth <= 0)
+ screenwidth = gdk_screen_width ();
+ if (screenheight <= 0)
+ screenheight = gdk_screen_height ();
+
+ dlg = gtk_message_dialog_new (NULL /* parent */,
+ 0 /* flags */,
+ type,
+ GTK_BUTTONS_OK,
+ "%s",
+ error);
+
+ sid = g_signal_lookup ("event",
+ GTK_TYPE_WIDGET);
+ g_signal_add_emission_hook (sid,
+ 0 /* detail */,
+ gdm_event,
+ NULL /* data */,
+ NULL /* destroy_notify */);
+
+ gtk_widget_size_request (dlg, &req);
+
+ gtk_window_move (GTK_WINDOW (dlg),
+ screenx +
+ (screenwidth / 2) -
+ (req.width / 2),
+ screeny +
+ (screenheight / 2) -
+ (req.height / 2));
+
+ gtk_widget_show_now (dlg);
+
+ if (dlg->window != NULL) {
+ gdk_error_trap_push ();
+ XSetInputFocus (GDK_DISPLAY (),
+ GDK_WINDOW_XWINDOW (dlg->window),
+ RevertToPointerRoot,
+ CurrentTime);
+ gdk_flush ();
+ gdk_error_trap_pop ();
+ }
+
+ gtk_dialog_run (GTK_DIALOG (dlg));
+
+ _exit (0);
} else if (pid > 0) {
gdm_wait_for_extra (NULL);
} else {
@@ -179,90 +155,11 @@ gdm_error_box (GdmDisplay *d, const char *dialog_type, const char *error)
}
}
-char *
-gdm_run_failsafe_question (const char *question,
- gboolean echo,
- int screenx,
- int screeny,
- int screenwidth,
- int screenheight)
+static void
+press_ok (GtkWidget *entry, gpointer data)
{
- GtkWidget *dialog;
- GtkRequisition req;
- guint sid;
- GtkWidget *entry, *label;
- char *ret;
- char *argv[2] = { "gdm-failsafe-question", NULL };
-
- gnome_program_init ("gdm-failsafe-question", VERSION,
- LIBGNOMEUI_MODULE,
- 1, argv,
- /* Avoid creating ~gdm/.gnome stuff */
- "create-directories", FALSE,
- NULL);
-
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- dialog = gnome_dialog_new (question,
- GNOME_STOCK_BUTTON_OK,
- NULL);
- gnome_dialog_close_hides (GNOME_DIALOG (dialog),
- TRUE /* just_hide */);
-
- label = gtk_label_new (question);
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
- label, FALSE, FALSE, 0);
- entry = gtk_entry_new ();
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
- entry, FALSE, FALSE, 0);
- if ( ! echo)
- gtk_entry_set_visibility (GTK_ENTRY (entry),
- FALSE /* visible */);
- gnome_dialog_editable_enters (GNOME_DIALOG (dialog),
- GTK_EDITABLE (entry));
-
- gtk_widget_show_all (dialog);
-
- gtk_widget_size_request (dialog, &req);
-
- if (screenwidth <= 0)
- screenwidth = gdk_screen_width ();
- if (screenheight <= 0)
- screenheight = gdk_screen_height ();
-
- gtk_widget_set_uposition (dialog,
- screenx +
- (screenwidth / 2) -
- (req.width / 2),
- screeny +
- (screenheight / 2) -
- (req.height / 2));
-
- gtk_widget_grab_focus (entry);
-
- gtk_widget_show_now (dialog);
-
- if (dialog->window != NULL) {
- gdk_error_trap_push ();
- XSetInputFocus (GDK_DISPLAY (),
- GDK_WINDOW_XWINDOW (dialog->window),
- RevertToPointerRoot,
- CurrentTime);
- gdk_flush ();
- gdk_error_trap_pop ();
- }
-
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- ret = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
- gtk_widget_destroy (dialog);
- return ret;
+ GtkWidget *dlg = data;
+ gtk_dialog_response (GTK_DIALOG (dlg), GTK_RESPONSE_OK);
}
char *
@@ -278,46 +175,104 @@ gdm_failsafe_question (GdmDisplay *d,
pid = gdm_fork_extra ();
if (pid == 0) {
- char *geom;
+ guint sid;
int i;
+ int argc = 1;
+ char **argv;
+ GtkWidget *dlg, *label, *entry;
+ GtkRequisition req;
+ int screenx = 0;
+ int screeny = 0;
+ int screenwidth = 0;
+ int screenheight = 0;
- for (i = 0; i < sysconf (_SC_OPEN_MAX); i++) {
- if (p[1] != i)
- close(i);
- }
+ for (i = 0; i < sysconf (_SC_OPEN_MAX); i++)
+ close(i);
/* No error checking here - if it's messed the best response
- * is to ignore & try to continue */
+ * is to ignore & try to continue */
open ("/dev/null", O_RDONLY); /* open stdin - fd 0 */
open ("/dev/null", O_RDWR); /* open stdout - fd 1 */
open ("/dev/null", O_RDWR); /* open stderr - fd 2 */
- /* The pipe on stdout */
- dup2 (p[1], 1);
-
seteuid (getuid ());
setegid (getgid ());
- if (d != NULL)
- geom = g_strdup_printf ("%d:%d:%d:%d",
- d->screenx,
- d->screeny,
- d->screenwidth,
- d->screenheight);
- else
- geom = "0:0:0:0";
-
- if (stored_path != NULL)
- gnome_setenv ("PATH", stored_path, TRUE);
- execlp (stored_argv[0],
- stored_argv[0],
- "--run-failsafe-question",
- question,
- echo ? "TRUE" : "FALSE",
- geom,
- NULL);
- gdm_error (_("gdm_failsafe_question: Failed to execute self"));
- _exit (1);
+ argv = g_new0 (char *, 2);
+ argv[0] = "gtk-failsafe-question";
+
+ gtk_init (&argc, &argv);
+
+ if (d != NULL) {
+ screenx = d->screenx;
+ screeny = d->screeny;
+ screenwidth = d->screenwidth;
+ screenheight = d->screenheight;
+ }
+
+ if (screenwidth <= 0)
+ screenwidth = gdk_screen_width ();
+ if (screenheight <= 0)
+ screenheight = gdk_screen_height ();
+
+ dlg = gtk_dialog_new_with_buttons (question,
+ NULL /* parent */,
+ 0 /* flags */,
+ GTK_STOCK_OK,
+ GTK_RESPONSE_OK,
+ NULL);
+ g_signal_connect (G_OBJECT (dlg), "delete_event",
+ G_CALLBACK (gtk_true), NULL);
+
+ label = gtk_label_new (question);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),
+ label, FALSE, FALSE, 0);
+ entry = gtk_entry_new ();
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),
+ entry, FALSE, FALSE, 0);
+ if ( ! echo)
+ gtk_entry_set_visibility (GTK_ENTRY (entry),
+ FALSE /* visible */);
+ g_signal_connect (G_OBJECT (entry), "activate",
+ G_CALLBACK (press_ok), dlg);
+
+ sid = g_signal_lookup ("event",
+ GTK_TYPE_WIDGET);
+ g_signal_add_emission_hook (sid,
+ 0 /* detail */,
+ gdm_event,
+ NULL /* data */,
+ NULL /* destroy_notify */);
+
+ gtk_widget_size_request (dlg, &req);
+
+ gtk_window_move (GTK_WINDOW (dlg),
+ screenx +
+ (screenwidth / 2) -
+ (req.width / 2),
+ screeny +
+ (screenheight / 2) -
+ (req.height / 2));
+
+ gtk_widget_show_now (dlg);
+
+ if (dlg->window != NULL) {
+ gdk_error_trap_push ();
+ XSetInputFocus (GDK_DISPLAY (),
+ GDK_WINDOW_XWINDOW (dlg->window),
+ RevertToPointerRoot,
+ CurrentTime);
+ gdk_flush ();
+ gdk_error_trap_pop ();
+ }
+
+ gtk_widget_grab_focus (entry);
+
+ gtk_dialog_run (GTK_DIALOG (dlg));
+
+ g_print (ve_sure_string (gtk_entry_get_text (GTK_ENTRY (entry))));
+
+ _exit (0);
} else if (pid > 0) {
char buf[BUFSIZ];
int bytes;
@@ -340,74 +295,6 @@ gdm_failsafe_question (GdmDisplay *d,
}
gboolean
-gdm_run_failsafe_yesno (const char *question,
- int screenx,
- int screeny,
- int screenwidth,
- int screenheight)
-{
- GtkWidget *dialog;
- GtkRequisition req;
- guint sid;
- char *argv[2] = { "gdm-failsafe-yesno", NULL };
-
- gnome_program_init ("gdm-failsafe-yesno", VERSION,
- LIBGNOMEUI_MODULE,
- 1, argv,
- /* Avoid creating ~gdm/.gnome stuff */
- "create-directories", FALSE,
- NULL);
-
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- dialog = gnome_message_box_new (question,
- GNOME_MESSAGE_BOX_QUESTION,
- GNOME_STOCK_BUTTON_YES,
- GNOME_STOCK_BUTTON_NO,
- NULL);
-
- gtk_widget_show_all (dialog);
-
- gtk_widget_size_request (dialog, &req);
-
- if (screenwidth <= 0)
- screenwidth = gdk_screen_width ();
- if (screenheight <= 0)
- screenheight = gdk_screen_height ();
-
- gtk_widget_set_uposition (dialog,
- screenx +
- (screenwidth / 2) -
- (req.width / 2),
- screeny +
- (screenheight / 2) -
- (req.height / 2));
-
- gtk_widget_show_now (dialog);
-
- if (dialog->window != NULL) {
- gdk_error_trap_push ();
- XSetInputFocus (GDK_DISPLAY (),
- GDK_WINDOW_XWINDOW (dialog->window),
- RevertToPointerRoot,
- CurrentTime);
- gdk_flush ();
- gdk_error_trap_pop ();
- }
-
- if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-gboolean
gdm_failsafe_yesno (GdmDisplay *d,
const char *question)
{
@@ -419,8 +306,16 @@ gdm_failsafe_yesno (GdmDisplay *d,
pid = gdm_fork_extra ();
if (pid == 0) {
- char *geom;
+ guint sid;
int i;
+ int argc = 1;
+ char **argv;
+ GtkWidget *dlg;
+ GtkRequisition req;
+ int screenx = 0;
+ int screeny = 0;
+ int screenwidth = 0;
+ int screenheight = 0;
for (i = 0; i < sysconf (_SC_OPEN_MAX); i++) {
if (p[1] != i)
@@ -428,36 +323,74 @@ gdm_failsafe_yesno (GdmDisplay *d,
}
/* No error checking here - if it's messed the best response
- * is to ignore & try to continue */
+ * is to ignore & try to continue */
open ("/dev/null", O_RDONLY); /* open stdin - fd 0 */
open ("/dev/null", O_RDWR); /* open stdout - fd 1 */
open ("/dev/null", O_RDWR); /* open stderr - fd 2 */
- /* The pipe on stdout */
- dup2 (p[1], 1);
-
seteuid (getuid ());
setegid (getgid ());
- if (d != NULL)
- geom = g_strdup_printf ("%d:%d:%d:%d",
- d->screenx,
- d->screeny,
- d->screenwidth,
- d->screenheight);
+ argv = g_new0 (char *, 2);
+ argv[0] = "gtk-failsafe-yesno";
+
+ gtk_init (&argc, &argv);
+
+ if (d != NULL) {
+ screenx = d->screenx;
+ screeny = d->screeny;
+ screenwidth = d->screenwidth;
+ screenheight = d->screenheight;
+ }
+
+ if (screenwidth <= 0)
+ screenwidth = gdk_screen_width ();
+ if (screenheight <= 0)
+ screenheight = gdk_screen_height ();
+
+ dlg = gtk_message_dialog_new (NULL /* parent */,
+ 0 /* flags */,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ "%s",
+ question);
+
+ sid = g_signal_lookup ("event",
+ GTK_TYPE_WIDGET);
+ g_signal_add_emission_hook (sid,
+ 0 /* detail */,
+ gdm_event,
+ NULL /* data */,
+ NULL /* destroy_notify */);
+
+ gtk_widget_size_request (dlg, &req);
+
+ gtk_window_move (GTK_WINDOW (dlg),
+ screenx +
+ (screenwidth / 2) -
+ (req.width / 2),
+ screeny +
+ (screenheight / 2) -
+ (req.height / 2));
+
+ gtk_widget_show_now (dlg);
+
+ if (dlg->window != NULL) {
+ gdk_error_trap_push ();
+ XSetInputFocus (GDK_DISPLAY (),
+ GDK_WINDOW_XWINDOW (dlg->window),
+ RevertToPointerRoot,
+ CurrentTime);
+ gdk_flush ();
+ gdk_error_trap_pop ();
+ }
+
+ if (gtk_dialog_run (GTK_DIALOG (dlg)) == GTK_RESPONSE_YES)
+ g_print ("yes\n");
else
- geom = "0:0:0:0";
-
- if (stored_path != NULL)
- gnome_setenv ("PATH", stored_path, TRUE);
- execlp (stored_argv[0],
- stored_argv[0],
- "--run-failsafe-yesno",
- question,
- geom,
- NULL);
- gdm_error (_("gdm_failsafe_question: Failed to execute self"));
- _exit (1);
+ g_print ("no\n");
+
+ _exit (0);
} else if (pid > 0) {
char buf[BUFSIZ];
int bytes;
diff --git a/daemon/errorgui.h b/daemon/errorgui.h
index 58e010c9..1db8c17c 100644
--- a/daemon/errorgui.h
+++ b/daemon/errorgui.h
@@ -20,36 +20,16 @@
#define GDM_ERRORGUI_H
#include "gdm.h"
+#include <gtk/gtkmessagedialog.h>
-/* this includes the actual gtk interface */
-void gdm_run_errorgui (const char *error,
- const char *dialog_type,
- int screenx,
- int screeny,
- int screenwidth,
- int screenheight);
-/* this spawns self with the argument to run the above */
void gdm_error_box (GdmDisplay *d,
- const char *dialog_type,
+ GtkMessageType type,
const char *error);
-char * gdm_run_failsafe_question(const char *question,
- gboolean echo,
- int screenx,
- int screeny,
- int screenwidth,
- int screenheight);
-/* this spawns self with the argument to run the above */
char * gdm_failsafe_question (GdmDisplay *d,
const char *question,
gboolean echo);
-gboolean gdm_run_failsafe_yesno (const char *question,
- int screenx,
- int screeny,
- int screenwidth,
- int screenheight);
-/* this spawns self with the argument to run the above */
gboolean gdm_failsafe_yesno (GdmDisplay *d,
const char *question);
diff --git a/daemon/gdm-net.c b/daemon/gdm-net.c
index 1a0ac19b..8c7e7c2a 100644
--- a/daemon/gdm-net.c
+++ b/daemon/gdm-net.c
@@ -92,21 +92,18 @@ gdm_connection_handler (GIOChannel *source,
gpointer data)
{
GdmConnection *conn = data;
- gchar buf[PIPE_SIZE];
+ char buf[PIPE_SIZE];
char *p;
- gsize len;
+ size_t len;
if ( ! (cond & G_IO_IN))
return close_if_needed (conn, cond);
- if (g_io_channel_read (source, buf, sizeof (buf) - 1, &len)
- != G_IO_ERROR_NONE)
- return close_if_needed (conn, cond);
-
- if (len <= 0)
+ len = read (conn->fd, buf, sizeof (buf) -1);
+ if (len <= 0) {
return close_if_needed (conn, cond);
+ }
- /* null terminate as the string is NOT */
buf[len] = '\0';
if (conn->buffer == NULL)
@@ -224,6 +221,8 @@ gdm_socket_handler (GIOChannel *source,
}
unixchan = g_io_channel_unix_new (newconn->fd);
+ g_io_channel_set_buffered (unixchan, FALSE);
+
newconn->source = g_io_add_watch_full
(unixchan, G_PRIORITY_DEFAULT,
G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
@@ -275,6 +274,8 @@ gdm_connection_open_unix (const char *sockname, mode_t mode)
conn->n_subconnections = 0;
unixchan = g_io_channel_unix_new (conn->fd);
+ g_io_channel_set_buffered (unixchan, FALSE);
+
conn->source = g_io_add_watch_full
(unixchan, G_PRIORITY_DEFAULT,
G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
@@ -323,6 +324,8 @@ gdm_connection_open_fifo (const char *fifo, mode_t mode)
conn->n_subconnections = 0;
fifochan = g_io_channel_unix_new (conn->fd);
+ g_io_channel_set_buffered (fifochan, FALSE);
+
conn->source = g_io_add_watch_full
(fifochan, G_PRIORITY_DEFAULT,
G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
diff --git a/daemon/gdm.c b/daemon/gdm.c
index f4f47485..4c23fa1d 100644
--- a/daemon/gdm.c
+++ b/daemon/gdm.c
@@ -48,7 +48,6 @@
#include "verify.h"
#include "display.h"
#include "choose.h"
-#include "errorgui.h"
#include "gdm-net.h"
/* Local functions */
@@ -160,6 +159,8 @@ char *stored_path = NULL;
static gboolean gdm_restart_mode = FALSE;
+static GMainLoop *main_loop = NULL;
+
static gboolean
display_exists (int num)
{
@@ -1149,7 +1150,7 @@ gdm_cleanup_children (void)
if (gdm_restart_mode)
gdm_safe_restart ();
- gdm_quit ();
+ g_main_loop_quit (main_loop);
return TRUE;
}
@@ -1225,8 +1226,6 @@ signal_notify (int sig)
* main: The main daemon control
*/
-static GMainLoop *main_loop;
-
static void
store_argv (int argc, char *argv[])
{
@@ -1287,53 +1286,6 @@ main (int argc, char *argv[])
bindtextdomain(PACKAGE, GNOMELOCALEDIR);
textdomain(PACKAGE);
- /* This is an utter hack. BUT we don't want to have the message in
- * another program as it is supposed to be a last ditch effort to talk
- * to the user, so what happens is that we respawn ourselves with
- * an argument --run-error-dialog error dialog_type <x>:<y>:<width>:<height>
- * the coordinates are the coordinates of this screen (when using
- * xinerama) they can all be 0 */
- if (argc == 5 &&
- strcmp (argv[1], "--run-error-dialog") == 0) {
- int x = 0, y = 0, width = 0, height = 0;
- sscanf (argv[4], "%d:%d:%d:%d", &x, &y, &width, &height);
- gdm_run_errorgui (argv[2], argv[3], x, y, width, height);
- _exit (0);
- }
- /* This is another utter hack. Same as above but for questions */
- if (argc == 5 &&
- strcmp (argv[1], "--run-failsafe-question") == 0) {
- int x = 0, y = 0, width = 0, height = 0;
- gboolean echo;
- char *ret;
- sscanf (argv[4], "%d:%d:%d:%d", &x, &y, &width, &height);
- if (strcmp (argv[3], "FALSE") == 0)
- echo = FALSE;
- else
- echo = TRUE;
- ret = gdm_run_failsafe_question (argv[2], echo, x, y, width, height);
- if (ret != NULL) {
- g_print (ret);
- fflush (stdout);
- }
- _exit (0);
- }
- /* This is another utter hack. Same as above but for yes/no questions */
- if (argc == 4 &&
- strcmp (argv[1], "--run-failsafe-yesno") == 0) {
- int x = 0, y = 0, width = 0, height = 0;
- gboolean ret;
- sscanf (argv[3], "%d:%d:%d:%d", &x, &y, &width, &height);
- ret = gdm_run_failsafe_yesno (argv[2], x, y, width, height);
- if (ret)
- g_print ("yes\n");
- else
- g_print ("no\n");
- fflush (stdout);
- _exit (0);
- }
-
-
/* XDM compliant error message */
if (getuid () != 0) {
/* make sure the pid file doesn't get wiped */
@@ -1341,7 +1293,6 @@ main (int argc, char *argv[])
gdm_fail (_("Only root wants to run gdm\n"));
}
-
/* Initialize runtime environment */
umask (022);
@@ -1352,7 +1303,7 @@ main (int argc, char *argv[])
GNOME_PARAM_CREATE_DIRECTORIES, FALSE,
NULL);
- main_loop = g_main_new (FALSE);
+ main_loop = g_main_loop_new (NULL, FALSE);
openlog ("gdm", LOG_PID, LOG_DAEMON);
@@ -1457,7 +1408,7 @@ main (int argc, char *argv[])
*/
while (1)
{
- gdm_run ();
+ g_main_loop_run (main_loop);
gdm_debug ("main: Exited main loop");
}
@@ -1560,18 +1511,6 @@ gdm_signal_notify (gint8 signal)
signals_notified[index] |= 1 << shift;
}
-void
-gdm_run (void)
-{
- g_main_run (main_loop);
-}
-
-void
-gdm_quit (void)
-{
- g_main_quit (main_loop);
-}
-
static void
gdm_handle_message (GdmConnection *conn, const char *msg, gpointer data)
{
diff --git a/daemon/gdm.h b/daemon/gdm.h
index aaf028cc..0b848299 100644
--- a/daemon/gdm.h
+++ b/daemon/gdm.h
@@ -387,9 +387,6 @@ void gdm_signal_notify (gint8 signal);
GdmXServer * gdm_find_x_server (const char *id);
-void gdm_run (void);
-void gdm_quit (void);
-
/* primitive protocol for controlling the daemon from slave
* or gdmconfig or whatnot */
diff --git a/daemon/server.c b/daemon/server.c
index 3bc1245f..e94d905d 100644
--- a/daemon/server.c
+++ b/daemon/server.c
@@ -67,6 +67,8 @@ extern int extra_status;
/* Global vars */
static GdmDisplay *d = NULL;
+static gboolean server_signal_notified = FALSE;
+static int server_signal_pipe[2];
/* Wipe cookie files */
void
@@ -330,18 +332,28 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi,
gdm_debug ("gdm_server_start: %s", d->name);
/* Create new cookie */
- if ( ! gdm_auth_secure_display (d))
+ if ( ! gdm_auth_secure_display (d))
return FALSE;
gdm_slave_send_string (GDM_SOP_COOKIE, d->cookie);
gnome_setenv ("DISPLAY", d->name, TRUE);
+ if (pipe (server_signal_pipe) != 0) {
+ gdm_error (_("%s: Error openning a pipe: %s"),
+ "gdm_server_start", g_strerror (errno));
+ return FALSE;
+ }
+ server_signal_notified = FALSE;
+
/* Catch USR1 from X server */
usr1.sa_handler = gdm_server_usr1_handler;
usr1.sa_flags = SA_RESTART|SA_RESETHAND;
sigemptyset (&usr1.sa_mask);
if (sigaction (SIGUSR1, &usr1, &old_usr1) < 0) {
- gdm_error (_("gdm_server_start: Error setting up USR1 signal handler"));
+ gdm_error (_("%s: Error setting up USR1 signal handler: %s"),
+ "gdm_server_start", g_strerror (errno));
+ close (server_signal_pipe[0]);
+ close (server_signal_pipe[1]);
return FALSE;
}
@@ -351,8 +363,11 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi,
sigemptyset (&chld.sa_mask);
if (sigaction (SIGCHLD, &chld, &old_chld) < 0) {
- gdm_error (_("gdm_server_start: Error setting up CHLD signal handler"));
+ gdm_error (_("%s: Error setting up CHLD signal handler: %s"),
+ "gdm_server_start", g_strerror (errno));
sigaction (SIGUSR1, &old_usr1, NULL);
+ close (server_signal_pipe[0]);
+ close (server_signal_pipe[1]);
return FALSE;
}
@@ -362,9 +377,12 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi,
sigemptyset (&alrm.sa_mask);
if (sigaction (SIGALRM, &alrm, &old_alrm) < 0) {
- gdm_error (_("gdm_server_start: Error setting up ALRM signal handler"));
+ gdm_error (_("%s: Error setting up ALRM signal handler: %s"),
+ "gdm_server_start", g_strerror (errno));
sigaction (SIGUSR1, &old_usr1, NULL);
sigaction (SIGCHLD, &old_chld, NULL);
+ close (server_signal_pipe[0]);
+ close (server_signal_pipe[1]);
return FALSE;
}
@@ -418,8 +436,17 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi,
d->servstat = SERVER_TIMEOUT;
}
} else {
+ fd_set rfds;
+
gdm_debug ("gdm_server_start: Before mainloop waiting for server");
- gdm_run ();
+
+ FD_ZERO (&rfds);
+ FD_SET (server_signal_pipe[0], &rfds);
+
+ do {
+ select (server_signal_pipe[0]+1, &rfds, NULL, NULL, NULL);
+ } while ( ! server_signal_notified);
+
gdm_debug ("gdm_server_start: After mainloop waiting for server");
}
}
@@ -449,6 +476,9 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi,
sigaction (SIGCHLD, &old_chld, NULL);
sigaction (SIGALRM, &old_alrm, NULL);
+ close (server_signal_pipe[0]);
+ close (server_signal_pipe[1]);
+
if (SERVER_IS_FLEXI (d))
gdm_slave_send_num (GDM_SOP_FLEXI_OK, 0 /* bogus */);
#ifdef __linux__
@@ -486,6 +516,9 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi,
sigaction (SIGCHLD, &old_chld, NULL);
sigaction (SIGALRM, &old_alrm, NULL);
+ close (server_signal_pipe[0]);
+ close (server_signal_pipe[1]);
+
if (disp->type == TYPE_FLEXI_XNEST &&
display_xnest_no_connect (disp)) {
gdm_slave_send_num (GDM_SOP_FLEXI_ERR,
@@ -780,7 +813,7 @@ gdm_server_spawn (GdmDisplay *d)
_exit (SERVER_ABORT);
}
if (pwent->pw_dir != NULL &&
- g_file_exists (pwent->pw_dir))
+ g_file_test (pwent->pw_dir, G_FILE_TEST_EXISTS))
gnome_setenv ("HOME", pwent->pw_dir, TRUE);
else
gnome_setenv ("HOME", "/", TRUE); /* Hack */
@@ -835,7 +868,6 @@ gdm_server_spawn (GdmDisplay *d)
}
}
-
/**
* gdm_server_usr1_handler:
* @sig: Signal value
@@ -851,7 +883,9 @@ gdm_server_usr1_handler (gint sig)
gdm_debug ("gdm_server_usr1_handler: Got SIGUSR1, server running");
- gdm_quit ();
+ server_signal_notified = TRUE;
+ /* this will quit the select */
+ write (server_signal_pipe[1], "Yay!", 4);
}
@@ -869,7 +903,9 @@ gdm_server_alarm_handler (gint signal)
gdm_debug ("gdm_server_alarm_handler: Got SIGALRM, server abort");
- gdm_quit ();
+ server_signal_notified = TRUE;
+ /* this will quit the select */
+ write (server_signal_pipe[1], "Yay!", 4);
}
@@ -905,7 +941,9 @@ gdm_server_child_handler (int signal)
d->servstat = SERVER_ABORT; /* Server died unexpectedly */
d->servpid = 0;
- gdm_quit ();
+ server_signal_notified = TRUE;
+ /* this will quit the select */
+ write (server_signal_pipe[1], "Yay!", 4);
} else if (pid == extra_process) {
/* an extra process died, yay! */
extra_process = -1;
diff --git a/daemon/slave.c b/daemon/slave.c
index 6a580679..646fe781 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -21,7 +21,7 @@
#include <config.h>
#include <libgnome/libgnome.h>
-#include <libgnomeui/libgnomeui.h>
+#include <gtk/gtkmessagedialog.h>
#include <gdk/gdkx.h>
#include <stdio.h>
#include <stdlib.h>
@@ -169,7 +169,9 @@ gdm_slave_start (GdmDisplay *display)
sigaddset (&alrm.sa_mask, SIGALRM);
if (sigaction (SIGALRM, &alrm, NULL) < 0)
- gdm_slave_exit (DISPLAY_ABORT, _("gdm_slave_init: Error setting up ALRM signal handler"));
+ gdm_slave_exit (DISPLAY_ABORT,
+ _("%s: Error setting up ALRM signal handler: %s"),
+ "gdm_slave_start", g_strerror (errno));
}
/* Handle a INT/TERM signals from gdm master */
@@ -181,7 +183,9 @@ gdm_slave_start (GdmDisplay *display)
if ((sigaction (SIGTERM, &term, NULL) < 0) ||
(sigaction (SIGINT, &term, NULL) < 0))
- gdm_slave_exit (DISPLAY_ABORT, _("gdm_slave_init: Error setting up TERM/INT signal handler"));
+ gdm_slave_exit (DISPLAY_ABORT,
+ _("%s: Error setting up TERM/INT signal handler: %s"),
+ "gdm_slave_start", g_strerror (errno));
/* Child handler. Keeps an eye on greeter/session */
child.sa_handler = gdm_slave_child_handler;
@@ -190,7 +194,8 @@ gdm_slave_start (GdmDisplay *display)
sigaddset (&child.sa_mask, SIGCHLD);
if (sigaction (SIGCHLD, &child, NULL) < 0)
- gdm_slave_exit (DISPLAY_ABORT, _("gdm_slave_init: Error setting up CHLD signal handler"));
+ gdm_slave_exit (DISPLAY_ABORT, _("%s: Error setting up CHLD signal handler: %s"),
+ "gdm_slave_start", g_strerror (errno));
/* Handle a USR2 which is ack from master that it received a message */
usr2.sa_handler = gdm_slave_usr2_handler;
@@ -199,7 +204,8 @@ gdm_slave_start (GdmDisplay *display)
sigaddset (&usr2.sa_mask, SIGUSR2);
if (sigaction (SIGUSR2, &usr2, NULL) < 0)
- gdm_slave_exit (DISPLAY_ABORT, _("%s: Error setting up USR2 signal handler"), "gdm_slave_init");
+ gdm_slave_exit (DISPLAY_ABORT, _("%s: Error setting up USR2 signal handler: %s"),
+ "gdm_slave_start", g_strerror (errno));
/* The signals we wish to listen to */
sigfillset (&mask);
@@ -671,7 +677,7 @@ run_config (GdmDisplay *display, struct passwd *pwent)
execv (argv[0], argv);
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("Could not execute the configuration\n"
"program. Make sure it's path is set\n"
"correctly in the configuration file.\n"
@@ -685,7 +691,7 @@ run_config (GdmDisplay *display, struct passwd *pwent)
execv (argv[0], argv);
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("Could not execute the configuration\n"
"program. Make sure it's path is set\n"
"correctly in the configuration file."));
@@ -846,19 +852,27 @@ gdm_slave_wait_for_login (void)
static gboolean
is_in_trusted_pic_dir (const char *path)
{
- char *globalpix;
+ GSList *locations = NULL, *li;
/* our own pixmap dir is trusted */
if (strncmp (path, EXPANDED_PIXMAPDIR, sizeof (EXPANDED_PIXMAPDIR)) == 0)
return TRUE;
- /* gnome'skpixmap dir is trusted */
- globalpix = gnome_unconditional_pixmap_file ("");
- if (strncmp (path, globalpix, strlen (globalpix)) == 0) {
- g_free (globalpix);
- return TRUE;
+ g_free (gnome_program_locate_file (NULL /* program */,
+ GNOME_FILE_DOMAIN_PIXMAP,
+ "" /* file_name */,
+ FALSE /* only_if_exists */,
+ &locations));
+ for (li = locations; li != NULL; li = li->next) {
+ /* gnome's pixmap dirs are trusted */
+ if (strncmp (path, li->data, strlen (li->data)) == 0) {
+ g_slist_foreach (locations, (GFunc)g_free, NULL);
+ g_slist_free (locations);
+ return TRUE;
+ }
}
- g_free (globalpix);
+ g_slist_foreach (locations, (GFunc)g_free, NULL);
+ g_slist_free (locations);
return FALSE;
}
@@ -926,6 +940,7 @@ run_pictures (void)
if (picfile != NULL) {
char *dir;
+ char *base;
/* if in trusted dir, just use it */
if (is_in_trusted_pic_dir (picfile)) {
@@ -941,19 +956,21 @@ run_pictures (void)
}
/* if not in trusted dir, check it out */
- dir = g_dirname (picfile);
+ dir = g_path_get_dirname (picfile);
+ base = g_path_get_basename (picfile);
/* Note that strict permissions checking is done
* on this file. Even if it may not even be owned by the
* user. This setting should ONLY point to pics in trusted
* dirs. */
if ( ! gdm_file_check ("run_pictures", pwent->pw_uid,
- dir, g_basename (picfile), TRUE, GdmUserMaxFile,
+ dir, base, TRUE, GdmUserMaxFile,
GdmRelaxPerms)) {
g_free (picfile);
picfile = NULL;
}
+ g_free (base);
g_free (dir);
}
}
@@ -1134,7 +1151,7 @@ gdm_slave_greeter (void)
if (pwent != NULL) {
/* Note that usually this doesn't exist */
if (pwent->pw_dir != NULL &&
- g_file_exists (pwent->pw_dir))
+ g_file_test (pwent->pw_dir, G_FILE_TEST_EXISTS))
gnome_setenv ("HOME", pwent->pw_dir, TRUE);
else
gnome_setenv ("HOME", "/", TRUE); /* Hack */
@@ -1176,7 +1193,7 @@ gdm_slave_greeter (void)
if(gdm_emergency_server) {
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("No servers were defined in the\n"
"configuration file and xdmcp was\n"
"disabled. This can only be a\n"
@@ -1190,7 +1207,7 @@ gdm_slave_greeter (void)
if (d->failsafe_xserver) {
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("I could not start the regular X\n"
"server (your graphical environment)\n"
"and so this is a failsafe X server.\n"
@@ -1203,7 +1220,7 @@ gdm_slave_greeter (void)
(_("The specified display number was busy, so "
"this server was started on display %s."),
d->name);
- gdm_error_box (d, GNOME_MESSAGE_BOX_ERROR, msg);
+ gdm_error_box (d, GTK_MESSAGE_ERROR, msg);
g_free (msg);
}
@@ -1221,7 +1238,7 @@ gdm_slave_greeter (void)
execv (argv[0], argv);
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("Cannot start the greeter program,\n"
"you will not be able to log in.\n"
"This display will be disabled.\n"
@@ -1477,7 +1494,7 @@ gdm_slave_chooser (void)
pwent = getpwnam (GdmUser);
if (pwent != NULL) {
/* Note that usually this doesn't exist */
- if (g_file_exists (pwent->pw_dir))
+ if (g_file_test (pwent->pw_dir, G_FILE_TEST_EXISTS))
gnome_setenv ("HOME", pwent->pw_dir, TRUE);
else
gnome_setenv ("HOME", "/", TRUE); /* Hack */
@@ -1493,7 +1510,7 @@ gdm_slave_chooser (void)
execv (argv[0], argv);
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("Cannot start the chooser program,\n"
"you will not be able to log in.\n"
"Please contact the system administrator.\n"));
@@ -1940,13 +1957,13 @@ session_child_run (struct passwd *pwent,
gdm_error (_("gdm_slave_session_start: gnome-session not found for a failsafe gnome session, trying xterm"));
session = GDM_SESSION_FAILSAFE_XTERM;
gdm_error_box
- (d, GNOME_MESSAGE_BOX_ERROR,
+ (d, GTK_MESSAGE_ERROR,
_("Could not find the GNOME installation,\n"
"will try running the \"Failsafe xterm\"\n"
"session."));
} else {
gdm_error_box
- (d, GNOME_MESSAGE_BOX_INFO,
+ (d, GTK_MESSAGE_INFO,
_("This is the Failsafe Gnome session.\n"
"You will be logged into the 'Default'\n"
"session of Gnome with no startup scripts\n"
@@ -1965,14 +1982,14 @@ session_child_run (struct passwd *pwent,
&sessexec);
g_free (params);
if (sesspath == NULL) {
- gdm_error_box (d, GNOME_MESSAGE_BOX_ERROR,
+ gdm_error_box (d, GTK_MESSAGE_ERROR,
_("Cannot find \"xterm\" to start "
"a failsafe session."));
/* nyah nyah nyah nyah nyah */
_exit (0);
} else {
gdm_error_box
- (d, GNOME_MESSAGE_BOX_INFO,
+ (d, GTK_MESSAGE_INFO,
_("This is the Failsafe xterm session.\n"
"You will be logged into a terminal\n"
"console so that you may fix your system\n"
@@ -2010,7 +2027,7 @@ session_child_run (struct passwd *pwent,
strcmp (shell, "/bin/false") == 0 ||
strcmp (shell, "/bin/true") == 0) {
gdm_error (_("gdm_slave_session_start: User not allowed to log in"));
- gdm_error_box (d, GNOME_MESSAGE_BOX_ERROR,
+ gdm_error_box (d, GTK_MESSAGE_ERROR,
_("The system administrator has\n"
"disabled your account."));
} else if (access (sessexec != NULL ? sessexec : sesspath, X_OK) != 0) {
@@ -2018,7 +2035,7 @@ session_child_run (struct passwd *pwent,
/* if we can't read and exec the session, then make a nice
* error dialog */
gdm_error_box
- (d, GNOME_MESSAGE_BOX_ERROR,
+ (d, GTK_MESSAGE_ERROR,
_("Cannot start the session, most likely the\n"
"session does not exist. Please select from\n"
"the list of available sessions in the login\n"
@@ -2029,7 +2046,7 @@ session_child_run (struct passwd *pwent,
gdm_error (_("gdm_slave_session_start: Could not start session `%s'"), sesspath);
gdm_error_box
- (d, GNOME_MESSAGE_BOX_ERROR,
+ (d, GTK_MESSAGE_ERROR,
_("Cannot start your shell. It could be that the\n"
"system administrator has disabled your login.\n"
"It could also indicate an error with your account.\n"));
diff --git a/daemon/verify-crypt.c b/daemon/verify-crypt.c
index 14a4267a..f549249b 100644
--- a/daemon/verify-crypt.c
+++ b/daemon/verify-crypt.c
@@ -18,10 +18,12 @@
#include <config.h>
#include <libgnome/libgnome.h>
+#include <gtk/gtkmessagedialog.h>
#include <syslog.h>
#include <pwd.h>
#include <grp.h>
#include <sys/types.h>
+#include <unistd.h>
#ifdef HAVE_CRYPT
# include <crypt.h>
@@ -218,7 +220,7 @@ gdm_verify_setup_user (GdmDisplay *d,
if ( ! gdm_setup_gids (login, pwent->pw_gid)) {
gdm_error (_("Cannot set user group for %s"), login);
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("\nCannot set your user group, "
"you will not be able to log in, "
"please contact your system administrator."));
diff --git a/daemon/verify-pam.c b/daemon/verify-pam.c
index add59f5f..ff8eb2ea 100644
--- a/daemon/verify-pam.c
+++ b/daemon/verify-pam.c
@@ -18,10 +18,11 @@
#include <config.h>
#include <libgnome/libgnome.h>
-#include <libgnomeui/libgnomeui.h>
+#include <gtk/gtkmessagedialog.h>
#include <grp.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
#include <syslog.h>
#include <security/pam_appl.h>
#include <pwd.h>
@@ -171,7 +172,7 @@ gdm_verify_standalone_pam_conv (int num_msg, const struct pam_message **msg,
case PAM_ERROR_MSG:
/* PAM sent a message that should displayed to the user */
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_((gchar *) msg[replies]->msg));
reply[replies].resp_retcode = PAM_SUCCESS;
reply[replies].resp = NULL;
@@ -180,7 +181,7 @@ gdm_verify_standalone_pam_conv (int num_msg, const struct pam_message **msg,
case PAM_TEXT_INFO:
/* PAM sent a message that should displayed to the user */
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_INFO,
+ GTK_MESSAGE_INFO,
_((gchar *) msg[replies]->msg));
reply[replies].resp_retcode = PAM_SUCCESS;
reply[replies].resp = NULL;
@@ -496,7 +497,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display)
if (gdm_slave_should_complain ()) {
gdm_error (_("Couldn't authenticate user"));
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("Authentication failed"));
}
goto setup_pamerr;
@@ -516,7 +517,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display)
if ((pamerr = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK)) != PAM_SUCCESS) {
gdm_error (_("Authentication token change failed for user %s"), login);
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("\nThe change of the authentication token failed. "
"Please try again later or cantact the system administrator."));
goto setup_pamerr;
@@ -526,13 +527,13 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display)
case PAM_ACCT_EXPIRED :
gdm_error (_("User %s no longer permitted to access the system"), login);
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("\nThe system administrator has disabled your account."));
goto setup_pamerr;
case PAM_PERM_DENIED :
gdm_error (_("User %s not permitted to gain access at this time"), login);
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("\nThe system administrator has your disabled access to the system temporary."));
goto setup_pamerr;
default :
@@ -546,7 +547,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display)
! gdm_setup_gids (login, pwent->pw_gid)) {
gdm_error (_("Cannot set user group for %s"), login);
gdm_error_box (cur_gdm_disp,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("\nCannot set your user group, "
"you will not be able to log in, "
"please contact your system administrator."));
diff --git a/daemon/verify-shadow.c b/daemon/verify-shadow.c
index c961c675..cde55ca7 100644
--- a/daemon/verify-shadow.c
+++ b/daemon/verify-shadow.c
@@ -18,11 +18,13 @@
#include <config.h>
#include <libgnome/libgnome.h>
+#include <gtk/gtkmessagedialog.h>
#include <syslog.h>
#include <pwd.h>
#include <shadow.h>
#include <grp.h>
#include <sys/types.h>
+#include <unistd.h>
#ifdef HAVE_CRYPT
# include <crypt.h>
@@ -225,7 +227,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display)
if ( ! gdm_setup_gids (login, pwent->pw_gid)) {
gdm_error (_("Cannot set user group for %s"), login);
gdm_error_box (d,
- GNOME_MESSAGE_BOX_ERROR,
+ GTK_MESSAGE_ERROR,
_("\nCannot set your user group, "
"you will not be able to log in, "
"please contact your system administrator."));
diff --git a/daemon/xdmcp.c b/daemon/xdmcp.c
index 5ef8ba0c..06684ae9 100644
--- a/daemon/xdmcp.c
+++ b/daemon/xdmcp.c
@@ -279,6 +279,8 @@ gdm_xdmcp_run (void)
GIOChannel *xdmcpchan;
xdmcpchan = g_io_channel_unix_new (gdm_xdmcpfd);
+ g_io_channel_set_buffered (xdmcpchan, FALSE);
+
xdmcp_source = g_io_add_watch_full
(xdmcpchan, G_PRIORITY_DEFAULT,
G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,