sd_size = 0;
}
-#if 0 // unused
-#define SIDLEN (sidlen = MAX_SID_LEN, &sidlen)
-#define DOMLEN (domlen = INTERNET_MAX_HOST_NAME_LENGTH, &domlen)
-
-BOOL
-lookup_name (const char *name, const char *logsrv, PSID ret_sid)
-{
- cygsid sid;
- DWORD sidlen;
- char domuser[INTERNET_MAX_HOST_NAME_LENGTH + UNLEN + 2];
- char dom[INTERNET_MAX_HOST_NAME_LENGTH + 1];
- DWORD domlen;
- SID_NAME_USE acc_type;
-
- debug_printf ("name : %s", name ? name : "NULL");
-
- if (!name)
- return FALSE;
-
- if (cygheap->user.domain ())
- {
- strcat (strcat (strcpy (domuser, cygheap->user.domain ()), "\\"), name);
- if (LookupAccountName (NULL, domuser, sid, SIDLEN, dom, DOMLEN, &acc_type)
- && legal_sid_type (acc_type))
- goto got_it;
- if (logsrv && *logsrv
- && LookupAccountName (logsrv, domuser, sid, SIDLEN,
- dom, DOMLEN, &acc_type)
- && legal_sid_type (acc_type))
- goto got_it;
- }
- if (logsrv && *logsrv)
- {
- if (LookupAccountName (logsrv, name, sid, SIDLEN, dom, DOMLEN, &acc_type)
- && legal_sid_type (acc_type))
- goto got_it;
- if (acc_type == SidTypeDomain)
- {
- strcat (strcat (strcpy (domuser, dom), "\\"), name);
- if (LookupAccountName (logsrv, domuser, sid, SIDLEN,
- dom, DOMLEN, &acc_type))
- goto got_it;
- }
- }
- if (LookupAccountName (NULL, name, sid, SIDLEN, dom, DOMLEN, &acc_type)
- && legal_sid_type (acc_type))
- goto got_it;
- if (acc_type == SidTypeDomain)
- {
- strcat (strcat (strcpy (domuser, dom), "\\"), name);
- if (LookupAccountName (NULL, domuser, sid, SIDLEN, dom, DOMLEN,&acc_type))
- goto got_it;
- }
- debug_printf ("LookupAccountName (%s) %E", name);
- __seterrno ();
- return FALSE;
-
-got_it:
- debug_printf ("sid : [%d]", *GetSidSubAuthority ((PSID) sid,
- *GetSidSubAuthorityCount ((PSID) sid) - 1));
-
- if (ret_sid)
- memcpy (ret_sid, sid, sidlen);
-
- return TRUE;
-}
-
-#undef SIDLEN
-#undef DOMLEN
-#endif //unused
-
/* Index must match the correspoding foo_PRIVILEGE value, see security.h. */
static const char *cygpriv[] =
{