diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | NEWS | 5 | ||||
-rwxr-xr-x | config/XKeepsCrashing | 28 | ||||
-rwxr-xr-x | config/extract-shell.sh | 2 | ||||
-rw-r--r-- | daemon/server.c | 37 | ||||
-rw-r--r-- | daemon/server.h | 2 | ||||
-rw-r--r-- | daemon/slave.c | 2 |
7 files changed, 47 insertions, 42 deletions
@@ -1,9 +1,20 @@ +Mon Jul 14 12:04:13 2003 George Lebl <jirka@5z.com> + + * config/XKeepsCrashing, config/extract-shell.sh: Fix RH #84247 by + checking for gettext first. We could perhaps require bash here + though and use $"" + + * daemon/server.[ch], daemon/slave.c: don't twiddle around with the + lock files, reading them or whatnot, just whack them and also whack + the unix socket, safer and simpler. + Mon Jul 14 11:24:06 2003 George Lebl <jirka@5z.com> * daemon/server.[ch], daemon/slave.c: XFree86 is an wanker and doesn't wipe it's lockfile sometimes apparently (well obviously it won't if it crashed or some such), so if we find a stale lock file after we - kill the server, whack the lock file. + kill the server, whack the lock file. Should address #114003 and + redhat #90014 * daemon/misc.c: be very careful when approaching lockfiles in the /tmp directory @@ -36,6 +36,9 @@ Ahh news... so this prevents some possible damange someone could do if they do manage to get the gdm user privs. +- If X server crashes or doesn't otherwise whack its lockfile, + help it along, should fix #114003 and redhat #90014 + - No translatable message contains unneccessary markup now (fixes #101794 and #101795) @@ -50,6 +53,8 @@ Ahh news... - Use ve-config (from vicious-extensions) everywhere in the daemon +- Fix RH #84247 by checking for gettext binary before using it + - Random other minor fixes 2.4.2.96 stuff: diff --git a/config/XKeepsCrashing b/config/XKeepsCrashing index 411fbccb..ce0f0fe6 100755 --- a/config/XKeepsCrashing +++ b/config/XKeepsCrashing @@ -1,12 +1,22 @@ #!/bin/sh -MSG3=`gettext -s "I cannot start the X server (your graphical interface). It is likely that it is not set up correctly. You will need to log in on a console and rerun the X configuration program. Then restart GDM."` -MSG4=`gettext -s "Would you like me to try to run the X configuration program? Note that you will need the root password for this."` -MSG5=`gettext -s "Please type in the root (privileged user) password."` -MSG6=`gettext -s "I will now try to restart the X server again."` -MSG7=`gettext -s "I will disable this X server for now. Restart GDM when it is configured correctly."` -MSG8=`gettext -s "I cannot start the X server (your graphical interface). It is likely that it is not set up correctly. Would you like to view the X server output to diagnose the problem?"` -MSG9=`gettext -s "Would you like to view the detailed X server output as well?"` +GTBIN=`which gettext` + +gettextfunc () { + if test "x$GTBIN" = "x" ; then + echo "$1" + else + $GTBIN -s "$1" + fi +} + +MSG3=`gettextfunc "I cannot start the X server (your graphical interface). It is likely that it is not set up correctly. You will need to log in on a console and rerun the X configuration program. Then restart GDM."` +MSG4=`gettextfunc "Would you like me to try to run the X configuration program? Note that you will need the root password for this."` +MSG5=`gettextfunc "Please type in the root (privileged user) password."` +MSG6=`gettextfunc "I will now try to restart the X server again."` +MSG7=`gettextfunc "I will disable this X server for now. Restart GDM when it is configured correctly."` +MSG8=`gettextfunc "I cannot start the X server (your graphical interface). It is likely that it is not set up correctly. Would you like to view the X server output to diagnose the problem?"` +MSG9=`gettextfunc "Would you like to view the detailed X server output as well?"` # there are some env vars defined: # XLOG = the log file for the X server @@ -63,12 +73,12 @@ fi # if grep '^\(Cannot open mouse\|No core pointer\)' "$XLOG" 2> /dev/null ; then - MSG8=`gettext -s "I cannot start the X server (your graphical interface). It seems that the pointer device (your mouse) is not set up correctly. Would you like to view the X server output to diagnose the problem?"` + MSG8=`gettextfunc "I cannot start the X server (your graphical interface). It seems that the pointer device (your mouse) is not set up correctly. Would you like to view the X server output to diagnose the problem?"` if test -x /usr/sbin/mouseconfig ; then XCONFIGURATOR=/usr/sbin/mouseconfig # Note: we know this is a mouse problem and yay we have mouseconfig - MSG4=`gettext -s "Would you like me to try to run the mouse configuration program? Note that you will need the root password for this."` + MSG4=`gettextfunc "Would you like me to try to run the mouse configuration program? Note that you will need the root password for this."` fi fi diff --git a/config/extract-shell.sh b/config/extract-shell.sh index 555c6e20..f967a4e0 100755 --- a/config/extract-shell.sh +++ b/config/extract-shell.sh @@ -1,4 +1,4 @@ #!/bin/sh echo "/* DON\'T CHANGE THIS BY HAND! CHANGE THE SCRIPT THIS IS GENERATED */" echo "/* ALWAYS ADD A CHANGELOG OR I WILL PERSONALLY KICK YOUR ASS! */" -grep gettext | sed 's/^[^"]*\("[^"]*"\).*$/const char *foo = N_(\1);/' +grep gettextfunc | fgrep -v 'gettextfunc ()' | sed 's/^[^"]*\("[^"]*"\).*$/const char *foo = N_(\1);/' diff --git a/daemon/server.c b/daemon/server.c index 891c2112..4bb1d28c 100644 --- a/daemon/server.c +++ b/daemon/server.c @@ -76,11 +76,9 @@ static gboolean server_signal_notified = FALSE; static int server_signal_pipe[2]; void -gdm_server_whack_lockfile (GdmDisplay *disp, pid_t pid) +gdm_server_whack_lockfile (GdmDisplay *disp) { - FILE *fp; char buf[256]; - struct stat s; /* X seems to be sometimes broken with its lock files and doesn't seem to remove them always, and if you manage @@ -96,31 +94,12 @@ gdm_server_whack_lockfile (GdmDisplay *disp, pid_t pid) /* if lock file exists and it is our process, whack it! */ g_snprintf (buf, sizeof (buf), "/tmp/.X%d-lock", disp->dispnum); + unlink (buf); - /* If doesn't exist, yay the X server is not a wanker */ - if (stat (buf, &s) != 0) - return; - - if ( ! S_ISREG (s.st_mode)) { - /* Eeeek! not a regular file? Perhaps someone - is trying to play tricks on us */ - return; - } - - fp = fopen (buf, "r"); - if (fp != NULL) { - char buf2[100]; - if (fgets (buf2, sizeof (buf2), fp) != NULL) { - gulong lockpid; - fclose (fp); - if (sscanf (buf2, "%lu", &lockpid) == 1 && - pid == lockpid) { - unlink (buf); - } - } else { - fclose (fp); - } - } + /* whack the unix socket as well */ + g_snprintf (buf, sizeof (buf), + "/tmp/.X11-unix/X%d", disp->dispnum); + unlink (buf); } @@ -287,7 +266,7 @@ gdm_server_stop (GdmDisplay *disp) ve_waitpid_no_signal (servpid, 0, 0); gdm_sigchld_block_pop (); - gdm_server_whack_lockfile (disp, servpid); + gdm_server_whack_lockfile (disp); gdm_debug ("gdm_server_stop: Server pid %d dead", (int)servpid); } @@ -745,7 +724,7 @@ gdm_server_start (GdmDisplay *disp, gboolean treat_as_flexi, ve_waitpid_no_signal (pid, NULL, 0); gdm_sigchld_block_pop (); - gdm_server_whack_lockfile (disp, pid); + gdm_server_whack_lockfile (disp); } /* We will rebake cookies anyway, so wipe these */ diff --git a/daemon/server.h b/daemon/server.h index d7b15bf2..2ad60d3f 100644 --- a/daemon/server.h +++ b/daemon/server.h @@ -25,7 +25,7 @@ void gdm_server_wipe_cookies (GdmDisplay *disp); /* Wipe X server's butt */ -void gdm_server_whack_lockfile (GdmDisplay *disp, pid_t pid); +void gdm_server_whack_lockfile (GdmDisplay *disp); gboolean gdm_server_start (GdmDisplay *d, gboolean treat_as_flexi, diff --git a/daemon/slave.c b/daemon/slave.c index 6a900a23..458b5499 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -3442,7 +3442,7 @@ gdm_slave_child_handler (int sig) } else if (pid != 0 && pid == d->servpid) { d->servstat = SERVER_DEAD; d->servpid = 0; - gdm_server_whack_lockfile (d, pid); + gdm_server_whack_lockfile (d); gdm_server_wipe_cookies (d); gdm_slave_whack_temp_auth_file (); |