summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-06-09 03:00:34 +0000
committerLuke Leighton <lkcl@samba.org>2000-06-09 03:00:34 +0000
commitad98207f54a7e3d88108d34c4cf365d5f8bc23ef (patch)
treeb23fa45bf861976ae96b27353cfed15b659cfb8c /source3/rpc_parse
parenteee003da6aee5ffc00e318fc0390e6b19151a675 (diff)
downloadsamba-ad98207f54a7e3d88108d34c4cf365d5f8bc23ef.tar.gz
samba-ad98207f54a7e3d88108d34c4cf365d5f8bc23ef.tar.bz2
samba-ad98207f54a7e3d88108d34c4cf365d5f8bc23ef.zip
dynamic allocation of NET_USER_INFO_3 gids.
jeremy, the intent is to call se_access_check() with usr-sid, grp-sid, array-of-group-rids (but array-of-group-sids would do). please do look at smbd/lanman.c's api_NetWkstaGetInfo, it will show you that we really do need to store the entire NET_USER_INFO_3 structure. then again, api_NetWkstaGetInfo is only used by win9x so who cares :) (This used to be commit bd34f652390adc32c4959d164c628687f526d977)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_net.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 912e18600e..c1b16b8864 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -1070,10 +1070,14 @@ void init_net_user_info3(NET_USER_INFO_3 *usr,
usr->num_groups2 = num_groups;
- SMB_ASSERT_ARRAY(usr->gids, num_groups);
-
- for (i = 0; i < num_groups; i++)
- usr->gids[i] = gids[i];
+ if (num_groups > 0)
+ {
+ usr->gids = g_new(DOM_GID, num_groups);
+ if (usr->gids == NULL)
+ return;
+ for (i = 0; i < num_groups; i++)
+ usr->gids[i] = gids[i];
+ }
init_unistr2(&usr->uni_logon_srv, logon_srv, len_logon_srv);
init_unistr2(&usr->uni_logon_dom, logon_dom, len_logon_dom);
@@ -1183,7 +1187,14 @@ static BOOL net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps,
return False;
if(!prs_uint32("num_groups2 ", ps, depth, &usr->num_groups2)) /* num groups */
return False;
- SMB_ASSERT_ARRAY(usr->gids, usr->num_groups2);
+
+ if (UNMARSHALLING(ps) && usr->num_groups2 > 0)
+ {
+ usr->gids = g_new(DOM_GID, usr->num_groups2);
+ if (usr->gids == NULL)
+ return False;
+ }
+
for (i = 0; i < usr->num_groups2; i++) {
if(!smb_io_gid("", &usr->gids[i], ps, depth)) /* group info */
return False;