Commit 5eb83b0a authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

eek, evil we had GETTEXT_PACKAGE set to gdm-2.4, but we want gdm-2.6


Fri May 28 11:08:51 2004  George Lebl <jirka@5z.com>

	* configure.in: eek, evil we had GETTEXT_PACKAGE set to
	  gdm-2.4, but we want gdm-2.6 nowdays

	* daemon/gdm.c, daemon/misc.c: fix the ConsoleCannotHandle key
	  and cache it as soon as we can and also set
	  UNSAFE_TO_TRANSLATE=yes when forking something and console
	  can't handle the language

	* daemon/server.c: fix a minor fd leak and print a C locale
	  (don't want to translate this) error to the X log when the
	  X server cannot be exec'ed.

	* utils/gdmopen.c, utils/gdmtranslate.c, config/XKeepsCrashing:
	  Listen to UNSAFE_TO_TRANSLATE, since running shells in login
	  mode may modify the locale so we must force it to "C" where
	  we can if it is really unsafe (language in ConsoleCannotHandle)
parent b11360cc
Fri May 28 11:08:51 2004 George Lebl <jirka@5z.com>
* configure.in: eek, evil we had GETTEXT_PACKAGE set to
gdm-2.4, but we want gdm-2.6 nowdays
* daemon/gdm.c, daemon/misc.c: fix the ConsoleCannotHandle key
and cache it as soon as we can and also set
UNSAFE_TO_TRANSLATE=yes when forking something and console
can't handle the language
* daemon/server.c: fix a minor fd leak and print a C locale
(don't want to translate this) error to the X log when the
X server cannot be exec'ed.
* utils/gdmopen.c, utils/gdmtranslate.c, config/XKeepsCrashing:
Listen to UNSAFE_TO_TRANSLATE, since running shells in login
mode may modify the locale so we must force it to "C" where
we can if it is really unsafe (language in ConsoleCannotHandle)
Thu May 27 13:42:39 2004 George Lebl <jirka@5z.com>
* gui/modules/dwellmouselistener.c, gui/modules/keymouselistener.c:
......
#!/bin/sh
if test "x$UNSAFE_TO_TRANSLATE" = "xyes" ; then
LANG=C
unset LC_ALL
unset LC_MESSAGES
fi
if [ -x "$LIBEXECDIR/gdmtranslate" ] ; then
GDMTRANSLATE="$LIBEXECDIR/gdmtranslate"
else
......
......@@ -139,7 +139,7 @@ else
fi
dnl ## Language Support
GETTEXT_PACKAGE=gdm-2.4
GETTEXT_PACKAGE=gdm-2.6
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
AC_SUBST(GETTEXT_PACKAGE)
......
......@@ -318,6 +318,12 @@ gdm_config_parse (void)
/* Parse configuration options */
cfg = ve_config_new (GDM_CONFIG_FILE);
/* get and cache the OKness of a language */
GdmConsoleCannotHandle = ve_config_get_string (cfg, GDM_KEY_CONSOLE_CANNOT_HANDLE);
if (GdmConsoleCannotHandle == NULL)
GdmConsoleCannotHandle = g_strdup ("");
gdm_ok_console_language ();
GdmChooser = ve_config_get_string (cfg, GDM_KEY_CHOOSER);
GdmDefaultPath = ve_config_get_string (cfg, GDM_KEY_PATH);
GdmDisplayInit = ve_config_get_string (cfg, GDM_KEY_INITDIR);
......@@ -422,7 +428,6 @@ gdm_config_parse (void)
GdmSoundProgram = ve_config_get_string (cfg, GDM_KEY_SOUND_PROGRAM);
GdmSoundOnLoginFile = ve_config_get_string (cfg, GDM_KEY_SOUND_ON_LOGIN_FILE);
GdmConsoleCannotHandle = ve_config_get_string (cfg, GDM_KEY_SOUND_PROGRAM);
GdmDebug = ve_config_get_bool (cfg, GDM_KEY_DEBUG);
......@@ -1104,6 +1109,7 @@ deal_with_x_crashes (GdmDisplay *d)
ve_unsetenv ("LC_ALL");
ve_unsetenv ("LC_MESSAGES");
ve_setenv ("LANG", "C", TRUE);
ve_setenv ("UNSAFE_TO_TRANSLATE", "yes", TRUE);
}
VE_IGNORE_EINTR (execv (argv[0], argv));
......
......@@ -512,6 +512,7 @@ gdm_text_message_dialog (const char *msg)
ve_unsetenv ("LC_ALL");
ve_unsetenv ("LC_MESSAGES");
ve_setenv ("LANG", "C", TRUE);
ve_setenv ("UNSAFE_TO_TRANSLATE", "yes", TRUE);
}
argv[0] = EXPANDED_LIBEXECDIR "/gdmopen";
......@@ -593,6 +594,7 @@ gdm_text_yesno_dialog (const char *msg, gboolean *ret)
ve_unsetenv ("LC_ALL");
ve_unsetenv ("LC_MESSAGES");
ve_setenv ("LANG", "C", TRUE);
ve_setenv ("UNSAFE_TO_TRANSLATE", "yes", TRUE);
}
argv[0] = EXPANDED_LIBEXECDIR "/gdmopen";
......@@ -2334,6 +2336,10 @@ gdm_ok_console_language (void)
if (cached)
return is_ok;
/* so far we should be paranoid, we're not set yet */
if (GdmConsoleCannotHandle == NULL)
return FALSE;
cached = TRUE;
loc = setlocale (LC_MESSAGES, NULL);
......@@ -2342,19 +2348,20 @@ gdm_ok_console_language (void)
return TRUE;
}
is_ok = TRUE;
v = g_strsplit (GdmConsoleCannotHandle, ",", -1);
for (i = 0; v != NULL && v[i] != NULL; i++) {
if ( ! ve_string_empty (v[i]) &&
strncmp (v[i], loc, strlen (v[i])) == 0) {
is_ok = FALSE;
return FALSE;
break;
}
}
if (v != NULL)
g_strfreev (v);
is_ok = TRUE;
return TRUE;
return is_ok;
}
const char *
......
......@@ -1093,12 +1093,12 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg)
if (logfd != -1) {
VE_IGNORE_EINTR (dup2 (logfd, 1));
VE_IGNORE_EINTR (dup2 (logfd, 2));
close (logfd);
} else {
gdm_error (_("%s: Could not open logfile for display %s!"),
"gdm_server_spawn", d->name);
}
/* The X server expects USR1/TTIN/TTOU to be SIG_IGN */
ign_signal.sa_handler = SIG_IGN;
ign_signal.sa_flags = SA_RESTART;
......@@ -1213,7 +1213,13 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg)
}
VE_IGNORE_EINTR (execv (argv[0], argv));
gdm_fdprintf (2, "GDM: Xserver not found: %s\n"
"Error: Command could not be executed!\n"
"Please install the X server or edit %s to point "
"to the right place.",
command, GDM_CONFIG_FILE);
gdm_error (_("%s: Xserver not found: %s"),
"gdm_server_spawn", command);
......
......@@ -164,6 +164,17 @@ main (int argc, char *argv[])
if (child_pid == 0) {
char VT_NUMBER[256];
if (getenv ("UNSAFE_TO_TRANSLATE") != NULL &&
strcmp (getenv ("UNSAFE_TO_TRANSLATE"), "yes") == 0) {
putenv ("LANG=C");
/* portable way to truly unset with putenv? */
putenv ("LC_ALL=");
putenv ("LC_MESSAGES=");
putenv ("LC_ALL");
putenv ("LC_MESSAGES");
}
#ifdef __linux__
putenv ("TERM=linux");
#endif
......
......@@ -2,6 +2,7 @@
#include <stdio.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#define gboolean char
#define FALSE 0
......@@ -32,6 +33,12 @@ main (int argc, char *argv[])
return 0;
}
if (getenv ("UNSAFE_TO_TRANSLATE") != NULL &&
strcmp (getenv ("UNSAFE_TO_TRANSLATE"), "yes") == 0) {
printf ("%s\n", string);
return 0;
}
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
if (is_utf8)
......
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