2 Unix SMB/CIFS implementation.
3 NBT netbios routines and daemon - version 2
4 Copyright (C) Andrew Tridgell 1994-1998
5 Copyright (C) Luke Kenneth Casson Leighton 1994-1998
6 Copyright (C) Jeremy Allison 1994-2003
7 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #include "../libcli/netlogon.h"
28 #include "../libcli/cldap/cldap.h"
29 #include "../lib/tsocket/tsocket.h"
30 #include "../libcli/security/dom_sid.h"
32 #include "nmbd/nmbd.h"
34 struct sam_database_info {
36 uint32 serial_lo, serial_hi;
37 uint32 date_lo, date_hi;
41 * check whether the client belongs to the hosts
42 * for which initial logon should be delayed...
44 static bool delay_logon(const char *peer_name, const char *peer_addr)
46 const char **delay_list = lp_init_logon_delayed_hosts();
49 if (delay_list == NULL) {
56 return list_match(delay_list, (const char *)peer, client_match);
59 static void delayed_init_logon_handler(struct event_context *event_ctx,
60 struct timed_event *te,
64 struct packet_struct *p = (struct packet_struct *)private_data;
66 DEBUG(10, ("delayed_init_logon_handler (%lx): re-queuing packet.\n",
74 struct nmbd_proxy_logon_context {
75 struct cldap_socket *cldap_sock;
78 static struct nmbd_proxy_logon_context *global_nmbd_proxy_logon;
80 bool initialize_nmbd_proxy_logon(void)
82 const char *cldap_server = lp_parm_const_string(-1, "nmbd_proxy_logon",
83 "cldap_server", NULL);
84 struct nmbd_proxy_logon_context *ctx;
87 char addrstr[INET_ADDRSTRLEN];
88 const char *server_str;
90 struct tsocket_address *server_addr;
96 addr = interpret_addr2(cldap_server);
97 server_str = inet_ntop(AF_INET, &addr,
98 addrstr, sizeof(addrstr));
99 if (!server_str || strcmp("0.0.0.0", server_str) == 0) {
100 DEBUG(0,("Failed to resolve[%s] for nmbd_proxy_logon\n",
105 ctx = talloc_zero(nmbd_event_context(),
106 struct nmbd_proxy_logon_context);
111 ret = tsocket_address_inet_from_strings(ctx, "ipv4",
112 server_str, LDAP_PORT,
116 status = map_nt_error_from_unix(errno);
117 DEBUG(0,("Failed to create cldap tsocket_address for %s - %s\n",
118 server_str, nt_errstr(status)));
122 /* we create a connected udp socket */
123 status = cldap_socket_init(ctx, nmbd_event_context(), NULL,
124 server_addr, &ctx->cldap_sock);
125 TALLOC_FREE(server_addr);
126 if (!NT_STATUS_IS_OK(status)) {
128 DEBUG(0,("failed to create cldap socket for %s: %s\n",
129 server_str, nt_errstr(status)));
133 global_nmbd_proxy_logon = ctx;
137 struct nmbd_proxy_logon_state {
138 struct in_addr local_ip;
139 struct packet_struct *p;
140 const char *remote_name;
141 uint8_t remote_name_type;
142 const char *remote_mailslot;
143 struct nbt_netlogon_packet req;
144 struct nbt_netlogon_response resp;
145 struct cldap_netlogon io;
148 static int nmbd_proxy_logon_state_destructor(struct nmbd_proxy_logon_state *s)
150 s->p->locked = false;
155 static void nmbd_proxy_logon_done(struct tevent_req *subreq);
157 static void nmbd_proxy_logon(struct nmbd_proxy_logon_context *ctx,
158 struct in_addr local_ip,
159 struct packet_struct *p,
163 struct nmbd_proxy_logon_state *state;
164 enum ndr_err_code ndr_err;
165 DATA_BLOB blob = data_blob_const(buf, len);
166 const char *computer_name = NULL;
167 const char *mailslot_name = NULL;
168 const char *user_name = NULL;
169 const char *domain_sid = NULL;
170 uint32_t acct_control = 0;
171 uint32_t nt_version = 0;
172 struct tevent_req *subreq;
174 struct dgram_packet *dgram = &p->packet.dgram;
176 state = TALLOC_ZERO_P(ctx, struct nmbd_proxy_logon_state);
178 DEBUG(0,("failed to allocate nmbd_proxy_logon_state\n"));
182 pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name);
183 state->remote_name = talloc_strdup(state, source_name);
184 state->remote_name_type = dgram->source_name.name_type,
185 state->local_ip = local_ip;
188 ndr_err = ndr_pull_struct_blob(
189 &blob, state, &state->req,
190 (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
191 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
192 NTSTATUS status = ndr_map_error2ntstatus(ndr_err);
193 DEBUG(0,("failed parse nbt_netlogon_packet: %s\n",
199 if (DEBUGLEVEL >= 10) {
200 DEBUG(10, ("nmbd_proxy_logon:\n"));
201 NDR_PRINT_DEBUG(nbt_netlogon_packet, &state->req);
204 switch (state->req.command) {
205 case LOGON_SAM_LOGON_REQUEST:
206 computer_name = state->req.req.logon.computer_name;
207 user_name = state->req.req.logon.user_name;
208 mailslot_name = state->req.req.logon.mailslot_name;
209 acct_control = state->req.req.logon.acct_control;
210 if (state->req.req.logon.sid_size > 0) {
211 domain_sid = dom_sid_string(state,
212 &state->req.req.logon.sid);
214 DEBUG(0,("failed to get a string for sid\n"));
219 nt_version = state->req.req.logon.nt_version;
223 /* this can't happen as the caller already checks the command */
227 state->remote_mailslot = mailslot_name;
229 if (user_name && strlen(user_name) == 0) {
233 if (computer_name && strlen(computer_name) == 0) {
234 computer_name = NULL;
238 * as the socket is connected,
239 * we don't need to specify the destination
241 state->io.in.dest_address = NULL;
242 state->io.in.dest_port = 0;
243 state->io.in.realm = NULL;
244 state->io.in.host = computer_name;
245 state->io.in.user = user_name;
246 state->io.in.domain_guid = NULL;
247 state->io.in.domain_sid = domain_sid;
248 state->io.in.acct_control = acct_control;
249 state->io.in.version = nt_version;
250 state->io.in.map_response = false;
252 subreq = cldap_netlogon_send(state,
256 DEBUG(0,("failed to send cldap netlogon call\n"));
260 tevent_req_set_callback(subreq, nmbd_proxy_logon_done, state);
263 state->p->locked = true;
264 talloc_set_destructor(state, nmbd_proxy_logon_state_destructor);
267 static void nmbd_proxy_logon_done(struct tevent_req *subreq)
269 struct nmbd_proxy_logon_state *state =
270 tevent_req_callback_data(subreq,
271 struct nmbd_proxy_logon_state);
273 DATA_BLOB response = data_blob_null;
275 status = cldap_netlogon_recv(subreq, state, &state->io);
276 if (!NT_STATUS_IS_OK(status)) {
277 DEBUG(0,("failed to recv cldap netlogon call: %s\n",
283 status = push_netlogon_samlogon_response(&response, state,
284 &state->io.out.netlogon);
285 if (!NT_STATUS_IS_OK(status)) {
286 DEBUG(0,("failed to push netlogon_samlogon_response: %s\n",
292 send_mailslot(true, state->remote_mailslot,
293 (char *)response.data, response.length,
294 global_myname(), 0x0,
296 state->remote_name_type,
303 /****************************************************************************
304 Process a domain logon packet
305 **************************************************************************/
307 void process_logon_packet(struct packet_struct *p, char *buf,int len,
308 const char *mailslot)
310 struct dgram_packet *dgram = &p->packet.dgram;
316 uint32 ntversion = 0;
317 uint16 lmnttoken = 0;
318 uint16 lm20token = 0;
319 uint32 domainsidsize;
320 bool short_request = False;
322 char *uniuser; /* Unicode user name. */
324 char *unicomp; /* Unicode computer name. */
326 struct sockaddr_storage ss;
327 const struct sockaddr_storage *pss;
330 in_addr_to_sockaddr_storage(&ss, p->ip);
331 pss = iface_ip((struct sockaddr *)&ss);
333 DEBUG(5,("process_logon_packet:can't find outgoing interface "
334 "for packet from IP %s\n",
338 ip = ((struct sockaddr_in *)pss)->sin_addr;
340 memset(outbuf, 0, sizeof(outbuf));
342 if (!lp_domain_logons()) {
343 DEBUG(5,("process_logon_packet: Logon packet received from IP %s and domain \
344 logons are not enabled.\n", inet_ntoa(p->ip) ));
348 fstrcpy(my_name, global_myname());
350 code = get_safe_SVAL(buf,len,buf,0,-1);
351 DEBUG(4,("process_logon_packet: Logon from %s: code = 0x%x\n", inet_ntoa(p->ip), code));
356 fstring mach_str, user_str, getdc_str;
359 char *user = skip_string(buf,len,machine);
361 if (!user || PTR_DIFF(user, buf) >= len) {
362 DEBUG(0,("process_logon_packet: bad packet\n"));
365 getdc = skip_string(buf,len,user);
367 if (!getdc || PTR_DIFF(getdc, buf) >= len) {
368 DEBUG(0,("process_logon_packet: bad packet\n"));
371 q = skip_string(buf,len,getdc);
373 if (!q || PTR_DIFF(q + 5, buf) > len) {
374 DEBUG(0,("process_logon_packet: bad packet\n"));
379 fstrcpy(reply_name,my_name);
381 pull_ascii_fstring(mach_str, machine);
382 pull_ascii_fstring(user_str, user);
383 pull_ascii_fstring(getdc_str, getdc);
385 DEBUG(5,("process_logon_packet: Domain login request from %s at IP %s user=%s token=%x\n",
386 mach_str,inet_ntoa(p->ip),user_str,token));
392 fstrcpy(reply_name, "\\\\");
393 fstrcat(reply_name, my_name);
394 size = push_ascii(q,reply_name,
395 sizeof(outbuf)-PTR_DIFF(q, outbuf),
397 if (size == (size_t)-1) {
400 q = skip_string(outbuf,sizeof(outbuf),q); /* PDC name */
405 dump_data(4, (uint8 *)outbuf, PTR_DIFF(q, outbuf));
407 send_mailslot(True, getdc_str,
408 outbuf,PTR_DIFF(q,outbuf),
409 global_myname(), 0x0,
411 dgram->source_name.name_type,
416 case LOGON_PRIMARY_QUERY:
418 fstring mach_str, getdc_str;
423 if (!lp_domain_master()) {
424 /* We're not Primary Domain Controller -- ignore this */
428 getdc = skip_string(buf,len,machine);
430 if (!getdc || PTR_DIFF(getdc, buf) >= len) {
431 DEBUG(0,("process_logon_packet: bad packet\n"));
434 q = skip_string(buf,len,getdc);
436 if (!q || PTR_DIFF(q, buf) >= len) {
437 DEBUG(0,("process_logon_packet: bad packet\n"));
442 /* At this point we can work out if this is a W9X or NT style
443 request. Experiments show that the difference is wether the
444 packet ends here. For a W9X request we now end with a pair of
445 bytes (usually 0xFE 0xFF) whereas with NT we have two further
446 strings - the following is a simple way of detecting this */
448 if (len - PTR_DIFF(q, buf) <= 3) {
449 short_request = True;
453 if (PTR_DIFF(q, buf) >= len) {
454 DEBUG(0,("process_logon_packet: bad packet\n"));
458 /* A full length (NT style) request */
459 q = skip_unibuf(unicomp, PTR_DIFF(buf + len, unicomp));
461 if (PTR_DIFF(q, buf) >= len) {
462 DEBUG(0,("process_logon_packet: bad packet\n"));
466 if (len - PTR_DIFF(q, buf) > 8) {
467 /* with NT5 clients we can sometimes
468 get additional data - a length specificed string
469 containing the domain name, then 16 bytes of
470 data (no idea what it is) */
471 int dom_len = CVAL(q, 0);
479 if (PTR_DIFF(q + 8, buf) > len) {
480 DEBUG(0,("process_logon_packet: bad packet\n"));
484 ntversion = IVAL(q, 0);
485 lmnttoken = SVAL(q, 4);
486 lm20token = SVAL(q, 6);
489 /* Construct reply. */
491 SSVAL(q, 0, NETLOGON_RESPONSE_FROM_PDC);
494 fstrcpy(reply_name,my_name);
495 size = push_ascii(q, reply_name,
496 sizeof(outbuf)-PTR_DIFF(q, outbuf),
498 if (size == (size_t)-1) {
501 q = skip_string(outbuf,sizeof(outbuf),q); /* PDC name */
503 /* PDC and domain name */
504 if (!short_request) {
505 /* Make a full reply */
506 q = ALIGN2(q, outbuf);
508 q += dos_PutUniCode(q, my_name,
509 sizeof(outbuf) - PTR_DIFF(q, outbuf),
510 True); /* PDC name */
511 q += dos_PutUniCode(q, lp_workgroup(),
512 sizeof(outbuf) - PTR_DIFF(q, outbuf),
513 True); /* Domain name*/
514 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 8) {
517 SIVAL(q, 0, 1); /* our nt version */
518 SSVAL(q, 4, 0xffff); /* our lmnttoken */
519 SSVAL(q, 6, 0xffff); /* our lm20token */
523 /* RJS, 21-Feb-2000, we send a short reply if the request was short */
525 pull_ascii_fstring(mach_str, machine);
527 DEBUG(5,("process_logon_packet: GETDC request from %s at IP %s, \
528 reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
529 mach_str,inet_ntoa(p->ip), reply_name, lp_workgroup(),
530 NETLOGON_RESPONSE_FROM_PDC, (uint32)ntversion, (uint32)lmnttoken,
531 (uint32)lm20token ));
533 dump_data(4, (uint8 *)outbuf, PTR_DIFF(q, outbuf));
535 pull_ascii_fstring(getdc_str, getdc);
536 pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name);
538 send_mailslot(True, getdc_str,
539 outbuf,PTR_DIFF(q,outbuf),
540 global_myname(), 0x0,
542 dgram->source_name.name_type,
547 case LOGON_SAM_LOGON_REQUEST:
556 if (global_nmbd_proxy_logon) {
557 nmbd_proxy_logon(global_nmbd_proxy_logon,
558 ip, p, (uint8_t *)buf, len);
564 if (PTR_DIFF(q, buf) >= len) {
565 DEBUG(0,("process_logon_packet: bad packet\n"));
570 uniuser = skip_unibuf(unicomp, PTR_DIFF(buf+len, unicomp));
572 if (PTR_DIFF(uniuser, buf) >= len) {
573 DEBUG(0,("process_logon_packet: bad packet\n"));
577 getdc = skip_unibuf(uniuser,PTR_DIFF(buf+len, uniuser));
579 if (PTR_DIFF(getdc, buf) >= len) {
580 DEBUG(0,("process_logon_packet: bad packet\n"));
584 q = skip_string(buf,len,getdc);
586 if (!q || PTR_DIFF(q + 8, buf) >= len) {
587 DEBUG(0,("process_logon_packet: bad packet\n"));
591 q += 4; /* Account Control Bits - indicating username type */
592 domainsidsize = IVAL(q, 0);
595 DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST sidsize %d, len = %d\n", domainsidsize, len));
597 if (domainsidsize < (len - PTR_DIFF(q, buf)) && (domainsidsize != 0)) {
602 DEBUG(5,("process_logon_packet: len = %d PTR_DIFF(q, buf) = %ld\n", len, (unsigned long)PTR_DIFF(q, buf) ));
604 if (len - PTR_DIFF(q, buf) > 8) {
605 /* with NT5 clients we can sometimes
606 get additional data - a length specificed string
607 containing the domain name, then 16 bytes of
608 data (no idea what it is) */
609 int dom_len = CVAL(q, 0);
611 if (dom_len < (len - PTR_DIFF(q, buf)) && (dom_len != 0)) {
617 if (PTR_DIFF(q + 8, buf) > len) {
618 DEBUG(0,("process_logon_packet: bad packet\n"));
622 ntversion = IVAL(q, 0);
623 lmnttoken = SVAL(q, 4);
624 lm20token = SVAL(q, 6);
627 DEBUG(3,("process_logon_packet: LOGON_SAM_LOGON_REQUEST sidsize %d ntv %d\n", domainsidsize, ntversion));
630 * we respond regadless of whether the machine is in our password
631 * database. If it isn't then we let smbd send an appropriate error.
632 * Let's ignore the SID.
634 pull_ucs2_fstring(ascuser, uniuser);
635 pull_ucs2_fstring(asccomp, unicomp);
636 DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST user %s\n", ascuser));
638 fstrcpy(reply_name, "\\\\"); /* Here it wants \\LOGONSERVER. */
639 fstrcat(reply_name, my_name);
641 DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST request from %s(%s) for %s, returning logon svr %s domain %s code %x token=%x\n",
642 asccomp,inet_ntoa(p->ip), ascuser, reply_name, lp_workgroup(),
643 LOGON_SAM_LOGON_RESPONSE ,lmnttoken));
645 /* Construct reply. */
648 /* we want the simple version unless we are an ADS PDC..which means */
649 /* never, at least for now */
650 if ((ntversion < 11) || (SEC_ADS != lp_security()) || (ROLE_DOMAIN_PDC != lp_server_role())) {
651 if (SVAL(uniuser, 0) == 0) {
652 SSVAL(q, 0, LOGON_SAM_LOGON_USER_UNKNOWN); /* user unknown */
654 SSVAL(q, 0, LOGON_SAM_LOGON_RESPONSE);
659 q += dos_PutUniCode(q, reply_name,
660 sizeof(outbuf) - PTR_DIFF(q, outbuf),
662 q += dos_PutUniCode(q, ascuser,
663 sizeof(outbuf) - PTR_DIFF(q, outbuf),
665 q += dos_PutUniCode(q, lp_workgroup(),
666 sizeof(outbuf) - PTR_DIFF(q, outbuf),
671 struct GUID domain_guid;
675 char *component, *dc, *q1;
678 char *saveptr = NULL;
680 domain = get_mydnsdomname(talloc_tos());
683 ("get_mydnsdomname failed.\n"));
686 hostname = get_myname(talloc_tos());
689 ("get_myname failed.\n"));
693 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 8) {
696 if (SVAL(uniuser, 0) == 0) {
697 SIVAL(q, 0, LOGON_SAM_LOGON_USER_UNKNOWN_EX); /* user unknown */
699 SIVAL(q, 0, LOGON_SAM_LOGON_RESPONSE_EX);
703 SIVAL(q, 0, NBT_SERVER_PDC|NBT_SERVER_GC|NBT_SERVER_LDAP|NBT_SERVER_DS|
704 NBT_SERVER_KDC|NBT_SERVER_TIMESERV|NBT_SERVER_CLOSEST|NBT_SERVER_WRITABLE);
707 /* Push Domain GUID */
708 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < UUID_FLAT_SIZE) {
711 if (False == secrets_fetch_domain_guid(domain, &domain_guid)) {
712 DEBUG(2, ("Could not fetch DomainGUID for %s\n", domain));
716 smb_uuid_pack(domain_guid, &flat_guid);
717 memcpy(q, &flat_guid.info, UUID_FLAT_SIZE);
721 str_offset = q - q_orig;
724 while ((component = strtok_r(dc, ".", &saveptr)) != NULL) {
726 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 1) {
729 size = push_ascii(&q[1], component,
730 sizeof(outbuf) - PTR_DIFF(q+1, outbuf),
732 if (size == (size_t)-1 || size > 0xff) {
740 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 4) {
747 SCVAL(q, 0, 0xc0 | ((str_offset >> 8) & 0x3F));
748 SCVAL(q, 1, str_offset & 0xFF);
752 size = push_ascii(&q[1], hostname,
753 sizeof(outbuf) - PTR_DIFF(q+1, outbuf),
755 if (size == (size_t)-1 || size > 0xff) {
761 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 3) {
765 SCVAL(q, 0, 0xc0 | ((str_offset >> 8) & 0x3F));
766 SCVAL(q, 1, str_offset & 0xFF);
769 /* NETBIOS of domain */
770 size = push_ascii(&q[1], lp_workgroup(),
771 sizeof(outbuf) - PTR_DIFF(q+1, outbuf),
773 if (size == (size_t)-1 || size > 0xff) {
780 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 2) {
787 /* NETBIOS of hostname */
788 size = push_ascii(&q[1], my_name,
789 sizeof(outbuf) - PTR_DIFF(q+1, outbuf),
791 if (size == (size_t)-1 || size > 0xff) {
798 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 4) {
806 if (SVAL(uniuser, 0) != 0) {
807 size = push_ascii(&q[1], ascuser,
808 sizeof(outbuf) - PTR_DIFF(q+1, outbuf),
810 if (size == (size_t)-1 || size > 0xff) {
819 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 1) {
822 size = push_ascii(&q[1], "Default-First-Site-Name",
823 sizeof(outbuf) - PTR_DIFF(q+1, outbuf),
825 if (size == (size_t)-1 || size > 0xff) {
831 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 18) {
836 str_offset = q - q_orig;
837 SCVAL(q, 0, 0xc0 | ((str_offset >> 8) & 0x3F));
838 SCVAL(q, 1, str_offset & 0xFF);
841 SCVAL(q, 0, PTR_DIFF(q,q1));
842 SCVAL(q, 1, 0x10); /* unknown */
844 SIVAL(q, 0, 0x00000002);
845 q += 4; /* unknown */
846 SIVAL(q, 0, ntohl(ip.s_addr));
848 SIVAL(q, 0, 0x00000000);
849 q += 4; /* unknown */
850 SIVAL(q, 0, 0x00000000);
851 q += 4; /* unknown */
855 if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 8) {
859 /* tell the client what version we are */
860 SIVAL(q, 0, ((ntversion < 11) || (SEC_ADS != lp_security())) ? 1 : 13);
862 SSVAL(q, 4, 0xffff); /* our lmnttoken */
863 SSVAL(q, 6, 0xffff); /* our lm20token */
866 dump_data(4, (uint8 *)outbuf, PTR_DIFF(q, outbuf));
868 pull_ascii_fstring(getdc_str, getdc);
869 pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name);
870 source_addr = SMB_STRDUP(inet_ntoa(dgram->header.source_ip));
871 if (source_addr == NULL) {
872 DEBUG(3, ("out of memory copying client"
873 " address string\n"));
879 * packets requeued after delay are marked as
882 if ((p->locked == False) &&
883 (strlen(ascuser) == 0) &&
884 delay_logon(source_name, source_addr))
888 DEBUG(3, ("process_logon_packet: "
889 "delaying initial logon "
890 "reply for client %s(%s) for "
892 source_name, source_addr,
893 lp_init_logon_delay()));
895 when = timeval_current_ofs(0,
896 lp_init_logon_delay() * 1000);
898 event_add_timed(nmbd_event_context(),
901 delayed_init_logon_handler,
904 DEBUG(3, ("process_logon_packet: "
905 "processing delayed initial "
906 "logon reply for client "
908 source_name, source_addr));
911 send_mailslot(true, getdc,
912 outbuf,PTR_DIFF(q,outbuf),
913 global_myname(), 0x0,
915 dgram->source_name.name_type,
919 SAFE_FREE(source_addr);
924 /* Announce change to UAS or SAM. Send by the domain controller when a
925 replication event is required. */
927 case NETLOGON_ANNOUNCE_UAS:
928 DEBUG(5, ("Got NETLOGON_ANNOUNCE_UAS\n"));
932 DEBUG(3,("process_logon_packet: Unknown domain request %d\n",code));