In sudo_warn_gettext_v1() call dgettext() not gettext() to make

sure the domain is set correctly.  The sudoers plugin uses its own
text domain.
This commit is contained in:
Todd C. Miller
2015-05-12 15:58:05 -06:00
parent 336b99ade2
commit 80cb630bc0
2 changed files with 9 additions and 4 deletions

View File

@@ -258,7 +258,7 @@ sudo_warn_set_locale_func_v1(bool (*func)(bool, int *))
#ifdef HAVE_LIBINTL_H
char *
sudo_warn_gettext_v1(const char *msgid)
sudo_warn_gettext_v1(const char *domainname, const char *msgid)
{
int cookie;
char *msg;
@@ -267,7 +267,7 @@ sudo_warn_gettext_v1(const char *msgid)
if (sudo_warn_setlocale != NULL)
sudo_warn_setlocale(false, &cookie);
msg = gettext(msgid);
msg = dgettext(domainname, msgid);
/* Restore old locale as needed. */
if (sudo_warn_setlocale != NULL)