Bug #197

svc.startd may not pick up locale correctly

Added by Vineeth Pillai over 3 years ago. Updated about 3 years ago.

Status:Resolved Start date:2010-09-13
Priority:Normal Due date:
Assignee:sham pavman % Done:

0%

Category:cmd - userland programs Spent time: -
Target version:-
Difficulty:Medium Tags:needs-triage

Description

While investigating on #168, we came across svc.startd code which also has potential issues with setting the locale.

local field in the struct startd_state might not default to "C" set if environment variables do not have valid information. The issue that we found in svcs is also present in startd and this can be a problem based on how startd uses st_locale field in the struct startd_state.

<snip>
628 if (st->st_locale != NULL)
629 free(st->st_locale);
630
631 if ((st->st_locale = getenv("LC_ALL")) NULL)
632 if ((st->st_locale = getenv("LC_MESSAGES")) NULL)
633 st->st_locale = getenv("LANG");
634
635 if (!st->st_log_locale_known && stat(FS_LOCALE_DIR, &sb) == 0) {
636 (void) setlocale(LC_ALL, "");
637 st->st_locale = setlocale(LC_MESSAGES, "");
638 if (st->st_locale)
639 st->st_log_locale_known = 1;
640
641 (void) textdomain(TEXT_DOMAIN);
642 }
<snip>

Needs to fix this..

History

Updated by sham pavman about 3 years ago

  • Assignee set to sham pavman

Updated by Albert Lee about 3 years ago

  • Category set to cmd - userland programs
  • Status changed from New to Resolved

Resolved in 13339:287b9c4687e8.

Also available in: Atom PDF