summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-02 01:46:01 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-02 01:46:01 +0000
commit10b82d30b782ad990fc3386a8f0101641780a14e (patch)
tree862c680d264db4e55d6318601b64d3ffc466703b /source3/rpcclient
parentbd4bea62ada937c58d38f6bf7af88c4cfb4115cc (diff)
downloadsamba-10b82d30b782ad990fc3386a8f0101641780a14e.tar.gz
samba-10b82d30b782ad990fc3386a8f0101641780a14e.tar.bz2
samba-10b82d30b782ad990fc3386a8f0101641780a14e.zip
improved enumdomains added -i option.
(This used to be commit 50dc709fa95e86ebe2b3132176241cb3a2cc4e36)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_samr.c28
-rw-r--r--source3/rpcclient/rpcclient.c3
2 files changed, 19 insertions, 12 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 476ea08ea8..078d7d2cc3 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -42,6 +42,18 @@ static void sam_display_domain(const char *domain)
report(out_hnd, "Domain Name: %s\n", domain);
}
+static void sam_display_dom_info(const char* domain, const DOM_SID *sid,
+ uint32 switch_value,
+ SAM_UNK_CTR *ctr)
+{
+ fstring sidstr;
+ sid_to_string(sidstr, sid);
+ report(out_hnd, "Domain Name:\t%s\tSID:\t%s\n", domain, sidstr);
+ display_sam_unk_ctr(out_hnd, ACTION_HEADER , switch_value, ctr);
+ display_sam_unk_ctr(out_hnd, ACTION_ENUMERATE, switch_value, ctr);
+ display_sam_unk_ctr(out_hnd, ACTION_FOOTER , switch_value, ctr);
+}
+
static void sam_display_alias_info(const char *domain, const DOM_SID *sid,
uint32 alias_rid,
ALIAS_INFO_CTR *const ctr)
@@ -2055,33 +2067,26 @@ void cmd_sam_query_dominfo(struct client_info *info, int argc, char *argv[])
fstrcat(srv_name, info->dest_host);
strupper(srv_name);
-
sid_to_string(sid, &info->dom.level5_sid);
fstrcpy(domain, info->dom.level5_dom);
+ string_to_sid(&sid1, sid);
+
if (sid1.num_auths == 0)
{
report(out_hnd, "please use 'lsaquery' first, to ascertain the SID\n");
return;
}
- string_to_sid(&sid1, sid);
-
if (argc > 1)
{
switch_value = strtoul(argv[1], (char**)NULL, 10);
}
- report(out_hnd, "SAM Query Domain Info: info level %d\n", switch_value);
- report(out_hnd, "From: %s Domain: %s SID: %s\n",
- info->myhostname, domain, sid);
-
if (sam_query_dominfo(srv_name, &sid1, switch_value, &ctr))
{
DEBUG(5,("cmd_sam_query_dominfo: succeeded\n"));
- display_sam_unk_ctr(out_hnd, ACTION_HEADER , switch_value, &ctr);
- display_sam_unk_ctr(out_hnd, ACTION_ENUMERATE, switch_value, &ctr);
- display_sam_unk_ctr(out_hnd, ACTION_FOOTER , switch_value, &ctr);
+ sam_display_dom_info(domain, &sid1, switch_value, &ctr);
}
else
{
@@ -2413,7 +2418,8 @@ void cmd_sam_enum_domains(struct client_info *info, int argc, char *argv[])
msrpc_sam_enum_domains(srv_name,
&sam, &num_sam_entries,
- sam_display_domain);
+ request_domain_info ? NULL : sam_display_domain,
+ request_domain_info ? sam_display_dom_info : NULL);
if (sam != NULL)
{
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 2339cc892b..ba40920a40 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -758,6 +758,7 @@ static BOOL process( struct client_info *info, char *cmd_str)
pstring pline;
BOOL at_sym = False;
pline[0] = 0;
+ safe_strcat(pline, "[", sizeof(pline)-1);
if (usr.domain[0] != 0)
{
safe_strcat(pline, usr.domain, sizeof(pline)-1);
@@ -775,7 +776,7 @@ static BOOL process( struct client_info *info, char *cmd_str)
}
safe_strcat(pline, cli_info.dest_host, sizeof(pline)-1);
- safe_strcat(pline, "$ ", sizeof(pline)-1);
+ safe_strcat(pline, "]$ ", sizeof(pline)-1);
#ifndef HAVE_LIBREADLINE