update-locale not perform correctly sanity checks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Medium
|
Gunnar Hjalmarsson | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Won't Fix
|
Undecided
|
Unassigned | ||
Impish |
Won't Fix
|
Undecided
|
Unassigned | ||
pam (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Bionic |
New
|
Undecided
|
Unassigned | ||
Focal |
New
|
Undecided
|
Unassigned | ||
Hirsute |
New
|
Undecided
|
Unassigned | ||
Impish |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
[impact]
A simple typo using the update-locale script can render a system inoperable without booting into single user mode or similar:
$ sudo update-locale LANGUAGE = en_US.UTF-8
$ sudo -s
sudo: pam_open_session: Bad item passed to pam_*_item()
sudo: policy plugin failed session initialization
[test case]
$ cp /etc/default/locale /tmp/locale
$ update-locale --locale-file /tmp/locale LANGUAGE = en_US.UTF-8
"diff -u /etc/default/locale /tmp/locale" should be empty.
$ update-locale --locale-file /tmp/locale LANGUAGE=
The LANGUAGE=
$ update-locale --locale-file /tmp/locale LANGUAGE
The LANGUAGE setting is now commented out.
[regression potential]
Apart from the general concerns about a glibc rebuild, this is a simple change to a simple script. Performing the test as in the test case section is enough to ensure it still works.
[original description]
By passing wrong input as following:
sudo update-locale LANGUAGE = en_US.UTF-8
result is:
...
#LANGUAGE=en
=
This "equal" sign that was added makes system completely unusable(can't run sudo anymore):
bentzy@bentzy-nb:~$ sudo vim /etc/default/locale
sudo: pam_open_session: Bad item passed to pam_*_item()
sudo: policy plugin failed session initialization
Fixed it booting from installation disk and fixing corrupted /etc/default/locale
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: locales 2.31-0ubuntu9
Uname: Linux 5.5.4-050504-
ApportVersion: 2.20.11-0ubuntu27.6
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: KDE
Date: Tue Aug 25 09:36:03 2020
InstallationDate: Installed on 2020-08-17 (7 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
PackageArchitec
SourcePackage: glibc
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Ubuntu Core Development Team: Pending requested
-
Diff: 13 lines (+1/-1)1 file modifieddebian/local/usr_sbin/update-locale (+1/-1)
tags: | added: patch-forwarded-debian |
description: | updated |
description: | updated |
Changed in glibc (Ubuntu Hirsute): | |
status: | New → Won't Fix |
Thanks for your report. Submitted merge request which ought to prevent this from happening.
https:/ /salsa. debian. org/glibc- team/glibc/ -/merge_ requests/ 1