summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-08-28 06:34:08 +0000
committerTim Potter <tpot@samba.org>2001-08-28 06:34:08 +0000
commitcd0a9f6fcc9fbb3071638a17c3aaa579329b4196 (patch)
tree6cef098947ac376bbe2b29610d62666a22c067b7
parent174541b404fb7667daecf3f06cb4c188ee922584 (diff)
downloadsamba-cd0a9f6fcc9fbb3071638a17c3aaa579329b4196.tar.gz
samba-cd0a9f6fcc9fbb3071638a17c3aaa579329b4196.tar.bz2
samba-cd0a9f6fcc9fbb3071638a17c3aaa579329b4196.zip
Send a MSG_SMB_SAM_SYNC when a netlogon_ctrl2 message is received.
(This used to be commit 73e1b708d0ab7a6e612f8910c5815a6ab6de66cd)
-rw-r--r--source3/rpc_server/srv_netlog_nt.c41
1 files changed, 35 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index e29d9393a6..1a2ef02f2c 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -76,26 +76,55 @@ NTSTATUS _net_logon_ctrl(pipes_struct *p, NET_Q_LOGON_CTRL *q_u,
return r_u->status;
}
+/****************************************************************************
+Send a message to smbd to do a sam synchronisation
+**************************************************************************/
+static void send_sync_message()
+{
+ TDB_CONTEXT *tdb;
+
+ tdb = tdb_open_log(lock_path("connections.tdb"), 0,
+ USE_TDB_MMAP_FLAG, O_RDONLY, 0);
+
+ if (!tdb) {
+ DEBUG(3, ("send_sync_message(): failed to open connections "
+ "database\n"));
+ return;
+ }
+
+ DEBUG(3, ("sending sam synchronisation message\n"));
+
+ message_send_all(tdb, MSG_SMB_SAM_SYNC, NULL, 0, False);
+
+ tdb_close(tdb);
+}
+
/*************************************************************************
net_reply_logon_ctrl2:
*************************************************************************/
NTSTATUS _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTRL2 *r_u)
{
- /* lkclXXXX - guess what - absolutely no idea what these are! */
- uint32 flags = 0x0;
- uint32 pdc_connection_status = 0x0;
- uint32 logon_attempts = 0x0;
- uint32 tc_status = ERROR_NO_LOGON_SERVERS;
- char *trusted_domain = "test_domain";
+ uint32 flags = 0x0;
+ uint32 pdc_connection_status = 0x0;
+ uint32 logon_attempts = 0x0;
+ uint32 tc_status = ERROR_NO_LOGON_SERVERS;
+ char *trusted_domain = "test_domain";
+
+ DEBUG(0, ("*** net long ctrl2 %d, %d, %d\n",
+ q_u->function_code, q_u->query_level, q_u->switch_value));
DEBUG(6,("_net_logon_ctrl2: %d\n", __LINE__));
+
/* set up the Logon Control2 response */
init_net_r_logon_ctrl2(r_u, q_u->query_level,
flags, pdc_connection_status, logon_attempts,
tc_status, trusted_domain);
+ if (lp_server_role() == ROLE_DOMAIN_BDC)
+ send_sync_message();
+
DEBUG(6,("_net_logon_ctrl2: %d\n", __LINE__));
return r_u->status;