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"
32 extern userdom_struct current_user_info;
35 #define DBGC_CLASS DBGC_RPC_SRV
37 struct netlogon_server_pipe_state {
38 struct netr_Credential client_challenge;
39 struct netr_Credential server_challenge;
42 /*************************************************************************
44 *************************************************************************/
46 WERROR _netr_LogonControl(pipes_struct *p,
47 struct netr_LogonControl *r)
49 struct netr_LogonControl2Ex l;
51 switch (r->in.level) {
55 return WERR_NOT_SUPPORTED;
57 return WERR_UNKNOWN_LEVEL;
60 l.in.logon_server = r->in.logon_server;
61 l.in.function_code = r->in.function_code;
62 l.in.level = r->in.level;
64 l.out.query = r->out.query;
66 return _netr_LogonControl2Ex(p, &l);
69 /****************************************************************************
70 Send a message to smbd to do a sam synchronisation
71 **************************************************************************/
73 static void send_sync_message(void)
75 DEBUG(3, ("sending sam synchronisation message\n"));
76 message_send_all(smbd_messaging_context(), MSG_SMB_SAM_SYNC, NULL, 0,
80 /*************************************************************************
82 *************************************************************************/
84 WERROR _netr_LogonControl2(pipes_struct *p,
85 struct netr_LogonControl2 *r)
87 struct netr_LogonControl2Ex l;
89 l.in.logon_server = r->in.logon_server;
90 l.in.function_code = r->in.function_code;
91 l.in.level = r->in.level;
92 l.in.data = r->in.data;
93 l.out.query = r->out.query;
95 return _netr_LogonControl2Ex(p, &l);
98 /*************************************************************************
99 *************************************************************************/
101 static bool wb_change_trust_creds(const char *domain, WERROR *tc_status)
104 struct wbcAuthErrorInfo *error = NULL;
106 result = wbcChangeTrustCredentials(domain, &error);
108 case WBC_ERR_WINBIND_NOT_AVAILABLE:
110 case WBC_ERR_DOMAIN_NOT_FOUND:
111 *tc_status = WERR_NO_SUCH_DOMAIN;
113 case WBC_ERR_SUCCESS:
114 *tc_status = WERR_OK;
120 if (error && error->nt_status != 0) {
121 *tc_status = ntstatus_to_werror(NT_STATUS(error->nt_status));
123 *tc_status = WERR_TRUST_FAILURE;
125 wbcFreeMemory(error);
129 /*************************************************************************
130 *************************************************************************/
132 static bool wb_check_trust_creds(const char *domain, WERROR *tc_status)
135 struct wbcAuthErrorInfo *error = NULL;
137 result = wbcCheckTrustCredentials(domain, &error);
139 case WBC_ERR_WINBIND_NOT_AVAILABLE:
141 case WBC_ERR_DOMAIN_NOT_FOUND:
142 *tc_status = WERR_NO_SUCH_DOMAIN;
144 case WBC_ERR_SUCCESS:
145 *tc_status = WERR_OK;
151 if (error && error->nt_status != 0) {
152 *tc_status = ntstatus_to_werror(NT_STATUS(error->nt_status));
154 *tc_status = WERR_TRUST_FAILURE;
156 wbcFreeMemory(error);
160 /****************************************************************
161 _netr_LogonControl2Ex
162 ****************************************************************/
164 WERROR _netr_LogonControl2Ex(pipes_struct *p,
165 struct netr_LogonControl2Ex *r)
167 uint32_t flags = 0x0;
168 WERROR pdc_connection_status = WERR_OK;
169 uint32_t logon_attempts = 0x0;
172 const char *dc_name = NULL;
173 struct sockaddr_storage dc_ss;
174 const char *domain = NULL;
175 struct netr_NETLOGON_INFO_1 *info1;
176 struct netr_NETLOGON_INFO_2 *info2;
177 struct netr_NETLOGON_INFO_3 *info3;
178 struct netr_NETLOGON_INFO_4 *info4;
182 switch (p->hdr_req.opnum) {
183 case NDR_NETR_LOGONCONTROL:
184 fn = "_netr_LogonControl";
186 case NDR_NETR_LOGONCONTROL2:
187 fn = "_netr_LogonControl2";
189 case NDR_NETR_LOGONCONTROL2EX:
190 fn = "_netr_LogonControl2Ex";
193 return WERR_INVALID_PARAM;
196 acct_ctrl = pdb_get_acct_ctrl(p->server_info->sam_account);
198 switch (r->in.function_code) {
199 case NETLOGON_CONTROL_TC_VERIFY:
200 case NETLOGON_CONTROL_CHANGE_PASSWORD:
201 case NETLOGON_CONTROL_REDISCOVER:
202 if ((geteuid() != sec_initial_uid()) &&
203 !nt_token_check_domain_rid(p->server_info->ptok, DOMAIN_RID_ADMINS) &&
204 !nt_token_check_sid(&global_sid_Builtin_Administrators, p->server_info->ptok) &&
205 !(acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST))) {
206 return WERR_ACCESS_DENIED;
213 tc_status = WERR_NO_SUCH_DOMAIN;
215 switch (r->in.function_code) {
216 case NETLOGON_CONTROL_QUERY:
219 case NETLOGON_CONTROL_REPLICATE:
220 case NETLOGON_CONTROL_SYNCHRONIZE:
221 case NETLOGON_CONTROL_PDC_REPLICATE:
222 case NETLOGON_CONTROL_BACKUP_CHANGE_LOG:
223 case NETLOGON_CONTROL_BREAKPOINT:
224 if (acct_ctrl & ACB_NORMAL) {
225 return WERR_NOT_SUPPORTED;
226 } else if (acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST)) {
227 return WERR_ACCESS_DENIED;
229 return WERR_ACCESS_DENIED;
231 case NETLOGON_CONTROL_TRUNCATE_LOG:
232 if (acct_ctrl & ACB_NORMAL) {
234 } else if (acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST)) {
235 return WERR_ACCESS_DENIED;
237 return WERR_ACCESS_DENIED;
240 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
241 case NETLOGON_CONTROL_FORCE_DNS_REG:
242 case NETLOGON_CONTROL_QUERY_DNS_REG:
243 return WERR_NOT_SUPPORTED;
244 case NETLOGON_CONTROL_FIND_USER:
245 if (!r->in.data || !r->in.data->user) {
246 return WERR_NOT_SUPPORTED;
249 case NETLOGON_CONTROL_SET_DBFLAG:
251 return WERR_NOT_SUPPORTED;
254 case NETLOGON_CONTROL_TC_VERIFY:
255 if (!r->in.data || !r->in.data->domain) {
256 return WERR_NOT_SUPPORTED;
259 if (!wb_check_trust_creds(r->in.data->domain, &tc_status)) {
260 return WERR_NOT_SUPPORTED;
263 case NETLOGON_CONTROL_TC_QUERY:
264 if (!r->in.data || !r->in.data->domain) {
265 return WERR_NOT_SUPPORTED;
268 domain = r->in.data->domain;
270 if (!is_trusted_domain(domain)) {
274 if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
275 tc_status = WERR_NO_LOGON_SERVERS;
279 dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
288 case NETLOGON_CONTROL_REDISCOVER:
289 if (!r->in.data || !r->in.data->domain) {
290 return WERR_NOT_SUPPORTED;
293 domain = r->in.data->domain;
295 if (!is_trusted_domain(domain)) {
299 if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
300 tc_status = WERR_NO_LOGON_SERVERS;
304 dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
313 case NETLOGON_CONTROL_CHANGE_PASSWORD:
314 if (!r->in.data || !r->in.data->domain) {
315 return WERR_NOT_SUPPORTED;
318 if (!wb_change_trust_creds(r->in.data->domain, &tc_status)) {
319 return WERR_NOT_SUPPORTED;
324 /* no idea what this should be */
325 DEBUG(0,("%s: unimplemented function level [%d]\n",
326 fn, r->in.function_code));
327 return WERR_UNKNOWN_LEVEL;
330 /* prepare the response */
332 switch (r->in.level) {
334 info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1);
335 W_ERROR_HAVE_NO_MEMORY(info1);
337 info1->flags = flags;
338 info1->pdc_connection_status = pdc_connection_status;
340 r->out.query->info1 = info1;
343 info2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_2);
344 W_ERROR_HAVE_NO_MEMORY(info2);
346 info2->flags = flags;
347 info2->pdc_connection_status = pdc_connection_status;
348 info2->trusted_dc_name = dc_name;
349 info2->tc_connection_status = tc_status;
351 r->out.query->info2 = info2;
354 info3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_3);
355 W_ERROR_HAVE_NO_MEMORY(info3);
357 info3->flags = flags;
358 info3->logon_attempts = logon_attempts;
360 r->out.query->info3 = info3;
363 info4 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_4);
364 W_ERROR_HAVE_NO_MEMORY(info4);
366 info4->trusted_dc_name = dc_name;
367 info4->trusted_domain_name = r->in.data->domain;
369 r->out.query->info4 = info4;
372 return WERR_UNKNOWN_LEVEL;
375 if (lp_server_role() == ROLE_DOMAIN_BDC) {
382 /*************************************************************************
383 _netr_NetrEnumerateTrustedDomains
384 *************************************************************************/
386 WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
387 struct netr_NetrEnumerateTrustedDomains *r)
391 struct trustdom_info **domains;
392 uint32_t num_domains;
393 const char **trusted_domains;
396 DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
398 /* set up the Trusted Domain List response */
401 status = pdb_enum_trusteddoms(p->mem_ctx, &num_domains, &domains);
404 if (!NT_STATUS_IS_OK(status)) {
405 return ntstatus_to_werror(status);
408 trusted_domains = talloc_zero_array(p->mem_ctx, const char *, num_domains + 1);
409 if (!trusted_domains) {
413 for (i = 0; i < num_domains; i++) {
414 trusted_domains[i] = talloc_strdup(trusted_domains, domains[i]->name);
415 if (!trusted_domains[i]) {
416 TALLOC_FREE(trusted_domains);
421 if (!push_reg_multi_sz(trusted_domains, NULL, &blob, trusted_domains)) {
422 TALLOC_FREE(trusted_domains);
426 r->out.trusted_domains_blob->data = blob.data;
427 r->out.trusted_domains_blob->length = blob.length;
429 DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
434 /******************************************************************
435 gets a machine password entry. checks access rights of the host.
436 ******************************************************************/
438 static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
439 enum netr_SchannelType sec_chan_type, struct dom_sid *sid)
441 struct samu *sampass = NULL;
447 char addr[INET6_ADDRSTRLEN];
450 * Currently this code is redundent as we already have a filter
451 * by hostname list. What this code really needs to do is to
452 * get a hosts allowed/hosts denied list from the SAM database
453 * on a per user basis, and make the access decision there.
454 * I will leave this code here for now as a reminder to implement
455 * this at a later date. JRA.
458 if (!allow_access(lp_domain_hostsdeny(), lp_domain_hostsallow(),
459 client_name(get_client_fd()),
460 client_addr(get_client_fd(),addr,sizeof(addr)))) {
461 DEBUG(0,("get_md4pw: Workstation %s denied access to domain\n", mach_acct));
466 if ( !(sampass = samu_new( NULL )) ) {
467 return NT_STATUS_NO_MEMORY;
470 /* JRA. This is ok as it is only used for generating the challenge. */
472 ret = pdb_getsampwnam(sampass, mach_acct);
476 DEBUG(0,("get_md4pw: Workstation %s: no account in domain\n", mach_acct));
477 TALLOC_FREE(sampass);
478 return NT_STATUS_ACCESS_DENIED;
481 acct_ctrl = pdb_get_acct_ctrl(sampass);
482 if (acct_ctrl & ACB_DISABLED) {
483 DEBUG(0,("get_md4pw: Workstation %s: account is disabled\n", mach_acct));
484 TALLOC_FREE(sampass);
485 return NT_STATUS_ACCOUNT_DISABLED;
488 if (!(acct_ctrl & ACB_SVRTRUST) &&
489 !(acct_ctrl & ACB_WSTRUST) &&
490 !(acct_ctrl & ACB_DOMTRUST))
492 DEBUG(0,("get_md4pw: Workstation %s: account is not a trust account\n", mach_acct));
493 TALLOC_FREE(sampass);
494 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
497 switch (sec_chan_type) {
499 if (!(acct_ctrl & ACB_SVRTRUST)) {
500 DEBUG(0,("get_md4pw: Workstation %s: BDC secure channel requested "
501 "but not a server trust account\n", mach_acct));
502 TALLOC_FREE(sampass);
503 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
507 if (!(acct_ctrl & ACB_WSTRUST)) {
508 DEBUG(0,("get_md4pw: Workstation %s: WORKSTATION secure channel requested "
509 "but not a workstation trust account\n", mach_acct));
510 TALLOC_FREE(sampass);
511 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
514 case SEC_CHAN_DOMAIN:
515 if (!(acct_ctrl & ACB_DOMTRUST)) {
516 DEBUG(0,("get_md4pw: Workstation %s: DOMAIN secure channel requested "
517 "but not a interdomain trust account\n", mach_acct));
518 TALLOC_FREE(sampass);
519 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
526 if ((pass = pdb_get_nt_passwd(sampass)) == NULL) {
527 DEBUG(0,("get_md4pw: Workstation %s: account does not have a password\n", mach_acct));
528 TALLOC_FREE(sampass);
529 return NT_STATUS_LOGON_FAILURE;
532 memcpy(md4pw->hash, pass, 16);
533 dump_data(5, md4pw->hash, 16);
535 sid_copy(sid, pdb_get_user_sid(sampass));
537 TALLOC_FREE(sampass);
544 /*************************************************************************
545 _netr_ServerReqChallenge
546 *************************************************************************/
548 NTSTATUS _netr_ServerReqChallenge(pipes_struct *p,
549 struct netr_ServerReqChallenge *r)
551 struct netlogon_server_pipe_state *pipe_state =
552 talloc_get_type(p->private_data, struct netlogon_server_pipe_state);
555 DEBUG(10,("_netr_ServerReqChallenge: new challenge requested. Clearing old state.\n"));
556 talloc_free(pipe_state);
557 p->private_data = NULL;
560 pipe_state = talloc(p, struct netlogon_server_pipe_state);
561 NT_STATUS_HAVE_NO_MEMORY(pipe_state);
563 pipe_state->client_challenge = *r->in.credentials;
565 generate_random_buffer(pipe_state->server_challenge.data,
566 sizeof(pipe_state->server_challenge.data));
568 *r->out.return_credentials = pipe_state->server_challenge;
570 p->private_data = pipe_state;
575 /*************************************************************************
576 _netr_ServerAuthenticate
577 Create the initial credentials.
578 *************************************************************************/
580 NTSTATUS _netr_ServerAuthenticate(pipes_struct *p,
581 struct netr_ServerAuthenticate *r)
583 struct netr_ServerAuthenticate3 a;
584 uint32_t negotiate_flags = 0;
587 a.in.server_name = r->in.server_name;
588 a.in.account_name = r->in.account_name;
589 a.in.secure_channel_type = r->in.secure_channel_type;
590 a.in.computer_name = r->in.computer_name;
591 a.in.credentials = r->in.credentials;
592 a.in.negotiate_flags = &negotiate_flags;
594 a.out.return_credentials = r->out.return_credentials;
596 a.out.negotiate_flags = &negotiate_flags;
598 return _netr_ServerAuthenticate3(p, &a);
602 /*************************************************************************
603 _netr_ServerAuthenticate3
604 *************************************************************************/
606 NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
607 struct netr_ServerAuthenticate3 *r)
611 /* r->in.negotiate_flags is an aliased pointer to r->out.negotiate_flags,
612 * so use a copy to avoid destroying the client values. */
613 uint32_t in_neg_flags = *r->in.negotiate_flags;
616 struct samr_Password mach_pwd;
617 struct netlogon_creds_CredentialState *creds;
618 struct netlogon_server_pipe_state *pipe_state =
619 talloc_get_type(p->private_data, struct netlogon_server_pipe_state);
621 /* According to Microsoft (see bugid #6099)
622 * Windows 7 looks at the negotiate_flags
623 * returned in this structure *even if the
624 * call fails with access denied* ! So in order
625 * to allow Win7 to connect to a Samba NT style
626 * PDC we set the flags before we know if it's
631 srv_flgs = NETLOGON_NEG_ACCOUNT_LOCKOUT |
632 NETLOGON_NEG_PERSISTENT_SAMREPL |
633 NETLOGON_NEG_ARCFOUR |
634 NETLOGON_NEG_PROMOTION_COUNT |
635 NETLOGON_NEG_CHANGELOG_BDC |
636 NETLOGON_NEG_FULL_SYNC_REPL |
637 NETLOGON_NEG_MULTIPLE_SIDS |
639 NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL |
640 NETLOGON_NEG_PASSWORD_SET2;
642 /* Ensure we support strong (128-bit) keys. */
643 if (in_neg_flags & NETLOGON_NEG_STRONG_KEYS) {
644 srv_flgs |= NETLOGON_NEG_STRONG_KEYS;
647 if (lp_server_schannel() != false) {
648 srv_flgs |= NETLOGON_NEG_SCHANNEL;
651 switch (p->hdr_req.opnum) {
652 case NDR_NETR_SERVERAUTHENTICATE:
653 fn = "_netr_ServerAuthenticate";
655 case NDR_NETR_SERVERAUTHENTICATE2:
656 fn = "_netr_ServerAuthenticate2";
658 case NDR_NETR_SERVERAUTHENTICATE3:
659 fn = "_netr_ServerAuthenticate3";
662 return NT_STATUS_INTERNAL_ERROR;
665 /* We use this as the key to store the creds: */
666 /* r->in.computer_name */
669 DEBUG(0,("%s: no challenge sent to client %s\n", fn,
670 r->in.computer_name));
671 status = NT_STATUS_ACCESS_DENIED;
675 if ( (lp_server_schannel() == true) &&
676 ((in_neg_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
678 /* schannel must be used, but client did not offer it. */
679 DEBUG(0,("%s: schannel required but client failed "
680 "to offer it. Client was %s\n",
681 fn, r->in.account_name));
682 status = NT_STATUS_ACCESS_DENIED;
686 status = get_md4pw(&mach_pwd,
688 r->in.secure_channel_type,
690 if (!NT_STATUS_IS_OK(status)) {
691 DEBUG(0,("%s: failed to get machine password for "
693 fn, r->in.account_name, nt_errstr(status) ));
694 /* always return NT_STATUS_ACCESS_DENIED */
695 status = NT_STATUS_ACCESS_DENIED;
699 /* From the client / server challenges and md4 password, generate sess key */
700 /* Check client credentials are valid. */
701 creds = netlogon_creds_server_init(p->mem_ctx,
704 r->in.secure_channel_type,
705 &pipe_state->client_challenge,
706 &pipe_state->server_challenge,
709 r->out.return_credentials,
710 *r->in.negotiate_flags);
712 DEBUG(0,("%s: netlogon_creds_server_check failed. Rejecting auth "
713 "request from client %s machine account %s\n",
714 fn, r->in.computer_name,
715 r->in.account_name));
716 status = NT_STATUS_ACCESS_DENIED;
720 creds->sid = sid_dup_talloc(creds, &sid);
722 status = NT_STATUS_NO_MEMORY;
726 /* Store off the state so we can continue after client disconnect. */
728 status = schannel_save_creds_state(p->mem_ctx,
729 NULL, 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, NULL,
825 received_authenticator,
826 return_authenticator,
832 /*************************************************************************
833 *************************************************************************/
835 static NTSTATUS netr_find_machine_account(TALLOC_CTX *mem_ctx,
836 const char *account_name,
837 struct samu **sampassp)
839 struct samu *sampass;
843 sampass = samu_new(mem_ctx);
845 return NT_STATUS_NO_MEMORY;
849 ret = pdb_getsampwnam(sampass, account_name);
853 TALLOC_FREE(sampass);
854 return NT_STATUS_ACCESS_DENIED;
857 /* Ensure the account exists and is a machine account. */
859 acct_ctrl = pdb_get_acct_ctrl(sampass);
861 if (!(acct_ctrl & ACB_WSTRUST ||
862 acct_ctrl & ACB_SVRTRUST ||
863 acct_ctrl & ACB_DOMTRUST)) {
864 TALLOC_FREE(sampass);
865 return NT_STATUS_NO_SUCH_USER;
868 if (acct_ctrl & ACB_DISABLED) {
869 TALLOC_FREE(sampass);
870 return NT_STATUS_ACCOUNT_DISABLED;
878 /*************************************************************************
879 *************************************************************************/
881 static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
882 struct samu *sampass,
883 DATA_BLOB *plaintext_blob,
884 struct samr_Password *nt_hash,
885 struct samr_Password *lm_hash)
889 const char *plaintext = NULL;
890 size_t plaintext_len;
891 struct samr_Password nt_hash_local;
894 return NT_STATUS_INVALID_PARAMETER;
897 if (plaintext_blob) {
898 if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
899 plaintext_blob->data, plaintext_blob->length,
900 &plaintext, &plaintext_len, false))
903 mdfour(nt_hash_local.hash, plaintext_blob->data, plaintext_blob->length);
904 nt_hash = &nt_hash_local;
909 if (!pdb_set_plaintext_passwd(sampass, plaintext)) {
910 return NT_STATUS_ACCESS_DENIED;
917 old_pw = pdb_get_nt_passwd(sampass);
919 if (old_pw && memcmp(nt_hash->hash, old_pw, 16) == 0) {
920 /* Avoid backend modificiations and other fun if the
921 client changed the password to the *same thing* */
923 /* LM password should be NULL for machines */
924 if (!pdb_set_lanman_passwd(sampass, NULL, PDB_CHANGED)) {
925 return NT_STATUS_NO_MEMORY;
927 if (!pdb_set_nt_passwd(sampass, nt_hash->hash, PDB_CHANGED)) {
928 return NT_STATUS_NO_MEMORY;
931 if (!pdb_set_pass_last_set_time(sampass, time(NULL), PDB_CHANGED)) {
932 /* Not quite sure what this one qualifies as, but this will do */
933 return NT_STATUS_UNSUCCESSFUL;
940 status = pdb_update_sam_account(sampass);
946 /*************************************************************************
947 _netr_ServerPasswordSet
948 *************************************************************************/
950 NTSTATUS _netr_ServerPasswordSet(pipes_struct *p,
951 struct netr_ServerPasswordSet *r)
953 NTSTATUS status = NT_STATUS_OK;
954 struct samu *sampass=NULL;
956 struct netlogon_creds_CredentialState *creds;
958 DEBUG(5,("_netr_ServerPasswordSet: %d\n", __LINE__));
961 status = netr_creds_server_step_check(p, p->mem_ctx,
964 r->out.return_authenticator,
968 if (!NT_STATUS_IS_OK(status)) {
969 DEBUG(2,("_netr_ServerPasswordSet: netlogon_creds_server_step failed. Rejecting auth "
970 "request from client %s machine account %s\n",
971 r->in.computer_name, creds->computer_name));
976 DEBUG(3,("_netr_ServerPasswordSet: Server Password Set by remote machine:[%s] on account [%s]\n",
977 r->in.computer_name, creds->computer_name));
979 netlogon_creds_des_decrypt(creds, r->in.new_password);
981 DEBUG(100,("_netr_ServerPasswordSet: new given value was :\n"));
982 for(i = 0; i < sizeof(r->in.new_password->hash); i++)
983 DEBUG(100,("%02X ", r->in.new_password->hash[i]));
986 status = netr_find_machine_account(p->mem_ctx,
989 if (!NT_STATUS_IS_OK(status)) {
993 status = netr_set_machine_account_password(sampass,
998 TALLOC_FREE(sampass);
1002 /****************************************************************
1003 _netr_ServerPasswordSet2
1004 ****************************************************************/
1006 NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
1007 struct netr_ServerPasswordSet2 *r)
1010 struct netlogon_creds_CredentialState *creds;
1011 struct samu *sampass;
1012 DATA_BLOB plaintext;
1013 struct samr_CryptPassword password_buf;
1014 struct samr_Password nt_hash;
1017 status = netr_creds_server_step_check(p, p->mem_ctx,
1018 r->in.computer_name,
1020 r->out.return_authenticator,
1024 if (!NT_STATUS_IS_OK(status)) {
1025 DEBUG(2,("_netr_ServerPasswordSet2: netlogon_creds_server_step "
1026 "failed. Rejecting auth request from client %s machine account %s\n",
1027 r->in.computer_name, creds->computer_name));
1032 memcpy(password_buf.data, r->in.new_password->data, 512);
1033 SIVAL(password_buf.data, 512, r->in.new_password->length);
1034 netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
1036 if (!extract_pw_from_buffer(p->mem_ctx, password_buf.data, &plaintext)) {
1037 return NT_STATUS_WRONG_PASSWORD;
1040 mdfour(nt_hash.hash, plaintext.data, plaintext.length);
1042 status = netr_find_machine_account(p->mem_ctx,
1043 creds->account_name,
1045 if (!NT_STATUS_IS_OK(status)) {
1049 status = netr_set_machine_account_password(sampass,
1054 TALLOC_FREE(sampass);
1058 /*************************************************************************
1059 _netr_LogonSamLogoff
1060 *************************************************************************/
1062 NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
1063 struct netr_LogonSamLogoff *r)
1066 struct netlogon_creds_CredentialState *creds;
1069 status = netr_creds_server_step_check(p, p->mem_ctx,
1070 r->in.computer_name,
1072 r->out.return_authenticator,
1079 /*************************************************************************
1080 _netr_LogonSamLogon_base
1081 *************************************************************************/
1083 static NTSTATUS _netr_LogonSamLogon_base(pipes_struct *p,
1084 struct netr_LogonSamLogonEx *r,
1085 struct netlogon_creds_CredentialState *creds)
1087 NTSTATUS status = NT_STATUS_OK;
1088 union netr_LogonLevel *logon = r->in.logon;
1089 const char *nt_username, *nt_domain, *nt_workstation;
1090 struct auth_usersupplied_info *user_info = NULL;
1091 struct auth_serversupplied_info *server_info = NULL;
1092 struct auth_context *auth_context = NULL;
1093 uint8_t pipe_session_key[16];
1094 bool process_creds = true;
1097 switch (p->hdr_req.opnum) {
1098 case NDR_NETR_LOGONSAMLOGON:
1099 process_creds = true;
1100 fn = "_netr_LogonSamLogon";
1102 case NDR_NETR_LOGONSAMLOGONWITHFLAGS:
1103 process_creds = true;
1104 fn = "_netr_LogonSamLogonWithFlags";
1106 case NDR_NETR_LOGONSAMLOGONEX:
1107 process_creds = false;
1108 fn = "_netr_LogonSamLogonEx";
1111 return NT_STATUS_INTERNAL_ERROR;
1114 *r->out.authoritative = true; /* authoritative response */
1116 switch (r->in.validation_level) {
1118 r->out.validation->sam2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo2);
1119 if (!r->out.validation->sam2) {
1120 return NT_STATUS_NO_MEMORY;
1124 r->out.validation->sam3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo3);
1125 if (!r->out.validation->sam3) {
1126 return NT_STATUS_NO_MEMORY;
1130 r->out.validation->sam6 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo6);
1131 if (!r->out.validation->sam6) {
1132 return NT_STATUS_NO_MEMORY;
1136 DEBUG(0,("%s: bad validation_level value %d.\n",
1137 fn, (int)r->in.validation_level));
1138 return NT_STATUS_INVALID_INFO_CLASS;
1141 switch (r->in.logon_level) {
1142 case NetlogonInteractiveInformation:
1143 case NetlogonServiceInformation:
1144 case NetlogonInteractiveTransitiveInformation:
1145 case NetlogonServiceTransitiveInformation:
1146 nt_username = logon->password->identity_info.account_name.string ?
1147 logon->password->identity_info.account_name.string : "";
1148 nt_domain = logon->password->identity_info.domain_name.string ?
1149 logon->password->identity_info.domain_name.string : "";
1150 nt_workstation = logon->password->identity_info.workstation.string ?
1151 logon->password->identity_info.workstation.string : "";
1153 DEBUG(3,("SAM Logon (Interactive). Domain:[%s]. ", lp_workgroup()));
1155 case NetlogonNetworkInformation:
1156 case NetlogonNetworkTransitiveInformation:
1157 nt_username = logon->network->identity_info.account_name.string ?
1158 logon->network->identity_info.account_name.string : "";
1159 nt_domain = logon->network->identity_info.domain_name.string ?
1160 logon->network->identity_info.domain_name.string : "";
1161 nt_workstation = logon->network->identity_info.workstation.string ?
1162 logon->network->identity_info.workstation.string : "";
1164 DEBUG(3,("SAM Logon (Network). Domain:[%s]. ", lp_workgroup()));
1167 DEBUG(2,("SAM Logon: unsupported switch value\n"));
1168 return NT_STATUS_INVALID_INFO_CLASS;
1171 DEBUG(3,("User:[%s@%s] Requested Domain:[%s]\n", nt_username, nt_workstation, nt_domain));
1172 fstrcpy(current_user_info.smb_name, nt_username);
1173 sub_set_smb_name(nt_username);
1175 DEBUG(5,("Attempting validation level %d for unmapped username %s.\n",
1176 r->in.validation_level, nt_username));
1178 status = NT_STATUS_OK;
1180 switch (r->in.logon_level) {
1181 case NetlogonNetworkInformation:
1182 case NetlogonNetworkTransitiveInformation:
1184 const char *wksname = nt_workstation;
1186 status = make_auth_context_fixed(&auth_context,
1187 logon->network->challenge);
1188 if (!NT_STATUS_IS_OK(status)) {
1192 /* For a network logon, the workstation name comes in with two
1193 * backslashes in the front. Strip them if they are there. */
1195 if (*wksname == '\\') wksname++;
1196 if (*wksname == '\\') wksname++;
1198 /* Standard challenge/response authenticaion */
1199 if (!make_user_info_netlogon_network(&user_info,
1200 nt_username, nt_domain,
1202 logon->network->identity_info.parameter_control,
1203 logon->network->lm.data,
1204 logon->network->lm.length,
1205 logon->network->nt.data,
1206 logon->network->nt.length)) {
1207 status = NT_STATUS_NO_MEMORY;
1211 case NetlogonInteractiveInformation:
1212 case NetlogonServiceInformation:
1213 case NetlogonInteractiveTransitiveInformation:
1214 case NetlogonServiceTransitiveInformation:
1216 /* 'Interactive' authentication, supplies the password in its
1217 MD4 form, encrypted with the session key. We will convert
1218 this to challenge/response for the auth subsystem to chew
1223 if (!NT_STATUS_IS_OK(status = make_auth_context_subsystem(&auth_context))) {
1227 auth_context->get_ntlm_challenge(auth_context, chal);
1229 if (!make_user_info_netlogon_interactive(&user_info,
1230 nt_username, nt_domain,
1232 logon->password->identity_info.parameter_control,
1234 logon->password->lmpassword.hash,
1235 logon->password->ntpassword.hash,
1236 creds->session_key)) {
1237 status = NT_STATUS_NO_MEMORY;
1242 DEBUG(2,("SAM Logon: unsupported switch value\n"));
1243 return NT_STATUS_INVALID_INFO_CLASS;
1246 if ( NT_STATUS_IS_OK(status) ) {
1247 status = auth_context->check_ntlm_password(auth_context,
1248 user_info, &server_info);
1251 (auth_context->free)(&auth_context);
1252 free_user_info(&user_info);
1254 DEBUG(5,("%s: check_password returned status %s\n",
1255 fn, nt_errstr(status)));
1257 /* Check account and password */
1259 if (!NT_STATUS_IS_OK(status)) {
1260 /* If we don't know what this domain is, we need to
1261 indicate that we are not authoritative. This
1262 allows the client to decide if it needs to try
1263 a local user. Fix by jpjanosi@us.ibm.com, #2976 */
1264 if ( NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)
1265 && !strequal(nt_domain, get_global_sam_name())
1266 && !is_trusted_domain(nt_domain) )
1267 *r->out.authoritative = false; /* We are not authoritative */
1269 TALLOC_FREE(server_info);
1273 if (server_info->guest) {
1274 /* We don't like guest domain logons... */
1275 DEBUG(5,("%s: Attempted domain logon as GUEST "
1277 TALLOC_FREE(server_info);
1278 return NT_STATUS_LOGON_FAILURE;
1281 /* This is the point at which, if the login was successful, that
1282 the SAM Local Security Authority should record that the user is
1283 logged in to the domain. */
1285 if (process_creds) {
1286 /* Get the pipe session key from the creds. */
1287 memcpy(pipe_session_key, creds->session_key, 16);
1289 /* Get the pipe session key from the schannel. */
1290 if ((p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL)
1291 || (p->auth.a_u.schannel_auth == NULL)) {
1292 return NT_STATUS_INVALID_HANDLE;
1294 memcpy(pipe_session_key, p->auth.a_u.schannel_auth->creds->session_key, 16);
1297 switch (r->in.validation_level) {
1299 status = serverinfo_to_SamInfo2(server_info, pipe_session_key, 16,
1300 r->out.validation->sam2);
1303 status = serverinfo_to_SamInfo3(server_info, pipe_session_key, 16,
1304 r->out.validation->sam3);
1307 status = serverinfo_to_SamInfo6(server_info, pipe_session_key, 16,
1308 r->out.validation->sam6);
1312 TALLOC_FREE(server_info);
1317 /****************************************************************
1318 _netr_LogonSamLogonWithFlags
1319 ****************************************************************/
1321 NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p,
1322 struct netr_LogonSamLogonWithFlags *r)
1325 struct netlogon_creds_CredentialState *creds;
1326 struct netr_LogonSamLogonEx r2;
1327 struct netr_Authenticator return_authenticator;
1330 status = netr_creds_server_step_check(p, p->mem_ctx,
1331 r->in.computer_name,
1333 &return_authenticator,
1336 if (!NT_STATUS_IS_OK(status)) {
1340 r2.in.server_name = r->in.server_name;
1341 r2.in.computer_name = r->in.computer_name;
1342 r2.in.logon_level = r->in.logon_level;
1343 r2.in.logon = r->in.logon;
1344 r2.in.validation_level = r->in.validation_level;
1345 r2.in.flags = r->in.flags;
1346 r2.out.validation = r->out.validation;
1347 r2.out.authoritative = r->out.authoritative;
1348 r2.out.flags = r->out.flags;
1350 status = _netr_LogonSamLogon_base(p, &r2, creds);
1352 *r->out.return_authenticator = return_authenticator;
1357 /*************************************************************************
1359 *************************************************************************/
1361 NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
1362 struct netr_LogonSamLogon *r)
1365 struct netr_LogonSamLogonWithFlags r2;
1368 r2.in.server_name = r->in.server_name;
1369 r2.in.computer_name = r->in.computer_name;
1370 r2.in.credential = r->in.credential;
1371 r2.in.logon_level = r->in.logon_level;
1372 r2.in.logon = r->in.logon;
1373 r2.in.validation_level = r->in.validation_level;
1374 r2.in.return_authenticator = r->in.return_authenticator;
1375 r2.in.flags = &flags;
1376 r2.out.validation = r->out.validation;
1377 r2.out.authoritative = r->out.authoritative;
1378 r2.out.flags = &flags;
1379 r2.out.return_authenticator = r->out.return_authenticator;
1381 status = _netr_LogonSamLogonWithFlags(p, &r2);
1386 /*************************************************************************
1387 _netr_LogonSamLogonEx
1388 - no credential chaining. Map into net sam logon.
1389 *************************************************************************/
1391 NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p,
1392 struct netr_LogonSamLogonEx *r)
1395 struct netlogon_creds_CredentialState *creds = NULL;
1398 status = schannel_get_creds_state(p->mem_ctx,
1399 NULL, lp_private_dir(),
1400 r->in.computer_name, &creds);
1402 if (!NT_STATUS_IS_OK(status)) {
1406 /* Only allow this if the pipe is protected. */
1407 if (p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
1408 DEBUG(0,("_netr_LogonSamLogonEx: client %s not using schannel for netlogon\n",
1409 get_remote_machine_name() ));
1410 return NT_STATUS_INVALID_PARAMETER;
1413 status = _netr_LogonSamLogon_base(p, r, creds);
1419 /*************************************************************************
1421 *************************************************************************/
1422 #if 0 /* JERRY -- not correct */
1423 NTSTATUS _ds_enum_dom_trusts(pipes_struct *p, DS_Q_ENUM_DOM_TRUSTS *q_u,
1424 DS_R_ENUM_DOM_TRUSTS *r_u)
1426 NTSTATUS status = NT_STATUS_OK;
1428 /* TODO: According to MSDN, the can only be executed against a
1429 DC or domain member running Windows 2000 or later. Need
1430 to test against a standalone 2k server and see what it
1431 does. A windows 2000 DC includes its own domain in the
1439 /****************************************************************
1440 ****************************************************************/
1442 WERROR _netr_LogonUasLogon(pipes_struct *p,
1443 struct netr_LogonUasLogon *r)
1445 p->rng_fault_state = true;
1446 return WERR_NOT_SUPPORTED;
1449 /****************************************************************
1450 ****************************************************************/
1452 WERROR _netr_LogonUasLogoff(pipes_struct *p,
1453 struct netr_LogonUasLogoff *r)
1455 p->rng_fault_state = true;
1456 return WERR_NOT_SUPPORTED;
1459 /****************************************************************
1460 ****************************************************************/
1462 NTSTATUS _netr_DatabaseDeltas(pipes_struct *p,
1463 struct netr_DatabaseDeltas *r)
1465 p->rng_fault_state = true;
1466 return NT_STATUS_NOT_IMPLEMENTED;
1469 /****************************************************************
1470 ****************************************************************/
1472 NTSTATUS _netr_DatabaseSync(pipes_struct *p,
1473 struct netr_DatabaseSync *r)
1475 p->rng_fault_state = true;
1476 return NT_STATUS_NOT_IMPLEMENTED;
1479 /****************************************************************
1480 ****************************************************************/
1482 NTSTATUS _netr_AccountDeltas(pipes_struct *p,
1483 struct netr_AccountDeltas *r)
1485 p->rng_fault_state = true;
1486 return NT_STATUS_NOT_IMPLEMENTED;
1489 /****************************************************************
1490 ****************************************************************/
1492 NTSTATUS _netr_AccountSync(pipes_struct *p,
1493 struct netr_AccountSync *r)
1495 p->rng_fault_state = true;
1496 return NT_STATUS_NOT_IMPLEMENTED;
1499 /****************************************************************
1500 ****************************************************************/
1502 static bool wb_getdcname(TALLOC_CTX *mem_ctx,
1504 const char **dcname,
1509 struct wbcDomainControllerInfo *dc_info = NULL;
1511 result = wbcLookupDomainController(domain,
1515 case WBC_ERR_SUCCESS:
1517 case WBC_ERR_WINBIND_NOT_AVAILABLE:
1519 case WBC_ERR_DOMAIN_NOT_FOUND:
1520 *werr = WERR_NO_SUCH_DOMAIN;
1523 *werr = WERR_DOMAIN_CONTROLLER_NOT_FOUND;
1527 *dcname = talloc_strdup(mem_ctx, dc_info->dc_name);
1528 wbcFreeMemory(dc_info);
1539 /****************************************************************
1541 ****************************************************************/
1543 WERROR _netr_GetDcName(pipes_struct *p,
1544 struct netr_GetDcName *r)
1549 struct netr_DsRGetDCNameInfo *info;
1552 ret = wb_getdcname(p->mem_ctx,
1555 WBC_LOOKUP_DC_IS_FLAT_NAME |
1556 WBC_LOOKUP_DC_RETURN_FLAT_NAME |
1557 WBC_LOOKUP_DC_PDC_REQUIRED,
1563 flags = DS_PDC_REQUIRED | DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME;
1565 status = dsgetdcname(p->mem_ctx,
1566 smbd_messaging_context(),
1572 if (!NT_STATUS_IS_OK(status)) {
1573 return ntstatus_to_werror(status);
1576 *r->out.dcname = talloc_strdup(p->mem_ctx, info->dc_unc);
1578 if (!*r->out.dcname) {
1585 /****************************************************************
1587 ****************************************************************/
1589 WERROR _netr_GetAnyDCName(pipes_struct *p,
1590 struct netr_GetAnyDCName *r)
1595 struct netr_DsRGetDCNameInfo *info;
1598 ret = wb_getdcname(p->mem_ctx,
1601 WBC_LOOKUP_DC_IS_FLAT_NAME |
1602 WBC_LOOKUP_DC_RETURN_FLAT_NAME,
1608 flags = DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME;
1610 status = dsgetdcname(p->mem_ctx,
1611 smbd_messaging_context(),
1617 if (!NT_STATUS_IS_OK(status)) {
1618 return ntstatus_to_werror(status);
1621 *r->out.dcname = talloc_strdup(p->mem_ctx, info->dc_unc);
1623 if (!*r->out.dcname) {
1630 /****************************************************************
1631 ****************************************************************/
1633 NTSTATUS _netr_DatabaseSync2(pipes_struct *p,
1634 struct netr_DatabaseSync2 *r)
1636 p->rng_fault_state = true;
1637 return NT_STATUS_NOT_IMPLEMENTED;
1640 /****************************************************************
1641 ****************************************************************/
1643 NTSTATUS _netr_DatabaseRedo(pipes_struct *p,
1644 struct netr_DatabaseRedo *r)
1646 p->rng_fault_state = true;
1647 return NT_STATUS_NOT_IMPLEMENTED;
1650 /****************************************************************
1651 ****************************************************************/
1653 WERROR _netr_DsRGetDCName(pipes_struct *p,
1654 struct netr_DsRGetDCName *r)
1656 p->rng_fault_state = true;
1657 return WERR_NOT_SUPPORTED;
1660 /****************************************************************
1661 ****************************************************************/
1663 NTSTATUS _netr_LogonGetCapabilities(pipes_struct *p,
1664 struct netr_LogonGetCapabilities *r)
1666 return NT_STATUS_NOT_IMPLEMENTED;
1669 /****************************************************************
1670 ****************************************************************/
1672 WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p,
1673 struct netr_NETRLOGONSETSERVICEBITS *r)
1675 p->rng_fault_state = true;
1676 return WERR_NOT_SUPPORTED;
1679 /****************************************************************
1680 ****************************************************************/
1682 WERROR _netr_LogonGetTrustRid(pipes_struct *p,
1683 struct netr_LogonGetTrustRid *r)
1685 p->rng_fault_state = true;
1686 return WERR_NOT_SUPPORTED;
1689 /****************************************************************
1690 ****************************************************************/
1692 WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p,
1693 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
1695 p->rng_fault_state = true;
1696 return WERR_NOT_SUPPORTED;
1699 /****************************************************************
1700 ****************************************************************/
1702 WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p,
1703 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
1705 p->rng_fault_state = true;
1706 return WERR_NOT_SUPPORTED;
1709 /****************************************************************
1710 ****************************************************************/
1712 WERROR _netr_DsRGetDCNameEx(pipes_struct *p,
1713 struct netr_DsRGetDCNameEx *r)
1715 p->rng_fault_state = true;
1716 return WERR_NOT_SUPPORTED;
1719 /****************************************************************
1720 ****************************************************************/
1722 WERROR _netr_DsRGetSiteName(pipes_struct *p,
1723 struct netr_DsRGetSiteName *r)
1725 p->rng_fault_state = true;
1726 return WERR_NOT_SUPPORTED;
1729 /****************************************************************
1730 ****************************************************************/
1732 NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p,
1733 struct netr_LogonGetDomainInfo *r)
1735 p->rng_fault_state = true;
1736 return NT_STATUS_NOT_IMPLEMENTED;
1739 /****************************************************************
1740 ****************************************************************/
1742 WERROR _netr_ServerPasswordGet(pipes_struct *p,
1743 struct netr_ServerPasswordGet *r)
1745 p->rng_fault_state = true;
1746 return WERR_NOT_SUPPORTED;
1749 /****************************************************************
1750 ****************************************************************/
1752 WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p,
1753 struct netr_NETRLOGONSENDTOSAM *r)
1755 p->rng_fault_state = true;
1756 return WERR_NOT_SUPPORTED;
1759 /****************************************************************
1760 ****************************************************************/
1762 WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p,
1763 struct netr_DsRAddressToSitenamesW *r)
1765 p->rng_fault_state = true;
1766 return WERR_NOT_SUPPORTED;
1769 /****************************************************************
1770 ****************************************************************/
1772 WERROR _netr_DsRGetDCNameEx2(pipes_struct *p,
1773 struct netr_DsRGetDCNameEx2 *r)
1775 p->rng_fault_state = true;
1776 return WERR_NOT_SUPPORTED;
1779 /****************************************************************
1780 ****************************************************************/
1782 WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p,
1783 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
1785 p->rng_fault_state = true;
1786 return WERR_NOT_SUPPORTED;
1789 /****************************************************************
1790 ****************************************************************/
1792 WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p,
1793 struct netr_NetrEnumerateTrustedDomainsEx *r)
1795 p->rng_fault_state = true;
1796 return WERR_NOT_SUPPORTED;
1799 /****************************************************************
1800 ****************************************************************/
1802 WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p,
1803 struct netr_DsRAddressToSitenamesExW *r)
1805 p->rng_fault_state = true;
1806 return WERR_NOT_SUPPORTED;
1809 /****************************************************************
1810 ****************************************************************/
1812 WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p,
1813 struct netr_DsrGetDcSiteCoverageW *r)
1815 p->rng_fault_state = true;
1816 return WERR_NOT_SUPPORTED;
1819 /****************************************************************
1820 ****************************************************************/
1822 WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p,
1823 struct netr_DsrEnumerateDomainTrusts *r)
1825 p->rng_fault_state = true;
1826 return WERR_NOT_SUPPORTED;
1829 /****************************************************************
1830 ****************************************************************/
1832 WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p,
1833 struct netr_DsrDeregisterDNSHostRecords *r)
1835 p->rng_fault_state = true;
1836 return WERR_NOT_SUPPORTED;
1839 /****************************************************************
1840 ****************************************************************/
1842 NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p,
1843 struct netr_ServerTrustPasswordsGet *r)
1845 p->rng_fault_state = true;
1846 return NT_STATUS_NOT_IMPLEMENTED;
1849 /****************************************************************
1850 ****************************************************************/
1852 WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p,
1853 struct netr_DsRGetForestTrustInformation *r)
1855 p->rng_fault_state = true;
1856 return WERR_NOT_SUPPORTED;
1859 /****************************************************************
1860 ****************************************************************/
1862 NTSTATUS _netr_GetForestTrustInformation(pipes_struct *p,
1863 struct netr_GetForestTrustInformation *r)
1865 p->rng_fault_state = true;
1866 return NT_STATUS_NOT_IMPLEMENTED;
1869 /****************************************************************
1870 ****************************************************************/
1872 NTSTATUS _netr_ServerGetTrustInfo(pipes_struct *p,
1873 struct netr_ServerGetTrustInfo *r)
1875 p->rng_fault_state = true;
1876 return NT_STATUS_NOT_IMPLEMENTED;