sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.16k stars 208 forks source link

Unable to run tests from 1.9.13 with auto-detected C.UTF-8 locale name #241

Closed foutrelis closed 1 year ago

foutrelis commented 1 year ago

In Arch Linux build chroots locale -a returns:

C
C.UTF-8
C.utf8
POSIX
de_DE.utf8
en_US.utf8

Looking at https://github.com/sudo-project/sudo/commit/5683fc6f7a743b2ecf1830f80a4e278593335da0 I can see how we end up with:

l='C.UTF-8  <-- note the newline
C.utf8'

Running the tests results in errors like the following:

/bin/sh: line 4: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8
C.utf8): No such file or directory
fuzz_sudo_conf: verifying corpus
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8
C.utf8)
/bin/sh: line 4: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8
C.utf8): No such file or directory
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8
C.utf8)

Disclaimer: I am not sure why we have two names for the C.UTF-8 locale inside build chroots. On my regular Arch installations I don't see the C.utf8 one.

foutrelis commented 1 year ago

As an aside, @anthraxx was kind enough to point out where C.utf8 comes from; seems we need to stop adding C.UTF-8 UTF-8 to locale.gen now that the C.UTF-8 locale is built-in.

millert commented 1 year ago

Thanks for reporting this, it is fixed by 2845cea.