summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-08-30 17:07:53 +0000
committerLuke Leighton <lkcl@samba.org>1999-08-30 17:07:53 +0000
commit501acbba23fb5b6830ec6311ab53475a945a13b2 (patch)
tree893e0f158f7f5ec1c3a5bcb1761ab9abc65cd8ad /source3/rpcclient
parent42fdd41b1d3e59f9052a9b382d0369315f77e718 (diff)
downloadsamba-501acbba23fb5b6830ec6311ab53475a945a13b2.tar.gz
samba-501acbba23fb5b6830ec6311ab53475a945a13b2.tar.bz2
samba-501acbba23fb5b6830ec6311ab53475a945a13b2.zip
added call to samr_query_groupinfo in enumgroups command (-m option)
(This used to be commit e2a72e2c64d6aad37d0c0f94d36f4fdadd3bd6cc)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_samr.c45
1 files changed, 39 insertions, 6 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 045160f78c..e4113f4b5d 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -1207,6 +1207,24 @@ static void req_user_info(struct client_info *info, uint16 fnum,
}
}
+static void query_groupinfo(struct client_info *info, uint16 fnum,
+ uint32 group_rid)
+{
+ GROUP_INFO_CTR ctr;
+
+ /* send group info query */
+ if (get_samr_query_groupinfo(smb_cli, fnum,
+ &info->dom.samr_pol_open_domain,
+ group_rid, 1, &ctr))
+ {
+#if 0
+ display_samr_groupinfo(out_hnd, ACTION_HEADER , &ctr);
+ display_samr_groupinfo(out_hnd, ACTION_ENUMERATE, &ctr);
+ display_samr_groupinfo(out_hnd, ACTION_FOOTER , &ctr);
+#endif
+ }
+}
+
static void req_group_info(struct client_info *info, uint16 fnum,
uint32 user_rid)
{
@@ -1422,14 +1440,14 @@ void cmd_sam_enum_users(struct client_info *info)
user_rid,
info->dom.sam[user_idx].acct_name);
- if (request_user_info)
+ if (request_group_info)
{
- req_user_info(info, fnum, user_rid);
+ req_group_info(info, fnum, user_rid);
}
- if (request_group_info)
+ if (request_user_info)
{
- req_group_info(info, fnum, user_rid);
+ req_user_info(info, fnum, user_rid);
}
if (request_alias_info)
@@ -1863,9 +1881,11 @@ void cmd_sam_enum_groups(struct client_info *info)
DOM_SID sid1;
BOOL res = True;
BOOL request_member_info = False;
+ BOOL request_group_info = False;
uint32 ace_perms = 0x02000000; /* access control permissions. */
fstring tmp;
uint32 group_idx;
+ int i;
sid_copy(&sid1, &info->dom.level5_sid);
@@ -1883,9 +1903,18 @@ void cmd_sam_enum_groups(struct client_info *info)
strupper(srv_name);
/* a bad way to do token parsing... */
- if (next_token(NULL, tmp, NULL, sizeof(tmp)))
+ for (i = 0; i < 2; i++)
{
- request_member_info |= strequal(tmp, "-m");
+ /* a bad way to do token parsing... */
+ if (next_token(NULL, tmp, NULL, sizeof(tmp)))
+ {
+ request_member_info |= strequal(tmp, "-m");
+ request_group_info |= strequal(tmp, "-g");
+ }
+ else
+ {
+ break;
+ }
}
fprintf(out_hnd, "SAM Enumerate Groups\n");
@@ -1928,6 +1957,10 @@ void cmd_sam_enum_groups(struct client_info *info)
group_rid,
info->dom.sam[group_idx].acct_name);
+ if (request_group_info)
+ {
+ query_groupinfo(info, fnum, group_rid);
+ }
if (request_member_info)
{
req_groupmem_info(info, fnum, group_rid);