View | Details | Raw Unified | Return to bug 148056
Collapse All | Expand All

(-)pam_login-3.29.orig/src/login.c (-4 / +42 lines)
Lines 429-438 Link Here
429
429
430
  init_sighandler ();
430
  init_sighandler ();
431
431
432
  locale = getlogindefs_str ("RC_LC_ALL", NULL);
432
  /* find locale for translations:                           */
433
  if (locale == NULL || strlen (locale) == 0)
433
  /* If the locale environment variables are already set     */
434
    if ((locale = getlogindefs_str ("RC_LANG", "")) == NULL)
434
  /* set when the login program is called, just use them.    */
435
      locale = "";
435
  /* Usually they are not set though, because                */
436
  /*     - this program is called before the user has logged */
437
  /*       in, e.g. when logging in from the Linux console   */
438
  /*       or from a serial console and no profiles have     */
439
  /*       sourced yet.                                      */
440
  /*     - this program is called by the telnet server, in   */
441
  /*       that case only the environment variables          */
442
  /*       DISPLAY, TERM, and REMOTEHOST are set.            */
443
  /* If the locale environment is not set, determine the     */
444
  /* language from /etc/sysconfig/language.                  */
445
  
446
  if ((locale = getenv ("LC_ALL")) == NULL
447
      || strlen (locale) == 0)
448
    if ((locale = getenv ("LC_MESSAGES")) == NULL
449
	|| strlen (locale) == 0)
450
      if ((locale = getenv ("LANG")) == NULL
451
	  || strlen (locale) == 0)
452
        if ((locale = getlogindefs_str ("RC_LC_ALL", NULL)) == NULL
453
	    || strlen (locale) == 0)
454
          if ((locale = getlogindefs_str ("RC_LC_MESSAGES", NULL)) == NULL
455
	      || strlen (locale) == 0)
456
            locale = getlogindefs_str ("RC_LANG", "POSIX");
457
458
  /* don't use translations for languages which cannot be */
459
  /* displayed on the Linux console yet                   */
460
  if (strstr (locale, "ja") == locale || 
461
      strstr (locale, "zh") == locale || 
462
      strstr (locale, "ko") == locale || 
463
      strstr (locale, "bn") == locale || 
464
      strstr (locale, "gu") == locale || 
465
      strstr (locale, "hi") == locale || 
466
      strstr (locale, "kn") == locale || 
467
      strstr (locale, "ml") == locale || 
468
      strstr (locale, "mr") == locale || 
469
      strstr (locale, "pa") == locale || 
470
      strstr (locale, "ta") == locale || 
471
      strstr (locale, "te") == locale || 
472
      strstr (locale, "km") == locale) 
473
	locale = "POSIX"; 
436
474
437
  setlocale (LC_ALL, locale);
475
  setlocale (LC_ALL, locale);
438
  bindtextdomain ("pam_login", LOCALEDIR);
476
  bindtextdomain ("pam_login", LOCALEDIR);

Return to bug 148056