pam_env can't open /etc/default/locale

Bug #155794 reported by Christian Holtje
88
This bug affects 15 people
Affects Status Importance Assigned to Milestone
localization-config (Debian)
Fix Released
Unknown
sudo (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: libpam-modules

Hello!

I just upgraded to Gutsy and am getting these messages in my log:
Oct 22 06:25:06 gerf su[22091]: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory
Oct 22 06:28:45 gerf su[22423]: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory
Oct 22 06:28:45 gerf su[22427]: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory
Oct 22 06:28:45 gerf su[22429]: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory

This is probably due to these lines in the /etc/pam.d/* files:
# grep /etc/default/locale /etc/pam.d/*
/etc/pam.d/login:# locale variables are also kept into /etc/default/locale in etch
/etc/pam.d/login:session required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/ssh:# /etc/default/locale, so read that as well.
/etc/pam.d/ssh:auth required pam_env.so envfile=/etc/default/locale
/etc/pam.d/su:# locale variables are also kept into /etc/default/locale in etch
/etc/pam.d/su:session required pam_env.so readenv=1 envfile=/etc/default/locale

I have a Feisty box and it has the same lines in the /etc/pam.d/* directories.

I have touched the /etc/default/locale file for the moment as a work around.

Ciao!

Changed in localization-config:
status: Unknown → New
Revision history for this message
Nicolas Nobelis (nobelis) wrote :

Hello,

In my Debian box, this file is generated by the command update-locale from the package belocs-locales-bin.

I tried to use this command in gutsy : the file was successfully created, but it was empty :

$ cat /etc/default/locale
# File generated by update-locale

Regards

Revision history for this message
Peter Antoniac (pan1nx) wrote :

On the hardy, I just checked and this solves the problem:
1. You have the belocs-locales-bin installed (deboostrap?)
2. You run update-local that will rebuild the file there as Nocolas said. So, we can close this?

Changed in pam:
status: New → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

If you have to run the command by hand to get rid of the error messages, then I think we still have a bug here.

Changed in pam:
status: Fix Released → New
Revision history for this message
Martin G Miller (mgmiller) wrote :

I have a hardy to intrepid update and I also had this error message. /etc/default/locale did not exist. I ran sudo update-locale and that seems to have fixed it. At least it created the file. But As the last poster stated, we shold not have to run this command by hand.

Revision history for this message
Peter Antoniac (pan1nx) wrote :

I agree that this is supposed to be fixed. Perhaps a postinst in the package to call the update-locale will fix this issue.

Changed in pam:
status: New → Confirmed
Revision history for this message
Peter Antoniac (pan1nx) wrote :

As it has enought info, I moved it to Triaged...

Changed in pam (Ubuntu):
importance: Undecided → Wishlist
status: Confirmed → Triaged
importance: Wishlist → Low
Revision history for this message
Peter Antoniac (pan1nx) wrote :

Is this bug still causing problems?

Revision history for this message
Peter Antoniac (pan1nx) wrote :

From debian perspective, here are some comments:
> This is part of the PAM configuration of each package. For example, from /etc/pam.d/login:
>
> session required pam_env.so readenv=1 envfile=/etc/default/locale
>
> > * I can't find who/what might be responsible for the /etc/default/locale
> > disappearance
>
> Maybe you selected "None" as your default locale? (See #515099)

Cheers,
Peter

Revision history for this message
Shahar Or (mightyiam) wrote :

I can't even remember where I got this message.

Revision history for this message
Christian Holtje (docwhat) wrote :

Peter: Since I don't have the system(s) around in a state that I can check that anymore, I can't answer your question.

You should be able to reproduce the problem by downgrading the pam packages, removing the /etc/default/locale, and then upgrading. But I haven't tested that.

You can't expect users to be able to help out with bugs like this when they are over 3 years old. :-/

Revision history for this message
Forest (foresto) wrote :

In response to Shahar Or in comment #9, I'm currently getting this meesage in /var/log/auth.log on a Karmic virtual machine at linode.com. The log message (with fake hostname and pids) is:

Feb 22 21:18:09 myhostname sshd[1234567]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory

Revision history for this message
Robert Pendell (shinji257) wrote :

I can confirm that. I ran update-locale manually which put an file containing only one comment.

Revision history for this message
Xavier Robin (jti-533g) wrote :

Same problem here on a freshly installed Ubuntu 10.04 virtual server (present before anything was upgraded). The message is displayed in /var/log/auth.log The update-locale command created the file and solved the issue. Here is the output of the 'locale' command:

$ locale
LANG=fr_CH.UTF-8
LC_CTYPE="fr_CH.UTF-8"
LC_NUMERIC="fr_CH.UTF-8"
LC_TIME="fr_CH.UTF-8"
LC_COLLATE="fr_CH.UTF-8"
LC_MONETARY="fr_CH.UTF-8"
LC_MESSAGES="fr_CH.UTF-8"
LC_PAPER="fr_CH.UTF-8"
LC_NAME="fr_CH.UTF-8"
LC_ADDRESS="fr_CH.UTF-8"
LC_TELEPHONE="fr_CH.UTF-8"
LC_MEASUREMENT="fr_CH.UTF-8"
LC_IDENTIFICATION="fr_CH.UTF-8"
LC_ALL=

Revision history for this message
Martitza (martitzam) wrote :

I confirm this issue still exists with Karmic and Lucid through 10.04.

Revision history for this message
gco (gcostes) wrote :

Same here on Ubuntu Server 10.04.1
The message is displayed in /var/log/auth.log for every ssh connection attempts
Resolved by running update-locale

Revision history for this message
Tom van Leeuwen (tom-vleeuwen) wrote :

Same here running Ubuntu Server 10.10.
The message is displayed in /var/log/auth.log for every ssh connection attempts
Resolved by running update-locale

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

Again, same here on Ubuntu Server 10.04.

Like the others, fixed by executing the "update-locale" command, which creates the file /etc/default/locale. This file appears not to exist out-of-the-box.

The contents of this file are:

# File generated by update-locale

Revision history for this message
Steffan Jacobs (steffanjacobs) wrote :

So, this affected me on my 10.04 server. I have now fixed it manually with update-locale. Does this problem still exist in 11.10 / 12.04 ?

Revision history for this message
Jens (jens-launchpad-net) wrote :

Yes. Just installed 12.04 and still get this error message.

Changed in localization-config (Debian):
status: New → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I believe it's a bug in sudo's PAM configuration. Specifically, /etc/pam.d/sudo should use "session" for pam_env module, rather than "auth".

affects: pam (Ubuntu) → sudo (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sudo - 1.8.9p5-1ubuntu4

---------------
sudo (1.8.9p5-1ubuntu4) vivid; urgency=medium

  * Correct sudo.pam use "session" for pam_env.so, not "auth". (LP:
    #155794, LP: #25700)
 -- Dimitri John Ledkov <email address hidden> Tue, 23 Dec 2014 04:08:33 +0000

Changed in sudo (Ubuntu):
status: Triaged → Fix Released
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.