* 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:
		@@ -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, ...);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user