Hi everyone on systemd-devel,

I'm trying to solve a problem of supplying locale settings to non-shell
programs acting as login shells in Fedora and RHEL, as described below.

So far it seems the Debian way of doing things will work.

Could you please confirm that the format of locale.conf is not going to change
in a way incompatible with what pam_env.so expects?

The pam_env.so manpage:

    http://man7.org/linux/man-pages/man8/pam_env.8.html

The locale.conf manpage:

    https://www.freedesktop.org/software/systemd/man/locale.conf.html

Also, am I missing anything? Is there another way systemd can help here?

Thank you.

Nick

On 04/04/2017 06:06 PM, Nikolai Kondrashov wrote:
Hi everyone,

At the moment users logging into Fedora on a text terminal (console, SSH,
etc.) get their locale environment variables (LANG, LC_ALL, etc.) set up by
the shell they use. I.e. the shell ultimately sources the /etc/locale.conf
file. This works fine in most cases.

However, if the user has his/her "shell" set to any program that is not one of
the traditional shells, i.e. it doesn't source any shell profiles, or even
doesn't understand any shell language at all, then that program doesn't get
locale settings.

Theoretical examples can include captive portals on jump-hosts, or
special-purpose systems with dedicated TUI instead of a shell. A practical
example that concerns me is a user session recording program [1] which needs
to run before user shell, and intercept all I/O going to and from the
terminal.

I would like to know if it is possible to change Fedora to provide the locale
variables through the environment user "shell" inherits, instead of expecting
it to read /etc/locale.conf, which is distro-specific.

This is done in Debian already. During session setup in login/sshd/etc. they
use pam_env to read /etc/default/locale. Similar thing is possible to do in
Fedora too. E.g. just put this into /etc/pam.d/system-auth:

    session     required      pam_env.so envfile=/etc/locale.conf

Nick

[1] Tlog - terminal I/O logger
    https://github.com/Scribery/tlog
_______________________________________________
devel mailing list -- de...@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to