diff options
author | Günther Deschner <gd@samba.org> | 2008-02-13 23:06:09 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-13 23:06:09 +0100 |
commit | 7acdc9e8d6a6311983e1d3f19047293e47f92722 (patch) | |
tree | 270e5a44103d394a47ff71b50fe67507fa9614c8 /source3/rpc_server | |
parent | 3722208ddff6386ff93d8445337442569710ff23 (diff) | |
download | samba-7acdc9e8d6a6311983e1d3f19047293e47f92722.tar.gz samba-7acdc9e8d6a6311983e1d3f19047293e47f92722.tar.bz2 samba-7acdc9e8d6a6311983e1d3f19047293e47f92722.zip |
Use pidl for _netr_LogonControl2.
Guenther
(This used to be commit 4bd02aa6cdfdfd8f3b678fc81a0a1bd70cef9a67)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_netlog.c | 24 | ||||
-rw-r--r-- | source3/rpc_server/srv_netlog_nt.c | 77 |
2 files changed, 51 insertions, 50 deletions
diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c index 1b23cd835a..791752c5d0 100644 --- a/source3/rpc_server/srv_netlog.c +++ b/source3/rpc_server/srv_netlog.c @@ -226,29 +226,7 @@ static bool api_net_trust_dom_list(pipes_struct *p) static bool api_net_logon_ctrl2(pipes_struct *p) { - NET_Q_LOGON_CTRL2 q_u; - NET_R_LOGON_CTRL2 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - - /* grab the lsa netlogon ctrl2 query... */ - if(!net_io_q_logon_ctrl2("", &q_u, data, 0)) { - DEBUG(0,("api_net_logon_ctrl2: Failed to unmarshall NET_Q_LOGON_CTRL2.\n")); - return False; - } - - r_u.status = _net_logon_ctrl2(p, &q_u, &r_u); - - if(!net_io_r_logon_ctrl2("", &r_u, rdata, 0)) { - DEBUG(0,("net_reply_logon_ctrl2: Failed to marshall NET_R_LOGON_CTRL2.\n")); - return False; - } - - return True; + return proxy_netr_call(p, NDR_NETR_LOGONCONTROL2); } /************************************************************************* diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c index 2c52ba87af..3cfab7843d 100644 --- a/source3/rpc_server/srv_netlog_nt.c +++ b/source3/rpc_server/srv_netlog_nt.c @@ -125,29 +125,29 @@ static void send_sync_message(void) } /************************************************************************* - net_reply_logon_ctrl2: + _netr_LogonControl2 *************************************************************************/ -NTSTATUS _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTRL2 *r_u) +WERROR _netr_LogonControl2(pipes_struct *p, + struct netr_LogonControl2 *r) { uint32 flags = 0x0; uint32 pdc_connection_status = 0x0; uint32 logon_attempts = 0x0; uint32 tc_status; - fstring servername, domain, dc_name, dc_name2; + fstring dc_name, dc_name2; struct sockaddr_storage dc_ss; - - /* this should be \\global_myname() */ - unistr2_to_ascii(servername, &q_u->uni_server_name, sizeof(servername)); - - r_u->status = NT_STATUS_OK; + const char *domain = NULL; + struct netr_NETLOGON_INFO_1 *info1; + struct netr_NETLOGON_INFO_2 *info2; + struct netr_NETLOGON_INFO_3 *info3; tc_status = W_ERROR_V(WERR_NO_SUCH_DOMAIN); fstrcpy( dc_name, "" ); - switch ( q_u->function_code ) { + switch (r->in.function_code) { case NETLOGON_CONTROL_TC_QUERY: - unistr2_to_ascii(domain, &q_u->info.info6.domain, sizeof(domain)); + domain = r->in.data->domain; if ( !is_trusted_domain( domain ) ) break; @@ -164,7 +164,7 @@ NTSTATUS _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_C break; case NETLOGON_CONTROL_REDISCOVER: - unistr2_to_ascii(domain, &q_u->info.info6.domain, sizeof(domain)); + domain = r->in.data->domain; if ( !is_trusted_domain( domain ) ) break; @@ -182,19 +182,52 @@ NTSTATUS _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_C default: /* no idea what this should be */ - DEBUG(0,("_net_logon_ctrl2: unimplemented function level [%d]\n", - q_u->function_code)); + DEBUG(0,("_netr_LogonControl2: unimplemented function level [%d]\n", + r->in.function_code)); + return WERR_UNKNOWN_LEVEL; } /* prepare the response */ - init_net_r_logon_ctrl2( r_u, q_u->query_level, flags, - pdc_connection_status, logon_attempts, tc_status, dc_name ); + switch (r->in.level) { + case 1: + info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1); + W_ERROR_HAVE_NO_MEMORY(info1); - if (lp_server_role() == ROLE_DOMAIN_BDC) + init_netlogon_info1(info1, + flags, + pdc_connection_status); + r->out.query->info1 = info1; + break; + case 2: + info2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_2); + W_ERROR_HAVE_NO_MEMORY(info2); + + init_netlogon_info2(info2, + flags, + pdc_connection_status, + dc_name, + tc_status); + r->out.query->info2 = info2; + break; + case 3: + info3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_3); + W_ERROR_HAVE_NO_MEMORY(info3); + + init_netlogon_info3(info3, + flags, + logon_attempts); + r->out.query->info3 = info3; + break; + default: + return WERR_UNKNOWN_LEVEL; + } + + if (lp_server_role() == ROLE_DOMAIN_BDC) { send_sync_message(); + } - return r_u->status; + return WERR_OK; } /************************************************************************* @@ -1320,16 +1353,6 @@ WERROR _netr_GetAnyDCName(pipes_struct *p, /**************************************************************** ****************************************************************/ -WERROR _netr_LogonControl2(pipes_struct *p, - struct netr_LogonControl2 *r) -{ - p->rng_fault_state = true; - return WERR_NOT_SUPPORTED; -} - -/**************************************************************** -****************************************************************/ - NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p, struct netr_ServerAuthenticate2 *r) { |