summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_parse/parse_net.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 7bc277247d..e8f0c02a52 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -1261,7 +1261,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr, SAM_ACCOUNT *sam
usr->user_id = pdb_get_user_rid(sampw);
usr->group_id = pdb_get_group_rid(sampw);
- usr->num_groups = num_groups;
+ usr->num_groups = num_groups+1;
usr->buffer_groups = 1; /* indicates fill in groups, below, even if there are none */
usr->user_flgs = user_flgs;
@@ -1289,16 +1289,21 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr, SAM_ACCOUNT *sam
init_unistr2(&usr->uni_home_dir, home_dir, len_home_dir);
init_unistr2(&usr->uni_dir_drive, dir_drive, len_dir_drive);
- usr->num_groups2 = num_groups;
+ /* always have at least one group == the user's primary group */
+ usr->num_groups2 = num_groups+1;
- if (num_groups > 0) {
- usr->gids = (DOM_GID *)talloc_zero(ctx,sizeof(DOM_GID) * num_groups);
- if (usr->gids == NULL)
- return;
- for (i = 0; i < num_groups; i++)
- usr->gids[i] = gids[i];
- }
+ usr->gids = (DOM_GID *)talloc_zero(ctx,sizeof(DOM_GID) * (num_groups+1));
+ if (usr->gids == NULL)
+ return;
+ /* primary group **MUST** go first. NT4's winmsd.exe will give
+ "The Network statistics are currently not available. 9-5"
+ What the heck is this? -- jerry */
+ usr->gids[0].g_rid = usr->group_id;
+ usr->gids[0].attr = 0x07;
+ for (i = 0; i < num_groups; i++)
+ usr->gids[i+1] = gids[i];
+
init_unistr2(&usr->uni_logon_srv, logon_srv, len_logon_srv);
init_unistr2(&usr->uni_logon_dom, logon_dom, len_logon_dom);