1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

r10782: Only parse the group rid_array in net_user_info3() when num_group is > 0.

This fixes the PAC parsing for win2k DCs up to SP3. (Where full SIDs
are stored in the PAC instead of RIDs).

Guenther
This commit is contained in:
Günther Deschner 2005-10-06 18:00:19 +00:00 committed by Gerald (Jerry) Carter
parent f10aa9fb84
commit 3d5d5ddce2

View File

@ -1622,18 +1622,30 @@ BOOL net_io_user_info3(const char *desc, NET_USER_INFO_3 *usr, prs_struct *ps,
if(!prs_align(ps))
return False;
if(!prs_uint32("num_groups2 ", ps, depth, &usr->num_groups2)) /* num groups */
return False;
if (UNMARSHALLING(ps) && usr->num_groups2 > 0) {
usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups2);
if (usr->gids == NULL)
return False;
}
if (usr->num_groups > 0) {
for (i = 0; i < usr->num_groups2; i++) {
if(!smb_io_gid("", &usr->gids[i], ps, depth)) /* group info */
if(!prs_uint32("num_groups2 ", ps, depth, &usr->num_groups2)) /* num groups2 */
return False;
if (usr->num_groups != usr->num_groups2) {
DEBUG(3,("net_io_user_info3: num_groups mismatch! (%d != %d)\n",
usr->num_groups, usr->num_groups2));
return False;
}
if (UNMARSHALLING(ps)) {
usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups);
if (usr->gids == NULL)
return False;
}
for (i = 0; i < usr->num_groups; i++) {
if(!smb_io_gid("", &usr->gids[i], ps, depth)) /* group info */
return False;
}
}
if(!smb_io_unistr2("uni_logon_srv", &usr->uni_logon_srv, usr->hdr_logon_srv.buffer, ps, depth)) /* logon server unicode string */