Den 2023-04-02 kl. 16:22, skrev Arthur de Jong:
On Sun, 2023-02-26 at 10:50 +0100, Arne Nordmark wrote:
The search for enabled services in /etc/nsswitch.conf breaks when
using the Swedish locale.
LANG=C sed -n
's/^[[:space:]]*\([a-z]*\)[[:space:]]*:.*[[:space:]]ldap\([[:space:]].*\)\?/\1/p'
/etc/nsswitch.conf | xargs
gives "passwd group shadow" which is correct, whereas
LANG=sv_SE.UTF-8 sed -n
's/^[[:space:]]*\([a-z]*\)[[:space:]]*:.*[[:space:]]ldap\([[:space:]].*\)\?/\1/p'
/etc/nsswitch.conf | xargs
gives "group".
Interestingly, I cannot reproduce this on unstable (I generated the
proper locale and use LC_ALL instead of LANG to override all LC_*
variables I had set), also minimising the problem doesn't show this
issue:
echo "shadow: " | LC_ALL=C sed -n
's/^[[:space:]]*\([a-z]*\)[[:space:]]*:.*/\1/p'
echo "shadow: " | LC_ALL=sv_SE.UTF-8 sed -n
's/^[[:space:]]*\([a-z]*\)[[:space:]]*:.*/\1/p'
(both return the same output for me)
Indeed, something has changed between buster and bookworm, probably the
locale. So, depending on the unpacking order, this may not even affect
all upgrades from buster to bookworm.
Anyway, I'll change the maintainer scripts to force the C locale so we
have consistent rexex processing by sed, grep and other tools.
Thank you again.
Arne