[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test failures in coreutils-5.3.0 on cygwin
From: |
Eric Blake |
Subject: |
Re: Test failures in coreutils-5.3.0 on cygwin |
Date: |
Wed, 19 Jan 2005 07:25:49 -0700 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paul Eggert on 1/17/2005 3:42 PM:
> Conceivably this problem could occur on Unix too. I installed this
> patch to work around it (on Unix, anyway) by using group numbers
> rather than names.
>
> 2005-01-17 Paul Eggert <address@hidden>
>
> * tests/group-names: Use numeric group ids, not symbolic group names,
> since the latter can have shell metacharacters in them (e.g., spaces).
> Problem reported by Eric Blake.
> * tests/chgrp/basic: Assume groups are numeric, not symbolic.
However, POSIX requires that a group name that is completely numeric (yes,
that is a portable group name) takes preference over a group number. In
other words, if group 1 is named "2", but I am only a member of group 2
named "two", then the chgrp tests will still fail because `chgrp 2 file'
should resolve to a call to chown("file", -1, 1), not chown("file", -1,
2). If only your testsuite could add users/groups for the duration of the
test, to prove that chgrp is correctly favoring names over numbers.
Also, I noticed some other tests in the suite that were sensitive to group
names. At the moment, I'm not on the machine where I noticed all the
problems, but off the top of my head, I remember that at least
chown/separator was calling `id' directly rather than relying on
group-names, and failing when id returned a space-separated name.
Is there any program that makes it easy to map between group names and
numbers, other than manually trying to parse /etc/group? Is it worth
adding more GNU extensions to the id program to accomplish this? I
envision something like the following, using the group name examples above:
id --map -gn 1 # $?=0, prints 2
id --map -gn 2 # $?=0, prints two
id --map -g 1 # $?=1, stderr mentions group not found
id --map -g 2 # $?=0, prints 1
id --map -g two # $?=0, prints 2
# and likewise for id --map -u; using -n maps from number to name,
otherwise map name to number
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB7m3s84KuGfSFAYARAof/AJ9g+COk9Xm6EoVVss70JQfR5KGkCwCfSkIH
tRzFQuGal1niY9YK604XJ40=
=PTCW
-----END PGP SIGNATURE-----