dropbear doesn't set locales the right way

Bug #232064 reported by Vojta Grec
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
dropbear (Debian)
New
Unknown
dropbear (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: dropbear

When using dropbear 0.50-2 instead of openssh on my Ubuntu hardy server, locales are not properly set on login. In fact they are set to "POSIX". Locales are configured properly (LANG=cs_CZ.UTF-8) and work when accesing the server from console or via openssh.

How to reproduce:
1) Install openssh-server and try out that locales work as expected.
LANG=cs_CZ.UTF-8
LC_CTYPE="cs_CZ.UTF-8"
LC_NUMERIC="cs_CZ.UTF-8"
LC_TIME="cs_CZ.UTF-8"
LC_COLLATE="cs_CZ.UTF-8"
LC_MONETARY="cs_CZ.UTF-8"
LC_MESSAGES="cs_CZ.UTF-8"
LC_PAPER="cs_CZ.UTF-8"
LC_NAME="cs_CZ.UTF-8"
LC_ADDRESS="cs_CZ.UTF-8"
LC_TELEPHONE="cs_CZ.UTF-8"
LC_MEASUREMENT="cs_CZ.UTF-8"
LC_IDENTIFICATION="cs_CZ.UTF-8"
LC_ALL=
2) Purge openssh-server, openssh-client and all the residuous libs and install dropbear.
3) When accesing the machine via dropbear, locales are set to "POSIX". LANG is not set.
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Vojta Grec (vojtagrec)
description: updated
Revision history for this message
Vojta Grec (vojtagrec) wrote :

This bug applies also to Intrepid. A little workaround is to do:

echo "export LANG=\"cs_CZ.UTF-8\"" > /etc/profile.d/lang.sh

as root. It seems to me that a) dropbear is not working correctly with locales or b) something is wrong with locales and the fault is not on dropbear's side. But a) seems more probable to me.

Vojta Grec (vojtagrec)
Changed in dropbear:
status: New → Confirmed
Revision history for this message
CrazyAlex25 (crazyalex25) wrote :

Now, optionally, edit /etc/profile as follows:

Run locale -a to get a list of the locale names suitable for use in environment variables. Note that the spellings are different from the ones presented in the dpkg-reconfigure list.
Add a line like this to your /etc/profile file:
 : ${LANG:=de_DE.iso88591}; export LANG
where de_DE.iso88591 is the locale you want to use as a default. If you have tcsh or csh users, create a file named /etc/csh/login.d/lang with the following content:
 if (! $?LANG) setenv LANG de_DE.iso88591
This will only set LANG if it was not previously defined, for example by ssh. Unfortunately, this won't affect users who login with xdm, gdm, etc.

http://wiki.debian.org/Locale

Changed in dropbear (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.