Sorry for wrongly assuming this was pam_env; this lead me to think that the fix would be intrusive in pam_env and a change in localechooser had to be considered, but that's not the case, it's just sudo not using the same algorithm:
/*
* Read in /etc/environment ala AIX and Linux.
* Lines are in the form of NAME=VALUE
* Invalid lines, blank lines, or lines consisting solely of a comment
* character are skipped.
*/
void
read_env_file(path, replace)
const char *path;
int replace;
{
FILE *fp;
char *cp;
if ((fp = fopen(path, "r")) == NULL)
return;
/* Make sure we are operating on the current environment. */
if (env.envp != environ)
sync_env();
while ((cp = sudo_parseln(fp)) != NULL) {
/* Skip blank or comment lines */
if (*cp == '\0') continue;
/* Must be of the form name=value */
if (strchr(cp, '=') == NULL) continue;
Sorry for wrongly assuming this was pam_env; this lead me to think that the fix would be intrusive in pam_env and a change in localechooser had to be considered, but that's not the case, it's just sudo not using the same algorithm:
/*
* Read in /etc/environment ala AIX and Linux.
* Lines are in the form of NAME=VALUE
* Invalid lines, blank lines, or lines consisting solely of a comment
* character are skipped.
*/
void
read_env_file(path, replace)
const char *path;
int replace;
{
FILE *fp;
char *cp;
if ((fp = fopen(path, "r")) == NULL)
return;
/* Make sure we are operating on the current environment. */
if (env.envp != environ)
sync_env();
while ((cp = sudo_parseln(fp)) != NULL) {
continue;
/* Skip blank or comment lines */
if (*cp == '\0')
/* Must be of the form name=value */
continue;
if (strchr(cp, '=') == NULL)
}
fclose(fp);
}