[tor-bugs] #33042 [Internal Services/Tor Sysadmin Team]: switch servers to a UTF-8 locale by default
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Jan 23 21:01:40 UTC 2020
#33042: switch servers to a UTF-8 locale by default
-----------------------------------------------------+-----------------
Reporter: anarcat | Owner: tpa
Type: task | Status: new
Priority: High | Milestone:
Component: Internal Services/Tor Sysadmin Team | Version:
Severity: Major | Keywords:
Actual Points: | Parent ID:
Points: | Reviewer:
Sponsor: |
-----------------------------------------------------+-----------------
no one probably ever noticed this, but our servers all run on a plain "C"
locale, which means many programs cannot parse UTF-8 characters by
default.
this was mostly not a problem: until very recently, SSH client's
environment would propagate to the server, which means many users had, in
effect, a UTF-8 locale. mine, for example, is fr_CA.UTF-8.
but that also meant that error messages would get translated into whatever
language the user is using, which made collaboration harder. so this was
turned off in:
{{{
commit 1e1fc35ef105b854456586815dd093e27f80635e
Author: Antoine Beaupré <anarcat at debian.org>
Date: Tue Jan 21 16:02:34 2020 -0500
do accept LANG or LC_* variables in sshd
While it's great that Debian GNU/Linux translates its messages for
users all over the world, the Tor Project is an international
community where it's preferable to communicate in the current "lingua
franca", english. By accepting client-specific locales, we are
breaking that common language and making it harder to collaborate.
This also happens to irritate weasel because my locale is french and
that leaks out to some error messages and output in my
copy-pastes. This should solve the problem for him, hopefully,
eventually.
diff --git a/modules/ssh/templates/sshd_config.erb
b/modules/ssh/templates/sshd_config.erb
index c79b3a9b..6b63b429 100644
--- a/modules/ssh/templates/sshd_config.erb
+++ b/modules/ssh/templates/sshd_config.erb
@@ -113,7 +113,7 @@ TCPKeepAlive yes
#Banner none
# Allow client to pass locale environment variables
-AcceptEnv LANG LC_*
+#AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
}}}
Unfortunately, this had the effect of turning my environment into a plain,
default locale, which is "Not set" according to `dpkg-reconfigure
locales`, which probably means the default `C` locale.
This meant I started getting weird errors. One of those happened while
starting vim, for example:
{{{
root at fsn-node-03:~# vim
Error detected while processing /root/.vimrc:
line 13:
E474: Invalid argument: listchars=tab:»·,trail:·
Press ENTER or type command to continue
}}}
My first reaction was to remove this line at all, which I did in commit
0bcad064. But then I realized this problem was triggered by the absence of
a UTF-8 locale.
So I'm proposing we switch to a C.UTF-8 locale everywhere by default. That
way at least we'd get unicode to display properly everywhere.
I'm marking this as high priority because those weird things could happen
to other people and i don't want to leave this fuzzy situation going on
for too long.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33042>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list