UNIX groups in CYGWIN
Lavrentiev, Anton (NIH/NLM/NCBI) [C]
lavr@ncbi.nlm.nih.gov
Mon Jun 11 16:16:00 GMT 2012
Hi,
I have been porting quite a bit of software from native UNIX environment to CYGWIN,
and despite there is a very elaborate UNIX group handling/mapping in CYGWIN, there
are still a few discrepancies I would like to note:
1. When a user is a member of multiple Windows groups, this fact is not reflected
in /etc/group, which mkgroup creates upon installation. This results in the
user to have more groups in the run-time environment, than those than can be
found using the getgrpnam() API (which supposedly should consult any of group-
providing sources, but in reality seems to look up only /etc/group).
Run-time:
$ id uid=11606(lavr) gid=10513(Domain Users) groups=10513(Domain Users),555(Remote Desktop Users),545(Users),1009(NCBIusers)
Yet getgrpnam() can obtain only the primary group (basically, from /etc/passwd):
10513
If I go ahead and manually add "lavr" to the respective groups in /etc/group (the required
groups are there, just their membership lists are all empty) then the API begins to work
correctly (and returns all groups). This solution works well only if there are just
a couple of users on the system, but for a large set it does not look practical.
Can mkgroup do this for me?
2. Since Windows group names can embed spaces, the output of the "groups" shell command
is unparsable in CYGWIN (scripting becomes problematic), because the space is used both
in the group names (as obtained from Windows) and to delimit the group names in the groups'
output:
$ groups | od -a
0000000 D o m a i n sp U s e r s sp R e m
0000020 o t e sp D e s k t o p sp U s e r
0000040 s sp U s e r s sp N C B I u s e r
0000060 s nl
0000062
Perhaps CYGWIN could have used a tab to separate the group names?
Or list each group on an individual line?
Thanks in advance for considering the above,
Anton Lavrentiev
Contractor NIH/NLM/NCBI
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list