summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-24 08:05:12 +0000
committerTim Potter <tpot@samba.org>2001-05-24 08:05:12 +0000
commit076ace3e3d5705e88677b0a0af1a274070950c89 (patch)
treeedad4539e899e21e5e7309b92c5773850c91d2e8 /source3
parent69eb5affbd01f3961077e85f11663de1418f1d13 (diff)
downloadsamba-076ace3e3d5705e88677b0a0af1a274070950c89.tar.gz
samba-076ace3e3d5705e88677b0a0af1a274070950c89.tar.bz2
samba-076ace3e3d5705e88677b0a0af1a274070950c89.zip
Added server side reponse to net_logon_ctrl rpc. We can now respond
to NLTEST /BDC_QUERY:DOMAIN when acting as a BDC. Reverse engineered a couple of status constants. (This used to be commit 0678c302825afef521ae2b80958a1d7c5aa76d23)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_netlog.c35
-rw-r--r--source3/rpc_server/srv_netlog_nt.c30
2 files changed, 62 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c
index 4c13ad0c67..93d7fea554 100644
--- a/source3/rpc_server/srv_netlog.c
+++ b/source3/rpc_server/srv_netlog.c
@@ -282,6 +282,40 @@ static BOOL api_net_logon_ctrl2(pipes_struct *p)
return True;
}
+/*************************************************************************
+ api_net_logon_ctrl:
+ *************************************************************************/
+
+static BOOL api_net_logon_ctrl(pipes_struct *p)
+{
+ NET_Q_LOGON_CTRL q_u;
+ NET_R_LOGON_CTRL r_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ ZERO_STRUCT(q_u);
+ ZERO_STRUCT(r_u);
+
+ DEBUG(6,("api_net_logon_ctrl: %d\n", __LINE__));
+
+ /* grab the lsa netlogon ctrl query... */
+ if(!net_io_q_logon_ctrl("", &q_u, data, 0)) {
+ DEBUG(0,("api_net_logon_ctrl: Failed to unmarshall NET_Q_LOGON_CTRL.\n"));
+ return False;
+ }
+
+ r_u.status = _net_logon_ctrl(p, &q_u, &r_u);
+
+ if(!net_io_r_logon_ctrl("", &r_u, rdata, 0)) {
+ DEBUG(0,("net_reply_logon_ctrl2: Failed to marshall NET_R_LOGON_CTRL2.\n"));
+ return False;
+ }
+
+ DEBUG(6,("api_net_logon_ctrl2: %d\n", __LINE__));
+
+ return True;
+}
+
/*******************************************************************
array of \PIPE\NETLOGON operations
********************************************************************/
@@ -295,6 +329,7 @@ static struct api_struct api_net_cmds [] =
{ "NET_SAMLOGOFF" , NET_SAMLOGOFF , api_net_sam_logoff },
{ "NET_LOGON_CTRL2" , NET_LOGON_CTRL2 , api_net_logon_ctrl2 },
{ "NET_TRUST_DOM_LIST", NET_TRUST_DOM_LIST, api_net_trust_dom_list },
+ { "NET_LOGON_CTRL" , NET_LOGON_CTRL , api_net_logon_ctrl },
{ NULL , 0 , NULL }
};
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 065f94702c..eb026a1f98 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -53,6 +53,30 @@ static void init_net_r_req_chal(NET_R_REQ_CHAL *r_c,
#define ERROR_NO_LOGON_SERVERS 0x51f
/*************************************************************************
+ net_reply_logon_ctrl:
+ *************************************************************************/
+
+/* Some flag values reverse engineered from NLTEST.EXE */
+
+#define LOGON_CTRL_IN_SYNC 0x00
+#define LOGON_CTRL_REPL_NEEDED 0x01
+#define LOGON_CTRL_REPL_IN_PROGRESS 0x02
+
+uint32 _net_logon_ctrl(pipes_struct *p, NET_Q_LOGON_CTRL *q_u,
+ NET_R_LOGON_CTRL *r_u)
+{
+ uint32 flags = 0x0;
+ uint32 pdc_connection_status = 0x00; /* Maybe a win32 error code? */
+
+ /* Setup the Logon Control response */
+
+ init_net_r_logon_ctrl(r_u, q_u->query_level, flags,
+ pdc_connection_status);
+
+ return r_u->status;
+}
+
+/*************************************************************************
net_reply_logon_ctrl2:
*************************************************************************/
@@ -68,9 +92,9 @@ uint32 _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTR
DEBUG(6,("_net_logon_ctrl2: %d\n", __LINE__));
/* set up the Logon Control2 response */
- init_r_logon_ctrl2(r_u, q_u->query_level,
- flags, pdc_connection_status, logon_attempts,
- tc_status, trusted_domain);
+ init_net_r_logon_ctrl2(r_u, q_u->query_level,
+ flags, pdc_connection_status, logon_attempts,
+ tc_status, trusted_domain);
DEBUG(6,("_net_logon_ctrl2: %d\n", __LINE__));