summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-04-20 05:17:55 +0000
committerLuke Leighton <lkcl@samba.org>2000-04-20 05:17:55 +0000
commit58df3662a95bf8151c0906e368949d9fce8ca02b (patch)
tree93e94c25c932e08ae29fcad97836e963214bb20f
parent2448d83d4cc0b1a7a0192f61a042e7b733852f47 (diff)
downloadsamba-58df3662a95bf8151c0906e368949d9fce8ca02b.tar.gz
samba-58df3662a95bf8151c0906e368949d9fce8ca02b.tar.xz
samba-58df3662a95bf8151c0906e368949d9fce8ca02b.zip
added client-side net_enum_trust_dom_list because am trying to track down
a reliability-bug.
-rw-r--r--source/include/proto.h2
-rw-r--r--source/include/rpc_client_proto.h1
-rw-r--r--source/rpc_client/cli_lsarpc.c2
-rw-r--r--source/rpc_client/cli_netlogon.c57
-rw-r--r--source/rpcclient/cmd_netlogon.c29
-rw-r--r--source/rpcclient/netlogon_cmds.c6
6 files changed, 97 insertions, 0 deletions
diff --git a/source/include/proto.h b/source/include/proto.h
index 746474d37d1..a150a4b9565 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -2586,6 +2586,7 @@ BOOL lsa_close(POLICY_HND *hnd);
/*The following definitions come from rpc_client/cli_netlogon.c */
void gen_next_creds(struct ntdom_info *nt, DOM_CRED * new_clnt_cred);
+uint32 cli_net_trust_dom_list(const char *srv_name, BUFFER2 *uni_dom);
BOOL cli_net_logon_ctrl2(const char *srv_name, uint32 status_level);
uint32 cli_net_auth2(const char *srv_name,
const char *trust_acct,
@@ -4949,6 +4950,7 @@ void cmd_lsa_query_secret(struct client_info *info, int argc, char *argv[]);
/*The following definitions come from rpcclient/cmd_netlogon.c */
void cmd_netlogon_pwset(struct client_info *info, int argc, char *argv[]);
+void cmd_netlogon_dom_list(struct client_info *info, int argc, char *argv[]);
void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]);
void cmd_netlogon_domain_test(struct client_info *info, int argc,
char *argv[]);
diff --git a/source/include/rpc_client_proto.h b/source/include/rpc_client_proto.h
index e34ac01e7fc..5398f28bbf0 100644
--- a/source/include/rpc_client_proto.h
+++ b/source/include/rpc_client_proto.h
@@ -165,6 +165,7 @@ BOOL lsa_close(POLICY_HND *hnd);
/*The following definitions come from rpc_client/cli_netlogon.c */
void gen_next_creds(struct ntdom_info *nt, DOM_CRED * new_clnt_cred);
+uint32 cli_net_trust_dom_list(const char *srv_name, BUFFER2 *uni_dom);
BOOL cli_net_logon_ctrl2(const char *srv_name, uint32 status_level);
uint32 cli_net_auth2(const char *srv_name,
const char *trust_acct,
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 1dc0aab05b3..0398f09d014 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -1136,6 +1136,8 @@ BOOL lsa_enum_trust_dom(POLICY_HND *hnd, uint32 * enum_ctx,
LSA_R_ENUM_TRUST_DOM r_q;
BOOL p;
+ ZERO_STRUCT(r_q);
+
lsa_io_r_enum_trust_dom("", &r_q, &rbuf, 0);
p = rbuf.offset != 0;
diff --git a/source/rpc_client/cli_netlogon.c b/source/rpc_client/cli_netlogon.c
index 68e1e034ee2..1261e370700 100644
--- a/source/rpc_client/cli_netlogon.c
+++ b/source/rpc_client/cli_netlogon.c
@@ -50,6 +50,63 @@ void gen_next_creds(struct ntdom_info *nt, DOM_CRED * new_clnt_cred)
}
/****************************************************************************
+do a net trust domain list
+****************************************************************************/
+uint32 cli_net_trust_dom_list(const char *srv_name, BUFFER2 *uni_dom)
+{
+ prs_struct rbuf;
+ prs_struct buf;
+ NET_Q_TRUST_DOM_LIST q_l;
+ uint32 status = 0x0;
+
+ struct cli_connection *con = NULL;
+
+ if (!cli_connection_init(srv_name, PIPE_NETLOGON, &con))
+ {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ prs_init(&buf, 0, 4, False);
+ prs_init(&rbuf, 0, 4, True);
+
+ /* create and send a MSRPC command with api NET_TRUST_DOM_LIST */
+
+ DEBUG(4, ("net_trust_dom_list\n"));
+
+ /* store the parameters */
+ q_l.ptr = 1;
+ make_unistr2(&q_l.uni_server_name, srv_name, 0);
+
+ /* turn parameters into data stream */
+ if (net_io_q_trust_dom("", &q_l, &buf, 0) &&
+ rpc_con_pipe_req(con, NET_TRUST_DOM_LIST, &buf, &rbuf))
+ {
+ NET_R_TRUST_DOM_LIST r_l;
+
+ net_io_r_trust_dom("", &r_l, &rbuf, 0);
+ if (rbuf.offset == 0)
+ {
+ status = NT_STATUS_INVALID_PARAMETER;
+ }
+ else if (status == 0x0)
+ {
+ status = r_l.status;
+ }
+ *uni_dom = r_l.uni_trust_dom_name;
+ }
+ else
+ {
+ status = NT_STATUS_INVALID_PARAMETER;
+ }
+
+ prs_free_data(&rbuf);
+ prs_free_data(&buf);
+
+ cli_connection_unlink(con);
+ return status;
+}
+
+/****************************************************************************
do a LSA Logon Control2
****************************************************************************/
BOOL cli_net_logon_ctrl2(const char *srv_name, uint32 status_level)
diff --git a/source/rpcclient/cmd_netlogon.c b/source/rpcclient/cmd_netlogon.c
index f3c4de7b6bb..83c06e358ca 100644
--- a/source/rpcclient/cmd_netlogon.c
+++ b/source/rpcclient/cmd_netlogon.c
@@ -214,6 +214,35 @@ void cmd_netlogon_pwset(struct client_info *info, int argc, char *argv[])
/****************************************************************************
+experimental nt trusted domain list.
+****************************************************************************/
+void cmd_netlogon_dom_list(struct client_info *info, int argc, char *argv[])
+{
+ uint32 status;
+ fstring domains;
+ BUFFER2 buf;
+
+ fstring srv_name;
+
+ fstrcpy(srv_name, "\\\\");
+ fstrcat(srv_name, info->dest_host);
+ strupper(srv_name);
+
+ status = cli_net_trust_dom_list(srv_name, &buf);
+ if (status == 0x0)
+ {
+ buffer2_to_multistr(domains, &buf, sizeof(domains));
+ }
+ else
+ {
+ ZERO_STRUCT(domains);
+ }
+
+ report(out_hnd, "cmd_nt_login: login (%s) test succeeded: %s\n",
+ domains, BOOLSTR(status == 0x0));
+}
+
+/****************************************************************************
experimental nt login.
****************************************************************************/
void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[])
diff --git a/source/rpcclient/netlogon_cmds.c b/source/rpcclient/netlogon_cmds.c
index d0903149f7f..f049cb8c52b 100644
--- a/source/rpcclient/netlogon_cmds.c
+++ b/source/rpcclient/netlogon_cmds.c
@@ -41,6 +41,12 @@ static const struct command_set ntl_commands[] =
{NULL, NULL}
},
{
+ "domlist",
+ cmd_netlogon_dom_list,
+ "NT Trusted Domain list",
+ {NULL, NULL}
+ },
+ {
"domtrust",
cmd_netlogon_domain_test,
"<domain> NT Inter-Domain test",