Bug #197

svc.startd may not pick up locale correctly

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

Status:ResolvedStart date:2010-09-13
Priority:NormalDue date:
Assignee:sham pavman% Done:


Category:cmd - userland programs
Target version:-
Difficulty: Tags:


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.

628 if (st->st_locale != NULL)
629 free(st->st_locale);
631 if ((st->st_locale = getenv("LC_ALL")) NULL)
632 if ((st->st_locale = getenv("LC_MESSAGES")) NULL)
633 st->st_locale = getenv("LANG");
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;
641 (void) textdomain(TEXT_DOMAIN);
642 }

Needs to fix this..


#1 Updated by sham pavman about 7 years ago

  • Assignee set to sham pavman

#2 Updated by Albert Lee about 7 years ago

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

Resolved in 13339:287b9c4687e8.

Also available in: Atom