* 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

@ -146,7 +146,10 @@ typedef enum
CW_FREE_DRIVE_MAP,
CW_SETENT,
CW_GETENT,
CW_ENDENT
CW_ENDENT,
CW_GETNSSSEP,
CW_GETPWSID,
CW_GETGRSID
} cygwin_getinfo_types;
#define CW_LOCK_PINFO CW_LOCK_PINFO
@ -200,6 +203,9 @@ typedef enum
#define CW_SETENT CW_SETENT
#define CW_GETENT CW_GETENT
#define CW_ENDENT CW_ENDENT
#define CW_GETNSSSEP CW_GETNSSSEP
#define CW_GETPWSID CW_GETPWSID
#define CW_GETGRSID CW_GETGRSID
/* Token type for CW_SET_EXTERNAL_TOKEN */
enum
@ -208,6 +214,20 @@ CW_TOKEN_IMPERSONATION = 0,
CW_TOKEN_RESTRICTED = 1
};
/* Enumeration source constants for CW_SETENT called from mkpasswd/mkgroup. */
enum nss_enum_t
{
ENUM_NONE = 0x00,
ENUM_CACHE = 0x01,
ENUM_FILES = 0x02,
ENUM_BUILTIN = 0x04,
ENUM_LOCAL = 0x08,
ENUM_PRIMARY = 0x10,
ENUM_TDOMS = 0x20,
ENUM_TDOMS_ALL = 0x40,
ENUM_ALL = 0x7f
};
#define CW_NEXTPID 0x80000000 /* or with pid to get next one */
uintptr_t cygwin_internal (cygwin_getinfo_types, ...);