aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/external.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-11-08 09:48:48 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-11-08 09:48:48 +0000
commit8e68687d2a668ec43831cf91babf72168d4921c0 (patch)
tree7530220e4649069d93f2e7e4705bd559cb58dd1b /winsup/cygwin/external.cc
parentfe359733a40391e86514cb26cbe7a79416313881 (diff)
downloadnewlib-8e68687d2a668ec43831cf91babf72168d4921c0.zip
newlib-8e68687d2a668ec43831cf91babf72168d4921c0.tar.gz
newlib-8e68687d2a668ec43831cf91babf72168d4921c0.tar.bz2
* external.cc (cygwin_internal): Add CW_GET_UID_FROM_SID and
CW_GET_GID_FROM_SID handling. * include/cygwin/version.h: Bump API minor number. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID.
Diffstat (limited to 'winsup/cygwin/external.cc')
-rw-r--r--winsup/cygwin/external.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 8ab0c82..1e75dc1 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -26,6 +26,7 @@ details. */
#include "wincap.h"
#include "heap.h"
#include "cygthread.h"
+#include "pwdgrp.h"
static external_pinfo *
fillout_pinfo (pid_t pid, int winpid)
@@ -278,6 +279,20 @@ cygwin_internal (cygwin_getinfo_types t, ...)
{
return getshmlba ();
}
+ case CW_GET_UID_FROM_SID:
+ {
+ PSID psid = va_arg (arg, PSID);
+ cygsid sid (psid);
+ struct passwd *pw = internal_getpwsid (sid);
+ return pw ? pw->pw_uid : (__uid32_t)-1;
+ }
+ case CW_GET_GID_FROM_SID:
+ {
+ PSID psid = va_arg (arg, PSID);
+ cygsid sid (psid);
+ struct __group32 *gr = internal_getgrsid (sid);
+ return gr ? gr->gr_gid : (__gid32_t)-1;
+ }
default:
return (DWORD) -1;
}