getent group fails
Corinna Vinschen
corinna-cygwin@cygwin.com
Sat May 10 11:57:00 GMT 2014
On May 9 19:06, Denis Excoffier wrote:
> On 2014-05-09 11:13, Corinna Vinschen wrote:
> > On May 7 19:39, Denis Excoffier wrote:
> > Thanks for the report. I made a dumb Copy/paste error. This should
> > be fixed in the today's snapshot from http://cygwin.com/snapshots/
>
> Indeed, it is working now.
>
> Also, i have noticed that 'getent group' produces this line:
>
> +Utilisateurs authentifiés:S-1-5-11:11:
> (with \303\251 meaning é, like under UTF-8)
>
> while 'getent passwd' produces (among other lines):
>
> +SERVICE RÉSEAU:*:20:20:,S-1-5-20:/:/sbin/nologin
> (with \311 meaning É, like under ISO-Latin)
>
> This is with LC_CTYPE=fr_FR, no /etc/nsswitch.conf, /etc/passwd
> and /etc/group with only one line each, domain member with currently no
> network connected, under Cygwin 32bits 'Just Me', installed on top of
> XP SP3 32bits [french only], with snapshot '20140508 19:51:25’,
> and all packages up-to-date.
>
> If i setenv LC_CTYPE C, or unsetenv LC_CTYPE, i also get UTF-8 for
> 'getent passwd' (ie for both).
>
> What bothers me is that under LC_CTYPE=fr_FR (or fr_FR@euro), the
> getent output is not consistent.
I can't explain that. In both cases, getent calls setlocale(LC_ALL, "").
In both cases, the account information comes as UTF-16 string from
the OS and is converted to multibyte in Cygwin.
The only (vague) idea I have is that this may be a result of caching.
If the first account ("authenticated users") has been fetched while
LANG was still set to "C" or "C.UTF-8", it would explain this
discrepancy.
Which shows that using non UTF-8 locales is not such a good idea. There
is a chicken-egg problem. Early initialization always uses UTF-8 for
hopefully obvious reasons. Using UTF-8 in all multibyte scenarios is
really the way to go in future.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140510/e74d06a7/attachment.sig>
More information about the Cygwin
mailing list