]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/main.c
Do not serialize environment, when switching root
authorHarald Hoyer <harald@redhat.com>
Mon, 8 Apr 2013 12:05:24 +0000 (14:05 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 8 Apr 2013 12:45:19 +0000 (14:45 +0200)
commitb3680f49e20c51e31c8dea84a11207df7b8f0100
tree400fa9847c6fe350078c08c01ab14737fd4112de
parent9735bd12ab7668cc1b7b518299797b101f16bd58
Do not serialize environment, when switching root

When switching root, i.e. LANG can be set to the locale of the initramfs
or "C", if it was unset. When systemd deserializes LANG in the real root
this would overwrite the setting previously gathered by locale_set().

To reproduce, boot with an initramfs without locale.conf or change
/etc/locale.conf to a different language than the initramfs and check a
daemon started by systemd:

$ tr "$\000" '\n' </proc/$(pidof sshd)/environ | grep LANG
LANG=C

To prevent that, serialization of environment variables is skipped, when
serializing for switching root.

https://bugzilla.redhat.com/show_bug.cgi?id=949525
src/core/main.c
src/core/manager.c
src/core/manager.h