2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Andrew Tridgell 1992-1997,
5 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
6 * Copyright (C) Paul Ashton 1997.
7 * Copyright (C) Jeremy Allison 1998-2001.
8 * Copyright (C) Andrew Bartlett 2001.
9 * Copyright (C) Guenther Deschner 2008-2009.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 /* This is the implementation of the netlogon pipe. */
28 #include "../libcli/auth/schannel.h"
29 #include "../librpc/gen_ndr/srv_netlogon.h"
30 #include "librpc/gen_ndr/messaging.h"
31 #include "../lib/crypto/md4.h"
33 extern userdom_struct current_user_info;
36 #define DBGC_CLASS DBGC_RPC_SRV
38 struct netlogon_server_pipe_state {
39 struct netr_Credential client_challenge;
40 struct netr_Credential server_challenge;
43 /*************************************************************************
45 *************************************************************************/
47 WERROR _netr_LogonControl(pipes_struct *p,
48 struct netr_LogonControl *r)
50 struct netr_LogonControl2Ex l;
52 switch (r->in.level) {
56 return WERR_NOT_SUPPORTED;
58 return WERR_UNKNOWN_LEVEL;
61 l.in.logon_server = r->in.logon_server;
62 l.in.function_code = r->in.function_code;
63 l.in.level = r->in.level;
65 l.out.query = r->out.query;
67 return _netr_LogonControl2Ex(p, &l);
70 /****************************************************************************
71 Send a message to smbd to do a sam synchronisation
72 **************************************************************************/
74 static void send_sync_message(void)
76 DEBUG(3, ("sending sam synchronisation message\n"));
77 message_send_all(smbd_messaging_context(), MSG_SMB_SAM_SYNC, NULL, 0,
81 /*************************************************************************
83 *************************************************************************/
85 WERROR _netr_LogonControl2(pipes_struct *p,
86 struct netr_LogonControl2 *r)
88 struct netr_LogonControl2Ex l;
90 l.in.logon_server = r->in.logon_server;
91 l.in.function_code = r->in.function_code;
92 l.in.level = r->in.level;
93 l.in.data = r->in.data;
94 l.out.query = r->out.query;
96 return _netr_LogonControl2Ex(p, &l);
99 /*************************************************************************
100 *************************************************************************/
102 static bool wb_change_trust_creds(const char *domain, WERROR *tc_status)
105 struct wbcAuthErrorInfo *error = NULL;
107 result = wbcChangeTrustCredentials(domain, &error);
109 case WBC_ERR_WINBIND_NOT_AVAILABLE:
111 case WBC_ERR_DOMAIN_NOT_FOUND:
112 *tc_status = WERR_NO_SUCH_DOMAIN;
114 case WBC_ERR_SUCCESS:
115 *tc_status = WERR_OK;
121 if (error && error->nt_status != 0) {
122 *tc_status = ntstatus_to_werror(NT_STATUS(error->nt_status));
124 *tc_status = WERR_TRUST_FAILURE;
126 wbcFreeMemory(error);
130 /*************************************************************************
131 *************************************************************************/
133 static bool wb_check_trust_creds(const char *domain, WERROR *tc_status)
136 struct wbcAuthErrorInfo *error = NULL;
138 result = wbcCheckTrustCredentials(domain, &error);
140 case WBC_ERR_WINBIND_NOT_AVAILABLE:
142 case WBC_ERR_DOMAIN_NOT_FOUND:
143 *tc_status = WERR_NO_SUCH_DOMAIN;
145 case WBC_ERR_SUCCESS:
146 *tc_status = WERR_OK;
152 if (error && error->nt_status != 0) {
153 *tc_status = ntstatus_to_werror(NT_STATUS(error->nt_status));
155 *tc_status = WERR_TRUST_FAILURE;
157 wbcFreeMemory(error);
161 /****************************************************************
162 _netr_LogonControl2Ex
163 ****************************************************************/
165 WERROR _netr_LogonControl2Ex(pipes_struct *p,
166 struct netr_LogonControl2Ex *r)
168 uint32_t flags = 0x0;
169 WERROR pdc_connection_status = WERR_OK;
170 uint32_t logon_attempts = 0x0;
173 const char *dc_name = NULL;
174 struct sockaddr_storage dc_ss;
175 const char *domain = NULL;
176 struct netr_NETLOGON_INFO_1 *info1;
177 struct netr_NETLOGON_INFO_2 *info2;
178 struct netr_NETLOGON_INFO_3 *info3;
179 struct netr_NETLOGON_INFO_4 *info4;
183 switch (p->hdr_req.opnum) {
184 case NDR_NETR_LOGONCONTROL:
185 fn = "_netr_LogonControl";
187 case NDR_NETR_LOGONCONTROL2:
188 fn = "_netr_LogonControl2";
190 case NDR_NETR_LOGONCONTROL2EX:
191 fn = "_netr_LogonControl2Ex";
194 return WERR_INVALID_PARAM;
197 acct_ctrl = p->server_info->info3->base.acct_flags;
199 switch (r->in.function_code) {
200 case NETLOGON_CONTROL_TC_VERIFY:
201 case NETLOGON_CONTROL_CHANGE_PASSWORD:
202 case NETLOGON_CONTROL_REDISCOVER:
203 if ((geteuid() != sec_initial_uid()) &&
204 !nt_token_check_domain_rid(p->server_info->ptok, DOMAIN_RID_ADMINS) &&
205 !nt_token_check_sid(&global_sid_Builtin_Administrators, p->server_info->ptok) &&
206 !(acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST))) {
207 return WERR_ACCESS_DENIED;
214 tc_status = WERR_NO_SUCH_DOMAIN;
216 switch (r->in.function_code) {
217 case NETLOGON_CONTROL_QUERY:
220 case NETLOGON_CONTROL_REPLICATE:
221 case NETLOGON_CONTROL_SYNCHRONIZE:
222 case NETLOGON_CONTROL_PDC_REPLICATE:
223 case NETLOGON_CONTROL_BACKUP_CHANGE_LOG:
224 case NETLOGON_CONTROL_BREAKPOINT:
225 if (acct_ctrl & ACB_NORMAL) {
226 return WERR_NOT_SUPPORTED;
227 } else if (acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST)) {
228 return WERR_ACCESS_DENIED;
230 return WERR_ACCESS_DENIED;
232 case NETLOGON_CONTROL_TRUNCATE_LOG:
233 if (acct_ctrl & ACB_NORMAL) {
235 } else if (acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST)) {
236 return WERR_ACCESS_DENIED;
238 return WERR_ACCESS_DENIED;
241 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
242 case NETLOGON_CONTROL_FORCE_DNS_REG:
243 case NETLOGON_CONTROL_QUERY_DNS_REG:
244 return WERR_NOT_SUPPORTED;
245 case NETLOGON_CONTROL_FIND_USER:
246 if (!r->in.data || !r->in.data->user) {
247 return WERR_NOT_SUPPORTED;
250 case NETLOGON_CONTROL_SET_DBFLAG:
252 return WERR_NOT_SUPPORTED;
255 case NETLOGON_CONTROL_TC_VERIFY:
256 if (!r->in.data || !r->in.data->domain) {
257 return WERR_NOT_SUPPORTED;
260 if (!wb_check_trust_creds(r->in.data->domain, &tc_status)) {
261 return WERR_NOT_SUPPORTED;
264 case NETLOGON_CONTROL_TC_QUERY:
265 if (!r->in.data || !r->in.data->domain) {
266 return WERR_NOT_SUPPORTED;
269 domain = r->in.data->domain;
271 if (!is_trusted_domain(domain)) {
275 if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
276 tc_status = WERR_NO_LOGON_SERVERS;
280 dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
289 case NETLOGON_CONTROL_REDISCOVER:
290 if (!r->in.data || !r->in.data->domain) {
291 return WERR_NOT_SUPPORTED;
294 domain = r->in.data->domain;
296 if (!is_trusted_domain(domain)) {
300 if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
301 tc_status = WERR_NO_LOGON_SERVERS;
305 dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
314 case NETLOGON_CONTROL_CHANGE_PASSWORD:
315 if (!r->in.data || !r->in.data->domain) {
316 return WERR_NOT_SUPPORTED;
319 if (!wb_change_trust_creds(r->in.data->domain, &tc_status)) {
320 return WERR_NOT_SUPPORTED;
325 /* no idea what this should be */
326 DEBUG(0,("%s: unimplemented function level [%d]\n",
327 fn, r->in.function_code));
328 return WERR_UNKNOWN_LEVEL;
331 /* prepare the response */
333 switch (r->in.level) {
335 info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1);
336 W_ERROR_HAVE_NO_MEMORY(info1);
338 info1->flags = flags;
339 info1->pdc_connection_status = pdc_connection_status;
341 r->out.query->info1 = info1;
344 info2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_2);
345 W_ERROR_HAVE_NO_MEMORY(info2);
347 info2->flags = flags;
348 info2->pdc_connection_status = pdc_connection_status;
349 info2->trusted_dc_name = dc_name;
350 info2->tc_connection_status = tc_status;
352 r->out.query->info2 = info2;
355 info3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_3);
356 W_ERROR_HAVE_NO_MEMORY(info3);
358 info3->flags = flags;
359 info3->logon_attempts = logon_attempts;
361 r->out.query->info3 = info3;
364 info4 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_4);
365 W_ERROR_HAVE_NO_MEMORY(info4);
367 info4->trusted_dc_name = dc_name;
368 info4->trusted_domain_name = r->in.data->domain;
370 r->out.query->info4 = info4;
373 return WERR_UNKNOWN_LEVEL;
376 if (lp_server_role() == ROLE_DOMAIN_BDC) {
383 /*************************************************************************
384 _netr_NetrEnumerateTrustedDomains
385 *************************************************************************/
387 WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
388 struct netr_NetrEnumerateTrustedDomains *r)
392 struct trustdom_info **domains;
393 uint32_t num_domains;
394 const char **trusted_domains;
397 DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
399 /* set up the Trusted Domain List response */
402 status = pdb_enum_trusteddoms(p->mem_ctx, &num_domains, &domains);
405 if (!NT_STATUS_IS_OK(status)) {
406 return ntstatus_to_werror(status);
409 trusted_domains = talloc_zero_array(p->mem_ctx, const char *, num_domains + 1);
410 if (!trusted_domains) {
414 for (i = 0; i < num_domains; i++) {
415 trusted_domains[i] = talloc_strdup(trusted_domains, domains[i]->name);
416 if (!trusted_domains[i]) {
417 TALLOC_FREE(trusted_domains);
422 if (!push_reg_multi_sz(trusted_domains, &blob, trusted_domains)) {
423 TALLOC_FREE(trusted_domains);
427 r->out.trusted_domains_blob->data = blob.data;
428 r->out.trusted_domains_blob->length = blob.length;
430 DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
435 /******************************************************************
436 gets a machine password entry. checks access rights of the host.
437 ******************************************************************/
439 static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
440 enum netr_SchannelType sec_chan_type, struct dom_sid *sid)
442 struct samu *sampass = NULL;
448 char addr[INET6_ADDRSTRLEN];
451 * Currently this code is redundent as we already have a filter
452 * by hostname list. What this code really needs to do is to
453 * get a hosts allowed/hosts denied list from the SAM database
454 * on a per user basis, and make the access decision there.
455 * I will leave this code here for now as a reminder to implement
456 * this at a later date. JRA.
459 if (!allow_access(lp_domain_hostsdeny(), lp_domain_hostsallow(),
460 client_name(get_client_fd()),
461 client_addr(get_client_fd(),addr,sizeof(addr)))) {
462 DEBUG(0,("get_md4pw: Workstation %s denied access to domain\n", mach_acct));
467 if ( !(sampass = samu_new( NULL )) ) {
468 return NT_STATUS_NO_MEMORY;
471 /* JRA. This is ok as it is only used for generating the challenge. */
473 ret = pdb_getsampwnam(sampass, mach_acct);
477 DEBUG(0,("get_md4pw: Workstation %s: no account in domain\n", mach_acct));
478 TALLOC_FREE(sampass);
479 return NT_STATUS_ACCESS_DENIED;
482 acct_ctrl = pdb_get_acct_ctrl(sampass);
483 if (acct_ctrl & ACB_DISABLED) {
484 DEBUG(0,("get_md4pw: Workstation %s: account is disabled\n", mach_acct));
485 TALLOC_FREE(sampass);
486 return NT_STATUS_ACCOUNT_DISABLED;
489 if (!(acct_ctrl & ACB_SVRTRUST) &&
490 !(acct_ctrl & ACB_WSTRUST) &&
491 !(acct_ctrl & ACB_DOMTRUST))
493 DEBUG(0,("get_md4pw: Workstation %s: account is not a trust account\n", mach_acct));
494 TALLOC_FREE(sampass);
495 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
498 switch (sec_chan_type) {
500 if (!(acct_ctrl & ACB_SVRTRUST)) {
501 DEBUG(0,("get_md4pw: Workstation %s: BDC secure channel requested "
502 "but not a server trust account\n", mach_acct));
503 TALLOC_FREE(sampass);
504 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
508 if (!(acct_ctrl & ACB_WSTRUST)) {
509 DEBUG(0,("get_md4pw: Workstation %s: WORKSTATION secure channel requested "
510 "but not a workstation trust account\n", mach_acct));
511 TALLOC_FREE(sampass);
512 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
515 case SEC_CHAN_DOMAIN:
516 if (!(acct_ctrl & ACB_DOMTRUST)) {
517 DEBUG(0,("get_md4pw: Workstation %s: DOMAIN secure channel requested "
518 "but not a interdomain trust account\n", mach_acct));
519 TALLOC_FREE(sampass);
520 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
527 if ((pass = pdb_get_nt_passwd(sampass)) == NULL) {
528 DEBUG(0,("get_md4pw: Workstation %s: account does not have a password\n", mach_acct));
529 TALLOC_FREE(sampass);
530 return NT_STATUS_LOGON_FAILURE;
533 memcpy(md4pw->hash, pass, 16);
534 dump_data(5, md4pw->hash, 16);
536 sid_copy(sid, pdb_get_user_sid(sampass));
538 TALLOC_FREE(sampass);
545 /*************************************************************************
546 _netr_ServerReqChallenge
547 *************************************************************************/
549 NTSTATUS _netr_ServerReqChallenge(pipes_struct *p,
550 struct netr_ServerReqChallenge *r)
552 struct netlogon_server_pipe_state *pipe_state =
553 talloc_get_type(p->private_data, struct netlogon_server_pipe_state);
556 DEBUG(10,("_netr_ServerReqChallenge: new challenge requested. Clearing old state.\n"));
557 talloc_free(pipe_state);
558 p->private_data = NULL;
561 pipe_state = talloc(p, struct netlogon_server_pipe_state);
562 NT_STATUS_HAVE_NO_MEMORY(pipe_state);
564 pipe_state->client_challenge = *r->in.credentials;
566 generate_random_buffer(pipe_state->server_challenge.data,
567 sizeof(pipe_state->server_challenge.data));
569 *r->out.return_credentials = pipe_state->server_challenge;
571 p->private_data = pipe_state;
576 /*************************************************************************
577 _netr_ServerAuthenticate
578 Create the initial credentials.
579 *************************************************************************/
581 NTSTATUS _netr_ServerAuthenticate(pipes_struct *p,
582 struct netr_ServerAuthenticate *r)
584 struct netr_ServerAuthenticate3 a;
585 uint32_t negotiate_flags = 0;
588 a.in.server_name = r->in.server_name;
589 a.in.account_name = r->in.account_name;
590 a.in.secure_channel_type = r->in.secure_channel_type;
591 a.in.computer_name = r->in.computer_name;
592 a.in.credentials = r->in.credentials;
593 a.in.negotiate_flags = &negotiate_flags;
595 a.out.return_credentials = r->out.return_credentials;
597 a.out.negotiate_flags = &negotiate_flags;
599 return _netr_ServerAuthenticate3(p, &a);
603 /*************************************************************************
604 _netr_ServerAuthenticate3
605 *************************************************************************/
607 NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
608 struct netr_ServerAuthenticate3 *r)
612 /* r->in.negotiate_flags is an aliased pointer to r->out.negotiate_flags,
613 * so use a copy to avoid destroying the client values. */
614 uint32_t in_neg_flags = *r->in.negotiate_flags;
617 struct samr_Password mach_pwd;
618 struct netlogon_creds_CredentialState *creds;
619 struct netlogon_server_pipe_state *pipe_state =
620 talloc_get_type(p->private_data, struct netlogon_server_pipe_state);
622 /* According to Microsoft (see bugid #6099)
623 * Windows 7 looks at the negotiate_flags
624 * returned in this structure *even if the
625 * call fails with access denied* ! So in order
626 * to allow Win7 to connect to a Samba NT style
627 * PDC we set the flags before we know if it's
632 srv_flgs = NETLOGON_NEG_ACCOUNT_LOCKOUT |
633 NETLOGON_NEG_PERSISTENT_SAMREPL |
634 NETLOGON_NEG_ARCFOUR |
635 NETLOGON_NEG_PROMOTION_COUNT |
636 NETLOGON_NEG_CHANGELOG_BDC |
637 NETLOGON_NEG_FULL_SYNC_REPL |
638 NETLOGON_NEG_MULTIPLE_SIDS |
640 NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL |
641 NETLOGON_NEG_PASSWORD_SET2;
643 /* Ensure we support strong (128-bit) keys. */
644 if (in_neg_flags & NETLOGON_NEG_STRONG_KEYS) {
645 srv_flgs |= NETLOGON_NEG_STRONG_KEYS;
648 if (lp_server_schannel() != false) {
649 srv_flgs |= NETLOGON_NEG_SCHANNEL;
652 switch (p->hdr_req.opnum) {
653 case NDR_NETR_SERVERAUTHENTICATE:
654 fn = "_netr_ServerAuthenticate";
656 case NDR_NETR_SERVERAUTHENTICATE2:
657 fn = "_netr_ServerAuthenticate2";
659 case NDR_NETR_SERVERAUTHENTICATE3:
660 fn = "_netr_ServerAuthenticate3";
663 return NT_STATUS_INTERNAL_ERROR;
666 /* We use this as the key to store the creds: */
667 /* r->in.computer_name */
670 DEBUG(0,("%s: no challenge sent to client %s\n", fn,
671 r->in.computer_name));
672 status = NT_STATUS_ACCESS_DENIED;
676 if ( (lp_server_schannel() == true) &&
677 ((in_neg_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
679 /* schannel must be used, but client did not offer it. */
680 DEBUG(0,("%s: schannel required but client failed "
681 "to offer it. Client was %s\n",
682 fn, r->in.account_name));
683 status = NT_STATUS_ACCESS_DENIED;
687 status = get_md4pw(&mach_pwd,
689 r->in.secure_channel_type,
691 if (!NT_STATUS_IS_OK(status)) {
692 DEBUG(0,("%s: failed to get machine password for "
694 fn, r->in.account_name, nt_errstr(status) ));
695 /* always return NT_STATUS_ACCESS_DENIED */
696 status = NT_STATUS_ACCESS_DENIED;
700 /* From the client / server challenges and md4 password, generate sess key */
701 /* Check client credentials are valid. */
702 creds = netlogon_creds_server_init(p->mem_ctx,
705 r->in.secure_channel_type,
706 &pipe_state->client_challenge,
707 &pipe_state->server_challenge,
710 r->out.return_credentials,
711 *r->in.negotiate_flags);
713 DEBUG(0,("%s: netlogon_creds_server_check failed. Rejecting auth "
714 "request from client %s machine account %s\n",
715 fn, r->in.computer_name,
716 r->in.account_name));
717 status = NT_STATUS_ACCESS_DENIED;
721 creds->sid = sid_dup_talloc(creds, &sid);
723 status = NT_STATUS_NO_MEMORY;
727 /* Store off the state so we can continue after client disconnect. */
729 status = schannel_save_creds_state(p->mem_ctx, lp_private_dir(), creds);
732 if (!NT_STATUS_IS_OK(status)) {
736 sid_peek_rid(&sid, r->out.rid);
738 status = NT_STATUS_OK;
742 *r->out.negotiate_flags = srv_flgs;
746 /*************************************************************************
747 _netr_ServerAuthenticate2
748 *************************************************************************/
750 NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p,
751 struct netr_ServerAuthenticate2 *r)
753 struct netr_ServerAuthenticate3 a;
756 a.in.server_name = r->in.server_name;
757 a.in.account_name = r->in.account_name;
758 a.in.secure_channel_type = r->in.secure_channel_type;
759 a.in.computer_name = r->in.computer_name;
760 a.in.credentials = r->in.credentials;
761 a.in.negotiate_flags = r->in.negotiate_flags;
763 a.out.return_credentials = r->out.return_credentials;
765 a.out.negotiate_flags = r->out.negotiate_flags;
767 return _netr_ServerAuthenticate3(p, &a);
770 /*************************************************************************
771 * If schannel is required for this call test that it actually is available.
772 *************************************************************************/
773 static NTSTATUS schannel_check_required(struct pipe_auth_data *auth_info,
774 const char *computer_name,
775 bool integrity, bool privacy)
777 if (auth_info && auth_info->auth_type == PIPE_AUTH_TYPE_SCHANNEL) {
778 if (!privacy && !integrity) {
782 if ((!privacy && integrity) &&
783 auth_info->auth_level == DCERPC_AUTH_LEVEL_INTEGRITY) {
787 if ((privacy || integrity) &&
788 auth_info->auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
793 /* test didn't pass */
794 DEBUG(0, ("schannel_check_required: [%s] is not using schannel\n",
797 return NT_STATUS_ACCESS_DENIED;
800 /*************************************************************************
801 *************************************************************************/
803 static NTSTATUS netr_creds_server_step_check(pipes_struct *p,
805 const char *computer_name,
806 struct netr_Authenticator *received_authenticator,
807 struct netr_Authenticator *return_authenticator,
808 struct netlogon_creds_CredentialState **creds_out)
811 bool schannel_global_required = (lp_server_schannel() == true) ? true:false;
813 if (schannel_global_required) {
814 status = schannel_check_required(&p->auth,
817 if (!NT_STATUS_IS_OK(status)) {
822 status = schannel_check_creds_state(mem_ctx, lp_private_dir(),
823 computer_name, received_authenticator,
824 return_authenticator, creds_out);
829 /*************************************************************************
830 *************************************************************************/
832 static NTSTATUS netr_find_machine_account(TALLOC_CTX *mem_ctx,
833 const char *account_name,
834 struct samu **sampassp)
836 struct samu *sampass;
840 sampass = samu_new(mem_ctx);
842 return NT_STATUS_NO_MEMORY;
846 ret = pdb_getsampwnam(sampass, account_name);
850 TALLOC_FREE(sampass);
851 return NT_STATUS_ACCESS_DENIED;
854 /* Ensure the account exists and is a machine account. */
856 acct_ctrl = pdb_get_acct_ctrl(sampass);
858 if (!(acct_ctrl & ACB_WSTRUST ||
859 acct_ctrl & ACB_SVRTRUST ||
860 acct_ctrl & ACB_DOMTRUST)) {
861 TALLOC_FREE(sampass);
862 return NT_STATUS_NO_SUCH_USER;
865 if (acct_ctrl & ACB_DISABLED) {
866 TALLOC_FREE(sampass);
867 return NT_STATUS_ACCOUNT_DISABLED;
875 /*************************************************************************
876 *************************************************************************/
878 static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
879 struct samu *sampass,
880 DATA_BLOB *plaintext_blob,
881 struct samr_Password *nt_hash,
882 struct samr_Password *lm_hash)
886 const char *plaintext = NULL;
887 size_t plaintext_len;
888 struct samr_Password nt_hash_local;
891 return NT_STATUS_INVALID_PARAMETER;
894 if (plaintext_blob) {
895 if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
896 plaintext_blob->data, plaintext_blob->length,
897 &plaintext, &plaintext_len, false))
900 mdfour(nt_hash_local.hash, plaintext_blob->data, plaintext_blob->length);
901 nt_hash = &nt_hash_local;
906 if (!pdb_set_plaintext_passwd(sampass, plaintext)) {
907 return NT_STATUS_ACCESS_DENIED;
914 old_pw = pdb_get_nt_passwd(sampass);
916 if (old_pw && memcmp(nt_hash->hash, old_pw, 16) == 0) {
917 /* Avoid backend modificiations and other fun if the
918 client changed the password to the *same thing* */
920 /* LM password should be NULL for machines */
921 if (!pdb_set_lanman_passwd(sampass, NULL, PDB_CHANGED)) {
922 return NT_STATUS_NO_MEMORY;
924 if (!pdb_set_nt_passwd(sampass, nt_hash->hash, PDB_CHANGED)) {
925 return NT_STATUS_NO_MEMORY;
928 if (!pdb_set_pass_last_set_time(sampass, time(NULL), PDB_CHANGED)) {
929 /* Not quite sure what this one qualifies as, but this will do */
930 return NT_STATUS_UNSUCCESSFUL;
937 status = pdb_update_sam_account(sampass);
943 /*************************************************************************
944 _netr_ServerPasswordSet
945 *************************************************************************/
947 NTSTATUS _netr_ServerPasswordSet(pipes_struct *p,
948 struct netr_ServerPasswordSet *r)
950 NTSTATUS status = NT_STATUS_OK;
951 struct samu *sampass=NULL;
953 struct netlogon_creds_CredentialState *creds;
955 DEBUG(5,("_netr_ServerPasswordSet: %d\n", __LINE__));
958 status = netr_creds_server_step_check(p, p->mem_ctx,
961 r->out.return_authenticator,
965 if (!NT_STATUS_IS_OK(status)) {
966 DEBUG(2,("_netr_ServerPasswordSet: netlogon_creds_server_step failed. Rejecting auth "
967 "request from client %s machine account %s\n",
968 r->in.computer_name, creds->computer_name));
973 DEBUG(3,("_netr_ServerPasswordSet: Server Password Set by remote machine:[%s] on account [%s]\n",
974 r->in.computer_name, creds->computer_name));
976 netlogon_creds_des_decrypt(creds, r->in.new_password);
978 DEBUG(100,("_netr_ServerPasswordSet: new given value was :\n"));
979 for(i = 0; i < sizeof(r->in.new_password->hash); i++)
980 DEBUG(100,("%02X ", r->in.new_password->hash[i]));
983 status = netr_find_machine_account(p->mem_ctx,
986 if (!NT_STATUS_IS_OK(status)) {
990 status = netr_set_machine_account_password(sampass,
995 TALLOC_FREE(sampass);
999 /****************************************************************
1000 _netr_ServerPasswordSet2
1001 ****************************************************************/
1003 NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
1004 struct netr_ServerPasswordSet2 *r)
1007 struct netlogon_creds_CredentialState *creds;
1008 struct samu *sampass;
1009 DATA_BLOB plaintext;
1010 struct samr_CryptPassword password_buf;
1011 struct samr_Password nt_hash;
1014 status = netr_creds_server_step_check(p, p->mem_ctx,
1015 r->in.computer_name,
1017 r->out.return_authenticator,
1021 if (!NT_STATUS_IS_OK(status)) {
1022 DEBUG(2,("_netr_ServerPasswordSet2: netlogon_creds_server_step "
1023 "failed. Rejecting auth request from client %s machine account %s\n",
1024 r->in.computer_name, creds->computer_name));
1029 memcpy(password_buf.data, r->in.new_password->data, 512);
1030 SIVAL(password_buf.data, 512, r->in.new_password->length);
1031 netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
1033 if (!extract_pw_from_buffer(p->mem_ctx, password_buf.data, &plaintext)) {
1034 return NT_STATUS_WRONG_PASSWORD;
1037 mdfour(nt_hash.hash, plaintext.data, plaintext.length);
1039 status = netr_find_machine_account(p->mem_ctx,
1040 creds->account_name,
1042 if (!NT_STATUS_IS_OK(status)) {
1046 status = netr_set_machine_account_password(sampass,
1051 TALLOC_FREE(sampass);
1055 /*************************************************************************
1056 _netr_LogonSamLogoff
1057 *************************************************************************/
1059 NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
1060 struct netr_LogonSamLogoff *r)
1063 struct netlogon_creds_CredentialState *creds;
1066 status = netr_creds_server_step_check(p, p->mem_ctx,
1067 r->in.computer_name,
1069 r->out.return_authenticator,
1076 /*************************************************************************
1077 _netr_LogonSamLogon_base
1078 *************************************************************************/
1080 static NTSTATUS _netr_LogonSamLogon_base(pipes_struct *p,
1081 struct netr_LogonSamLogonEx *r,
1082 struct netlogon_creds_CredentialState *creds)
1084 NTSTATUS status = NT_STATUS_OK;
1085 union netr_LogonLevel *logon = r->in.logon;
1086 const char *nt_username, *nt_domain, *nt_workstation;
1087 struct auth_usersupplied_info *user_info = NULL;
1088 struct auth_serversupplied_info *server_info = NULL;
1089 struct auth_context *auth_context = NULL;
1090 uint8_t pipe_session_key[16];
1091 bool process_creds = true;
1094 switch (p->hdr_req.opnum) {
1095 case NDR_NETR_LOGONSAMLOGON:
1096 process_creds = true;
1097 fn = "_netr_LogonSamLogon";
1099 case NDR_NETR_LOGONSAMLOGONWITHFLAGS:
1100 process_creds = true;
1101 fn = "_netr_LogonSamLogonWithFlags";
1103 case NDR_NETR_LOGONSAMLOGONEX:
1104 process_creds = false;
1105 fn = "_netr_LogonSamLogonEx";
1108 return NT_STATUS_INTERNAL_ERROR;
1111 *r->out.authoritative = true; /* authoritative response */
1113 switch (r->in.validation_level) {
1115 r->out.validation->sam2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo2);
1116 if (!r->out.validation->sam2) {
1117 return NT_STATUS_NO_MEMORY;
1121 r->out.validation->sam3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo3);
1122 if (!r->out.validation->sam3) {
1123 return NT_STATUS_NO_MEMORY;
1127 r->out.validation->sam6 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo6);
1128 if (!r->out.validation->sam6) {
1129 return NT_STATUS_NO_MEMORY;
1133 DEBUG(0,("%s: bad validation_level value %d.\n",
1134 fn, (int)r->in.validation_level));
1135 return NT_STATUS_INVALID_INFO_CLASS;
1138 switch (r->in.logon_level) {
1139 case NetlogonInteractiveInformation:
1140 case NetlogonServiceInformation:
1141 case NetlogonInteractiveTransitiveInformation:
1142 case NetlogonServiceTransitiveInformation:
1143 nt_username = logon->password->identity_info.account_name.string ?
1144 logon->password->identity_info.account_name.string : "";
1145 nt_domain = logon->password->identity_info.domain_name.string ?
1146 logon->password->identity_info.domain_name.string : "";
1147 nt_workstation = logon->password->identity_info.workstation.string ?
1148 logon->password->identity_info.workstation.string : "";
1150 DEBUG(3,("SAM Logon (Interactive). Domain:[%s]. ", lp_workgroup()));
1152 case NetlogonNetworkInformation:
1153 case NetlogonNetworkTransitiveInformation:
1154 nt_username = logon->network->identity_info.account_name.string ?
1155 logon->network->identity_info.account_name.string : "";
1156 nt_domain = logon->network->identity_info.domain_name.string ?
1157 logon->network->identity_info.domain_name.string : "";
1158 nt_workstation = logon->network->identity_info.workstation.string ?
1159 logon->network->identity_info.workstation.string : "";
1161 DEBUG(3,("SAM Logon (Network). Domain:[%s]. ", lp_workgroup()));
1164 DEBUG(2,("SAM Logon: unsupported switch value\n"));
1165 return NT_STATUS_INVALID_INFO_CLASS;
1168 DEBUG(3,("User:[%s@%s] Requested Domain:[%s]\n", nt_username, nt_workstation, nt_domain));
1169 fstrcpy(current_user_info.smb_name, nt_username);
1170 sub_set_smb_name(nt_username);
1172 DEBUG(5,("Attempting validation level %d for unmapped username %s.\n",
1173 r->in.validation_level, nt_username));
1175 status = NT_STATUS_OK;
1177 switch (r->in.logon_level) {
1178 case NetlogonNetworkInformation:
1179 case NetlogonNetworkTransitiveInformation:
1181 const char *wksname = nt_workstation;
1183 status = make_auth_context_fixed(&auth_context,
1184 logon->network->challenge);
1185 if (!NT_STATUS_IS_OK(status)) {
1189 /* For a network logon, the workstation name comes in with two
1190 * backslashes in the front. Strip them if they are there. */
1192 if (*wksname == '\\') wksname++;
1193 if (*wksname == '\\') wksname++;
1195 /* Standard challenge/response authenticaion */
1196 if (!make_user_info_netlogon_network(&user_info,
1197 nt_username, nt_domain,
1199 logon->network->identity_info.parameter_control,
1200 logon->network->lm.data,
1201 logon->network->lm.length,
1202 logon->network->nt.data,
1203 logon->network->nt.length)) {
1204 status = NT_STATUS_NO_MEMORY;
1208 case NetlogonInteractiveInformation:
1209 case NetlogonServiceInformation:
1210 case NetlogonInteractiveTransitiveInformation:
1211 case NetlogonServiceTransitiveInformation:
1213 /* 'Interactive' authentication, supplies the password in its
1214 MD4 form, encrypted with the session key. We will convert
1215 this to challenge/response for the auth subsystem to chew
1220 if (!NT_STATUS_IS_OK(status = make_auth_context_subsystem(&auth_context))) {
1224 auth_context->get_ntlm_challenge(auth_context, chal);
1226 if (!make_user_info_netlogon_interactive(&user_info,
1227 nt_username, nt_domain,
1229 logon->password->identity_info.parameter_control,
1231 logon->password->lmpassword.hash,
1232 logon->password->ntpassword.hash,
1233 creds->session_key)) {
1234 status = NT_STATUS_NO_MEMORY;
1239 DEBUG(2,("SAM Logon: unsupported switch value\n"));
1240 return NT_STATUS_INVALID_INFO_CLASS;
1243 if ( NT_STATUS_IS_OK(status) ) {
1244 status = auth_context->check_ntlm_password(auth_context,
1245 user_info, &server_info);
1248 (auth_context->free)(&auth_context);
1249 free_user_info(&user_info);
1251 DEBUG(5,("%s: check_password returned status %s\n",
1252 fn, nt_errstr(status)));
1254 /* Check account and password */
1256 if (!NT_STATUS_IS_OK(status)) {
1257 /* If we don't know what this domain is, we need to
1258 indicate that we are not authoritative. This
1259 allows the client to decide if it needs to try
1260 a local user. Fix by jpjanosi@us.ibm.com, #2976 */
1261 if ( NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)
1262 && !strequal(nt_domain, get_global_sam_name())
1263 && !is_trusted_domain(nt_domain) )
1264 *r->out.authoritative = false; /* We are not authoritative */
1266 TALLOC_FREE(server_info);
1270 if (server_info->guest) {
1271 /* We don't like guest domain logons... */
1272 DEBUG(5,("%s: Attempted domain logon as GUEST "
1274 TALLOC_FREE(server_info);
1275 return NT_STATUS_LOGON_FAILURE;
1278 /* This is the point at which, if the login was successful, that
1279 the SAM Local Security Authority should record that the user is
1280 logged in to the domain. */
1282 if (process_creds) {
1283 /* Get the pipe session key from the creds. */
1284 memcpy(pipe_session_key, creds->session_key, 16);
1286 /* Get the pipe session key from the schannel. */
1287 if ((p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL)
1288 || (p->auth.a_u.schannel_auth == NULL)) {
1289 return NT_STATUS_INVALID_HANDLE;
1291 memcpy(pipe_session_key, p->auth.a_u.schannel_auth->creds->session_key, 16);
1294 switch (r->in.validation_level) {
1296 status = serverinfo_to_SamInfo2(server_info, pipe_session_key, 16,
1297 r->out.validation->sam2);
1300 status = serverinfo_to_SamInfo3(server_info, pipe_session_key, 16,
1301 r->out.validation->sam3);
1304 status = serverinfo_to_SamInfo6(server_info, pipe_session_key, 16,
1305 r->out.validation->sam6);
1309 TALLOC_FREE(server_info);
1314 /****************************************************************
1315 _netr_LogonSamLogonWithFlags
1316 ****************************************************************/
1318 NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p,
1319 struct netr_LogonSamLogonWithFlags *r)
1322 struct netlogon_creds_CredentialState *creds;
1323 struct netr_LogonSamLogonEx r2;
1324 struct netr_Authenticator return_authenticator;
1327 status = netr_creds_server_step_check(p, p->mem_ctx,
1328 r->in.computer_name,
1330 &return_authenticator,
1333 if (!NT_STATUS_IS_OK(status)) {
1337 r2.in.server_name = r->in.server_name;
1338 r2.in.computer_name = r->in.computer_name;
1339 r2.in.logon_level = r->in.logon_level;
1340 r2.in.logon = r->in.logon;
1341 r2.in.validation_level = r->in.validation_level;
1342 r2.in.flags = r->in.flags;
1343 r2.out.validation = r->out.validation;
1344 r2.out.authoritative = r->out.authoritative;
1345 r2.out.flags = r->out.flags;
1347 status = _netr_LogonSamLogon_base(p, &r2, creds);
1349 *r->out.return_authenticator = return_authenticator;
1354 /*************************************************************************
1356 *************************************************************************/
1358 NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
1359 struct netr_LogonSamLogon *r)
1362 struct netr_LogonSamLogonWithFlags r2;
1365 r2.in.server_name = r->in.server_name;
1366 r2.in.computer_name = r->in.computer_name;
1367 r2.in.credential = r->in.credential;
1368 r2.in.logon_level = r->in.logon_level;
1369 r2.in.logon = r->in.logon;
1370 r2.in.validation_level = r->in.validation_level;
1371 r2.in.return_authenticator = r->in.return_authenticator;
1372 r2.in.flags = &flags;
1373 r2.out.validation = r->out.validation;
1374 r2.out.authoritative = r->out.authoritative;
1375 r2.out.flags = &flags;
1376 r2.out.return_authenticator = r->out.return_authenticator;
1378 status = _netr_LogonSamLogonWithFlags(p, &r2);
1383 /*************************************************************************
1384 _netr_LogonSamLogonEx
1385 - no credential chaining. Map into net sam logon.
1386 *************************************************************************/
1388 NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p,
1389 struct netr_LogonSamLogonEx *r)
1392 struct netlogon_creds_CredentialState *creds = NULL;
1395 status = schannel_get_creds_state(p->mem_ctx, lp_private_dir(),
1396 r->in.computer_name, &creds);
1398 if (!NT_STATUS_IS_OK(status)) {
1402 /* Only allow this if the pipe is protected. */
1403 if (p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
1404 DEBUG(0,("_netr_LogonSamLogonEx: client %s not using schannel for netlogon\n",
1405 get_remote_machine_name() ));
1406 return NT_STATUS_INVALID_PARAMETER;
1409 status = _netr_LogonSamLogon_base(p, r, creds);
1415 /*************************************************************************
1417 *************************************************************************/
1418 #if 0 /* JERRY -- not correct */
1419 NTSTATUS _ds_enum_dom_trusts(pipes_struct *p, DS_Q_ENUM_DOM_TRUSTS *q_u,
1420 DS_R_ENUM_DOM_TRUSTS *r_u)
1422 NTSTATUS status = NT_STATUS_OK;
1424 /* TODO: According to MSDN, the can only be executed against a
1425 DC or domain member running Windows 2000 or later. Need
1426 to test against a standalone 2k server and see what it
1427 does. A windows 2000 DC includes its own domain in the
1435 /****************************************************************
1436 ****************************************************************/
1438 WERROR _netr_LogonUasLogon(pipes_struct *p,
1439 struct netr_LogonUasLogon *r)
1441 p->rng_fault_state = true;
1442 return WERR_NOT_SUPPORTED;
1445 /****************************************************************
1446 ****************************************************************/
1448 WERROR _netr_LogonUasLogoff(pipes_struct *p,
1449 struct netr_LogonUasLogoff *r)
1451 p->rng_fault_state = true;
1452 return WERR_NOT_SUPPORTED;
1455 /****************************************************************
1456 ****************************************************************/
1458 NTSTATUS _netr_DatabaseDeltas(pipes_struct *p,
1459 struct netr_DatabaseDeltas *r)
1461 p->rng_fault_state = true;
1462 return NT_STATUS_NOT_IMPLEMENTED;
1465 /****************************************************************
1466 ****************************************************************/
1468 NTSTATUS _netr_DatabaseSync(pipes_struct *p,
1469 struct netr_DatabaseSync *r)
1471 p->rng_fault_state = true;
1472 return NT_STATUS_NOT_IMPLEMENTED;
1475 /****************************************************************
1476 ****************************************************************/
1478 NTSTATUS _netr_AccountDeltas(pipes_struct *p,
1479 struct netr_AccountDeltas *r)
1481 p->rng_fault_state = true;
1482 return NT_STATUS_NOT_IMPLEMENTED;
1485 /****************************************************************
1486 ****************************************************************/
1488 NTSTATUS _netr_AccountSync(pipes_struct *p,
1489 struct netr_AccountSync *r)
1491 p->rng_fault_state = true;
1492 return NT_STATUS_NOT_IMPLEMENTED;
1495 /****************************************************************
1496 ****************************************************************/
1498 static bool wb_getdcname(TALLOC_CTX *mem_ctx,
1500 const char **dcname,
1505 struct wbcDomainControllerInfo *dc_info = NULL;
1507 result = wbcLookupDomainController(domain,
1511 case WBC_ERR_SUCCESS:
1513 case WBC_ERR_WINBIND_NOT_AVAILABLE:
1515 case WBC_ERR_DOMAIN_NOT_FOUND:
1516 *werr = WERR_NO_SUCH_DOMAIN;
1519 *werr = WERR_DOMAIN_CONTROLLER_NOT_FOUND;
1523 *dcname = talloc_strdup(mem_ctx, dc_info->dc_name);
1524 wbcFreeMemory(dc_info);
1535 /****************************************************************
1537 ****************************************************************/
1539 WERROR _netr_GetDcName(pipes_struct *p,
1540 struct netr_GetDcName *r)
1545 struct netr_DsRGetDCNameInfo *info;
1548 ret = wb_getdcname(p->mem_ctx,
1551 WBC_LOOKUP_DC_IS_FLAT_NAME |
1552 WBC_LOOKUP_DC_RETURN_FLAT_NAME |
1553 WBC_LOOKUP_DC_PDC_REQUIRED,
1559 flags = DS_PDC_REQUIRED | DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME;
1561 status = dsgetdcname(p->mem_ctx,
1562 smbd_messaging_context(),
1568 if (!NT_STATUS_IS_OK(status)) {
1569 return ntstatus_to_werror(status);
1572 *r->out.dcname = talloc_strdup(p->mem_ctx, info->dc_unc);
1574 if (!*r->out.dcname) {
1581 /****************************************************************
1583 ****************************************************************/
1585 WERROR _netr_GetAnyDCName(pipes_struct *p,
1586 struct netr_GetAnyDCName *r)
1591 struct netr_DsRGetDCNameInfo *info;
1594 ret = wb_getdcname(p->mem_ctx,
1597 WBC_LOOKUP_DC_IS_FLAT_NAME |
1598 WBC_LOOKUP_DC_RETURN_FLAT_NAME,
1604 flags = DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME;
1606 status = dsgetdcname(p->mem_ctx,
1607 smbd_messaging_context(),
1613 if (!NT_STATUS_IS_OK(status)) {
1614 return ntstatus_to_werror(status);
1617 *r->out.dcname = talloc_strdup(p->mem_ctx, info->dc_unc);
1619 if (!*r->out.dcname) {
1626 /****************************************************************
1627 ****************************************************************/
1629 NTSTATUS _netr_DatabaseSync2(pipes_struct *p,
1630 struct netr_DatabaseSync2 *r)
1632 p->rng_fault_state = true;
1633 return NT_STATUS_NOT_IMPLEMENTED;
1636 /****************************************************************
1637 ****************************************************************/
1639 NTSTATUS _netr_DatabaseRedo(pipes_struct *p,
1640 struct netr_DatabaseRedo *r)
1642 p->rng_fault_state = true;
1643 return NT_STATUS_NOT_IMPLEMENTED;
1646 /****************************************************************
1647 ****************************************************************/
1649 WERROR _netr_DsRGetDCName(pipes_struct *p,
1650 struct netr_DsRGetDCName *r)
1652 p->rng_fault_state = true;
1653 return WERR_NOT_SUPPORTED;
1656 /****************************************************************
1657 ****************************************************************/
1659 NTSTATUS _netr_LogonGetCapabilities(pipes_struct *p,
1660 struct netr_LogonGetCapabilities *r)
1662 return NT_STATUS_NOT_IMPLEMENTED;
1665 /****************************************************************
1666 ****************************************************************/
1668 WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p,
1669 struct netr_NETRLOGONSETSERVICEBITS *r)
1671 p->rng_fault_state = true;
1672 return WERR_NOT_SUPPORTED;
1675 /****************************************************************
1676 ****************************************************************/
1678 WERROR _netr_LogonGetTrustRid(pipes_struct *p,
1679 struct netr_LogonGetTrustRid *r)
1681 p->rng_fault_state = true;
1682 return WERR_NOT_SUPPORTED;
1685 /****************************************************************
1686 ****************************************************************/
1688 WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p,
1689 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
1691 p->rng_fault_state = true;
1692 return WERR_NOT_SUPPORTED;
1695 /****************************************************************
1696 ****************************************************************/
1698 WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p,
1699 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
1701 p->rng_fault_state = true;
1702 return WERR_NOT_SUPPORTED;
1705 /****************************************************************
1706 ****************************************************************/
1708 WERROR _netr_DsRGetDCNameEx(pipes_struct *p,
1709 struct netr_DsRGetDCNameEx *r)
1711 p->rng_fault_state = true;
1712 return WERR_NOT_SUPPORTED;
1715 /****************************************************************
1716 ****************************************************************/
1718 WERROR _netr_DsRGetSiteName(pipes_struct *p,
1719 struct netr_DsRGetSiteName *r)
1721 p->rng_fault_state = true;
1722 return WERR_NOT_SUPPORTED;
1725 /****************************************************************
1726 ****************************************************************/
1728 NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p,
1729 struct netr_LogonGetDomainInfo *r)
1731 p->rng_fault_state = true;
1732 return NT_STATUS_NOT_IMPLEMENTED;
1735 /****************************************************************
1736 ****************************************************************/
1738 WERROR _netr_ServerPasswordGet(pipes_struct *p,
1739 struct netr_ServerPasswordGet *r)
1741 p->rng_fault_state = true;
1742 return WERR_NOT_SUPPORTED;
1745 /****************************************************************
1746 ****************************************************************/
1748 WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p,
1749 struct netr_NETRLOGONSENDTOSAM *r)
1751 p->rng_fault_state = true;
1752 return WERR_NOT_SUPPORTED;
1755 /****************************************************************
1756 ****************************************************************/
1758 WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p,
1759 struct netr_DsRAddressToSitenamesW *r)
1761 p->rng_fault_state = true;
1762 return WERR_NOT_SUPPORTED;
1765 /****************************************************************
1766 ****************************************************************/
1768 WERROR _netr_DsRGetDCNameEx2(pipes_struct *p,
1769 struct netr_DsRGetDCNameEx2 *r)
1771 p->rng_fault_state = true;
1772 return WERR_NOT_SUPPORTED;
1775 /****************************************************************
1776 ****************************************************************/
1778 WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p,
1779 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
1781 p->rng_fault_state = true;
1782 return WERR_NOT_SUPPORTED;
1785 /****************************************************************
1786 ****************************************************************/
1788 WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p,
1789 struct netr_NetrEnumerateTrustedDomainsEx *r)
1791 p->rng_fault_state = true;
1792 return WERR_NOT_SUPPORTED;
1795 /****************************************************************
1796 ****************************************************************/
1798 WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p,
1799 struct netr_DsRAddressToSitenamesExW *r)
1801 p->rng_fault_state = true;
1802 return WERR_NOT_SUPPORTED;
1805 /****************************************************************
1806 ****************************************************************/
1808 WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p,
1809 struct netr_DsrGetDcSiteCoverageW *r)
1811 p->rng_fault_state = true;
1812 return WERR_NOT_SUPPORTED;
1815 /****************************************************************
1816 ****************************************************************/
1818 WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p,
1819 struct netr_DsrEnumerateDomainTrusts *r)
1821 p->rng_fault_state = true;
1822 return WERR_NOT_SUPPORTED;
1825 /****************************************************************
1826 ****************************************************************/
1828 WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p,
1829 struct netr_DsrDeregisterDNSHostRecords *r)
1831 p->rng_fault_state = true;
1832 return WERR_NOT_SUPPORTED;
1835 /****************************************************************
1836 ****************************************************************/
1838 NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p,
1839 struct netr_ServerTrustPasswordsGet *r)
1841 p->rng_fault_state = true;
1842 return NT_STATUS_NOT_IMPLEMENTED;
1845 /****************************************************************
1846 ****************************************************************/
1848 WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p,
1849 struct netr_DsRGetForestTrustInformation *r)
1851 p->rng_fault_state = true;
1852 return WERR_NOT_SUPPORTED;
1855 /****************************************************************
1856 ****************************************************************/
1858 NTSTATUS _netr_GetForestTrustInformation(pipes_struct *p,
1859 struct netr_GetForestTrustInformation *r)
1861 p->rng_fault_state = true;
1862 return NT_STATUS_NOT_IMPLEMENTED;
1865 /****************************************************************
1866 ****************************************************************/
1868 NTSTATUS _netr_ServerGetTrustInfo(pipes_struct *p,
1869 struct netr_ServerGetTrustInfo *r)
1871 p->rng_fault_state = true;
1872 return NT_STATUS_NOT_IMPLEMENTED;