summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/sec_helper.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-05-06 12:28:33 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-05-06 12:28:33 +0000
commitfc3a3524b243956ad1c483a7436ddd37849ce2a9 (patch)
treea3bc68ed17256bf6c3b55db4362d6f866a54472f /winsup/cygwin/sec_helper.cc
parent439b7db7850cb69d8119308c5b6f16d1e596161f (diff)
downloadcygnal-fc3a3524b243956ad1c483a7436ddd37849ce2a9.tar.gz
cygnal-fc3a3524b243956ad1c483a7436ddd37849ce2a9.tar.bz2
cygnal-fc3a3524b243956ad1c483a7436ddd37849ce2a9.zip
* security.h (MAX_SUBAUTH_CNT): Drop. Use SID_MAX_SUB_AUTHORITIES
instead throughout. (MAX_SID_LEN): Drop. Use SECURITY_MAX_SID_SIZE instead throughout.
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r--winsup/cygwin/sec_helper.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 6f7921aa5..00123935b 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -218,7 +218,7 @@ cygsid::get_sid (DWORD s, DWORD cnt, DWORD *r, bool well_known)
SID_IDENTIFIER_AUTHORITY sid_auth = { SECURITY_NULL_SID_AUTHORITY };
# define SECURITY_NT_AUTH 5
- if (s > 255 || cnt < 1 || cnt > MAX_SUBAUTH_CNT)
+ if (s > 255 || cnt < 1 || cnt > SID_MAX_SUB_AUTHORITIES)
{
psid = NO_SID;
return NULL;
@@ -226,7 +226,7 @@ cygsid::get_sid (DWORD s, DWORD cnt, DWORD *r, bool well_known)
sid_auth.Value[5] = s;
set ();
RtlInitializeSid (psid, &sid_auth, cnt);
- PDBGSID dsid = (PDBGSID) psid;
+ PISID dsid = (PISID) psid;
for (i = 0; i < cnt; ++i)
dsid->SubAuthority[i] = r[i];
/* If the well_known flag isn't set explicitely, we check the SID
@@ -248,12 +248,12 @@ cygsid::getfromstr (PCWSTR nsidstr, bool well_known)
{
PWCHAR lasts;
DWORD s, cnt = 0;
- DWORD r[MAX_SUBAUTH_CNT];
+ DWORD r[SID_MAX_SUB_AUTHORITIES];
if (nsidstr && !wcsncmp (nsidstr, L"S-1-", 4))
{
s = wcstoul (nsidstr + 4, &lasts, 10);
- while (cnt < MAX_SUBAUTH_CNT && *lasts == '-')
+ while (cnt < SID_MAX_SUB_AUTHORITIES && *lasts == '-')
r[cnt++] = wcstoul (lasts + 1, &lasts, 10);
if (!*lasts)
return get_sid (s, cnt, r, well_known);
@@ -266,12 +266,12 @@ cygsid::getfromstr (const char *nsidstr, bool well_known)
{
char *lasts;
DWORD s, cnt = 0;
- DWORD r[MAX_SUBAUTH_CNT];
+ DWORD r[SID_MAX_SUB_AUTHORITIES];
if (nsidstr && !strncmp (nsidstr, "S-1-", 4))
{
s = strtoul (nsidstr + 4, &lasts, 10);
- while (cnt < MAX_SUBAUTH_CNT && *lasts == '-')
+ while (cnt < SID_MAX_SUB_AUTHORITIES && *lasts == '-')
r[cnt++] = strtoul (lasts + 1, &lasts, 10);
if (!*lasts)
return get_sid (s, cnt, r, well_known);