* external.cc (cygwin_internal): Add cases for CW_GETNSSSEP,

CW_GETPWSID and CW_GETGRSID.
	* grp.cc (internal_getgrsid_from_db): New function.
	* passwd.cc (internal_getpwsid_from_db): New function.
	(pg_ent::setent): Add special case for call from mkpasswd/mkgroup.
	* pwdgrp.h (internal_getpwsid_from_db): Declare.
	(internal_getgrsid_from_db): Declare.
	(enum nss_enum_t): Move to include/sys/cygwin.h.
	(class pg_ent): Add comment.
	* uinfo.cc (pwdgrp::fetch_account_from_windows): Fix typo in comment.
	Change "UNIX" to "Unix" in domain name.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GETNSSSEP,
	CW_GETPWSID and CW_GETGRSID.
	(enum nss_enum_t): Define here.
This commit is contained in:
Corinna Vinschen
2014-02-22 19:38:12 +00:00
parent 98cc373860
commit b211f4c17e
7 changed files with 98 additions and 27 deletions

View File

@ -1720,12 +1720,12 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, bool group,
{
/* Samba UNIX Users/Groups
This *might* colide with a posix_offset of some trusted domain.
This *might* collide with a posix_offset of some trusted domain.
It's just very unlikely. */
uid = MAP_UNIX_TO_CYGWIN_ID (sid_sub_auth_rid (sid));
/* Unfortunately we have no access to the file server from here,
so we can't generate correct user names. */
p = wcpcpy (dom, L"UNIX_");
p = wcpcpy (dom, L"Unix_");
wcpcpy (p, sid_sub_auth (sid, 0) == 1 ? L"User" : L"Group");
__small_swprintf (name = namebuf, L"%d", uid & UNIX_POSIX_MASK);
name_style = fully_qualified;