instead throughout.
(MAX_SID_LEN): Drop. Use SECURITY_MAX_SID_SIZE instead throughout.
+2014-05-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * security.h (MAX_SUBAUTH_CNT): Drop. Use SID_MAX_SUB_AUTHORITIES
+ instead throughout.
+ (MAX_SID_LEN): Drop. Use SECURITY_MAX_SID_SIZE instead throughout.
+
2014-05-06 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Drop unused cygsid variable.
while (cnt < max)
{
cygsid sid;
- DWORD slen = MAX_SID_LEN;
+ DWORD slen = SECURITY_MAX_SID_SIZE;
WCHAR dom[DNLEN + 1];
DWORD dlen = DNLEN + 1;
SID_NAME_USE acc_type;
for (DWORD i = 0; i < cnt; ++i)
{
cygsid gsid;
- DWORD glen = MAX_SID_LEN;
+ DWORD glen = SECURITY_MAX_SID_SIZE;
WCHAR dom[MAX_DOMAIN_NAME_LEN + 1];
DWORD dlen = sizeof (dom);
SID_NAME_USE use = SidTypeInvalid;
for (DWORD i = 0; i < cnt; ++i)
{
cygsid gsid;
- DWORD glen = MAX_SID_LEN;
+ DWORD glen = SECURITY_MAX_SID_SIZE;
WCHAR dom[MAX_DOMAIN_NAME_LEN + 1];
DWORD domlen = MAX_DOMAIN_NAME_LEN + 1;
if (bg_ptr)
{
wcscpy (bg_ptr, dg_ptr);
- glen = MAX_SID_LEN;
+ glen = SECURITY_MAX_SID_SIZE;
domlen = MAX_DOMAIN_NAME_LEN + 1;
if (LookupAccountNameW (NULL, builtin_grp, gsid, &glen,
dom, &domlen, &use))
is not well_known_null_sid, it must match pgrpsid */
if (intern && !groups.issetgroups ())
{
- const DWORD sd_buf_siz = MAX_SID_LEN + sizeof (SECURITY_DESCRIPTOR);
+ const DWORD sd_buf_siz = SECURITY_MAX_SID_SIZE
+ + sizeof (SECURITY_DESCRIPTOR);
PSECURITY_DESCRIPTOR sd_buf = (PSECURITY_DESCRIPTOR) alloca (sd_buf_siz);
cygpsid gsid (NO_SID);
NTSTATUS status;
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;
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
{
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);
{
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);
#define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(gid_t)(g16))
#endif
-#define MAX_SUBAUTH_CNT 11
-#define MAX_SID_LEN (2 * sizeof (BYTE) \
- + sizeof (SID_IDENTIFIER_AUTHORITY) \
- + MAX_SUBAUTH_CNT * sizeof (DWORD))
#define MAX_DACL_LEN(n) (sizeof (ACL) \
- + (n) * (sizeof (ACCESS_ALLOWED_ACE) - sizeof (DWORD) + MAX_SID_LEN))
+ + (n) * (sizeof (ACCESS_ALLOWED_ACE) - sizeof (DWORD) \
+ + SECURITY_MAX_SID_SIZE))
#define SD_MIN_SIZE (sizeof (SECURITY_DESCRIPTOR) + MAX_DACL_LEN (1))
#define ACL_MAXIMUM_SIZE 65532 /* Yeah, right. 64K - sizeof (DWORD). */
#define SD_MAXIMUM_SIZE 65536
BYTE Revision;
BYTE SubAuthorityCount;
SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
- DWORD SubAuthority[MAX_SUBAUTH_CNT];
+ DWORD SubAuthority[SID_MAX_SUB_AUTHORITIES];
} DBGSID, *PDBGSID;
/* Macro to define variable length SID structures */
};
class cygsid : public cygpsid {
- char sbuf[MAX_SID_LEN];
+ char sbuf[SECURITY_MAX_SID_SIZE];
bool well_known_sid;
const PSID getfromstr (PCWSTR nsidstr, bool well_known);
else
{
psid = (PSID) sbuf;
- RtlCopySid (MAX_SID_LEN, psid, nsid);
+ RtlCopySid (SECURITY_MAX_SID_SIZE, psid, nsid);
well_known_sid = well_known;
}
return psid;
cygsid csid;
DWORD nlen = UNLEN + 1;
DWORD dlen = DNLEN + 1;
- DWORD slen = MAX_SID_LEN;
+ DWORD slen = SECURITY_MAX_SID_SIZE;
cygpsid sid (NO_SID);
SID_NAME_USE acc_type;
BOOL ret = false;