[arch-projects] [initscripts][RFC][PATCH] locale.sh: add support for user-specific locale.conf, drop DAEMON_LOCALE

Dave Reisner d at falconindy.com
Tue Aug 28 10:59:11 EDT 2012


On Tue, Aug 28, 2012 at 04:50:44PM +0200, Sébastien Luttringer wrote:
> On Tue, Aug 28, 2012 at 4:40 PM, Dave Reisner <d at falconindy.com> wrote:
> > On Tue, Aug 28, 2012 at 04:31:09PM +0200, Sébastien Luttringer wrote:
> >> On Fri, Aug 24, 2012 at 7:44 PM, Tom Gundersen <teg at jklm.no> wrote:
> >> > On Fri, Aug 24, 2012 at 7:02 PM, Dave Reisner <d at falconindy.com> wrote:
> >> >> Still, I guess my point is that we should be testing for the presence of
> >> >> variables before trying to expand them.
> >> >>
> >> >> if [ -n "$HOME" ] && [ -s "$HOME/.config/locale.conf ]; then
> >> >
> >> > I agree. Will post a new version.
> >> >
> >> >>> The way XDG_* is set is just messed up. One might hope that one day it
> >> >>> will be done better (say by a pam module). Shouldn't need to be part
> >> >>> of xorg, it is useful even with no graphical login.
> >> >>>
> >> >>
> >> >> I think other distros might order scripts by number. I've always thought
> >> >> that /etc/profile.d stuff is pretty ridiculous, but it's also roughly
> >> >> par for the course when you're talking about anything involving shell.
> >> >
> >> > Sure, but most of these things are not shell-specific, so I hope
> >> > something better will come along...
> >> >
> >> > -t
> >> /etc/environment and ~/.pam_environment are loaded by pam_env. This
> >> handle all loading of env vars without focus on locales one.
> >>
> >> The missing feature is a kind of env.d directory.
> >>
> >> Why not only drop all stuff based on scripts shell and use pam_env?
> >>
> >
> > Sure, you can even do something like:
> >
> > session required pam_env.so conffile=/dev/null envfile=/etc/locale.conf user_envfile=.config/locale.conf
> >
> > But, pam_env has no ability to filter/allow a specific set of variables.
> conffile allow to filter specific set of variables.
>
> from pam_env.conf manual:
> The /etc/security/pam_env.conf file specifies the environment
> variables to be set, unset or modified by pam_env(8)

Nothing about the text that follows in the manpage describes how to
_limit_ the variables that can be set in the environment file. It only
describes defaults and overrides. I've perused the code as well. I have
yet to find this fabled whitelist.

> > You could put anything you want in here.
> Where the magic begin. If all requirement are met, we can drop all
> profile.d crap.

Lots of profile.d scripts contain conditional logic. Whether or not this
is right, there is no substitute for it in pam_env.


More information about the arch-projects mailing list