Skip to content
  • Harald Hoyer's avatar
    Do not serialize environment, when switching root · b3680f49
    Harald Hoyer authored
    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
    b3680f49