When typing "su" (and NOT "su -" -- which works) using /bin/su from >=sys-apps/shadow-4.1.3.1 environment variables LC_ALL, LANG, LANGUAGE are unset. I'm trying to figure out where's the problem looking at source code but the difference between the last working version (sys-apps/shadow-4.1.2.2) and the first one failing is really big. I consider this issue quite critical because changing locale settings affects nl_langinfo() and thus Python's sys.getfilesystemencoding() return value, so any application supporting unicode and relying on that function could die unexpectedly. Reproducible: Always Steps to Reproduce: non-working: 1. emerge >=sys-apps/shadow-4.1.3.1 2. type "su" 3. echo $LC_ALL working (see "su -"): 1. emerge >=sys-apps/shadow-4.1.3.1 2. type "su -" 3. echo $LC_ALL working: 1. emerge =sys-apps/shadow-4.1.2.2 2. type "su" 3. echo $LC_ALL
Upstream bug: https://alioth.debian.org/tracker/index.php?func=detail&aid=311740&group_id=30580&atid=411480 It was opened for half a year now, so I think Gentoo should patch this issue itself. Patch is provided in the above bug report, but I haven't checked it out, because it seems that registration is needed. Anyway it is a very small fix, and if needed I can make patch myself and upload it here.
Please attach the patch here for review.
Created attachment 212009 [details, diff] fixes mistype in libmisc/env.c I made this patch, but I think it's an exact copy of one in the upstream bug report. I tested it and it works.
After reviewing the upstream source, +1 from me. The code in there is horrible, sanitize_env seems to be O(N^2) when it could be O(N) instead.
Thanks everybody involved here, I applied the patch and revision bumped sys-apps/shadow ~arch. I also removed older ~arch versions. +*shadow-4.1.4.2-r1 (04 Dec 2009) + + 04 Dec 2009; Fabio Erculiani <lxnay@gentoo.org> -shadow-4.1.3.1.ebuild, + -shadow-4.1.4.1.ebuild, -shadow-4.1.4.2.ebuild, +shadow-4.1.4.2-r1.ebuild, + +files/shadow-4.1.4.2-env-reset-keep-locale.patch: + Fix invalid environment variables reset, close bug #283725, thanks to + myself for reporting, thanks to parafin for providing a working patch +