summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-10-06 18:00:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:54 -0500
commit8cbe35f6f8fea2757fb3df49c2b9baa94cf5fe84 (patch)
treec612634eeb79748c5c873cf80ed50d51db215ab4 /source3/rpc_parse
parent0bf72b6e330a76bee502cb36c1cb80c46d47d33c (diff)
downloadsamba-8cbe35f6f8fea2757fb3df49c2b9baa94cf5fe84.tar.gz
samba-8cbe35f6f8fea2757fb3df49c2b9baa94cf5fe84.tar.bz2
samba-8cbe35f6f8fea2757fb3df49c2b9baa94cf5fe84.zip
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 used to be commit 3d5d5ddce2d0c602d985438af996e7af5ccef329)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_net.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 35533e360a..f4ba0e76a1 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -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)
+ if (usr->num_groups > 0) {
+
+ if(!prs_uint32("num_groups2 ", ps, depth, &usr->num_groups2)) /* num groups2 */
return False;
- }
- for (i = 0; i < usr->num_groups2; i++) {
- if(!smb_io_gid("", &usr->gids[i], ps, depth)) /* group info */
+ 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 */