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/libcli_auth.h"
29 #include "../libcli/auth/schannel_state.h"
30 #include "../libcli/auth/schannel.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;
181 switch (p->hdr_req.opnum) {
182 case NDR_NETR_LOGONCONTROL:
183 fn = "_netr_LogonControl";
185 case NDR_NETR_LOGONCONTROL2:
186 fn = "_netr_LogonControl2";
188 case NDR_NETR_LOGONCONTROL2EX:
189 fn = "_netr_LogonControl2Ex";
192 return WERR_INVALID_PARAM;
195 switch (r->in.function_code) {
196 case NETLOGON_CONTROL_TC_VERIFY:
197 case NETLOGON_CONTROL_CHANGE_PASSWORD:
198 case NETLOGON_CONTROL_REDISCOVER:
199 if (!nt_token_check_domain_rid(p->server_info->ptok, DOMAIN_GROUP_RID_ADMINS) &&
200 !nt_token_check_sid(&global_sid_Builtin_Administrators, p->server_info->ptok)) {
201 return WERR_ACCESS_DENIED;
208 tc_status = WERR_NO_SUCH_DOMAIN;
210 switch (r->in.function_code) {
211 case NETLOGON_CONTROL_QUERY:
214 case NETLOGON_CONTROL_REPLICATE:
215 case NETLOGON_CONTROL_SYNCHRONIZE:
216 case NETLOGON_CONTROL_PDC_REPLICATE:
217 case NETLOGON_CONTROL_BACKUP_CHANGE_LOG:
218 case NETLOGON_CONTROL_TRUNCATE_LOG:
219 case NETLOGON_CONTROL_BREAKPOINT:
220 return WERR_ACCESS_DENIED;
221 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
222 case NETLOGON_CONTROL_FORCE_DNS_REG:
223 case NETLOGON_CONTROL_QUERY_DNS_REG:
224 return WERR_NOT_SUPPORTED;
225 case NETLOGON_CONTROL_FIND_USER:
226 if (!r->in.data || !r->in.data->user) {
227 return WERR_NOT_SUPPORTED;
230 case NETLOGON_CONTROL_SET_DBFLAG:
232 return WERR_NOT_SUPPORTED;
235 case NETLOGON_CONTROL_TC_VERIFY:
236 if (!r->in.data || !r->in.data->domain) {
237 return WERR_NOT_SUPPORTED;
240 if (!wb_check_trust_creds(r->in.data->domain, &tc_status)) {
241 return WERR_NOT_SUPPORTED;
244 case NETLOGON_CONTROL_TC_QUERY:
245 if (!r->in.data || !r->in.data->domain) {
246 return WERR_NOT_SUPPORTED;
249 domain = r->in.data->domain;
251 if (!is_trusted_domain(domain)) {
255 if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
256 tc_status = WERR_NO_LOGON_SERVERS;
260 dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
269 case NETLOGON_CONTROL_REDISCOVER:
270 if (!r->in.data || !r->in.data->domain) {
271 return WERR_NOT_SUPPORTED;
274 domain = r->in.data->domain;
276 if (!is_trusted_domain(domain)) {
280 if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
281 tc_status = WERR_NO_LOGON_SERVERS;
285 dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
294 case NETLOGON_CONTROL_CHANGE_PASSWORD:
295 if (!r->in.data || !r->in.data->domain) {
296 return WERR_NOT_SUPPORTED;
299 if (!wb_change_trust_creds(r->in.data->domain, &tc_status)) {
300 return WERR_NOT_SUPPORTED;
305 /* no idea what this should be */
306 DEBUG(0,("%s: unimplemented function level [%d]\n",
307 fn, r->in.function_code));
308 return WERR_UNKNOWN_LEVEL;
311 /* prepare the response */
313 switch (r->in.level) {
315 info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1);
316 W_ERROR_HAVE_NO_MEMORY(info1);
318 info1->flags = flags;
319 info1->pdc_connection_status = pdc_connection_status;
321 r->out.query->info1 = info1;
324 info2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_2);
325 W_ERROR_HAVE_NO_MEMORY(info2);
327 info2->flags = flags;
328 info2->pdc_connection_status = pdc_connection_status;
329 info2->trusted_dc_name = dc_name;
330 info2->tc_connection_status = tc_status;
332 r->out.query->info2 = info2;
335 info3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_3);
336 W_ERROR_HAVE_NO_MEMORY(info3);
338 info3->flags = flags;
339 info3->logon_attempts = logon_attempts;
341 r->out.query->info3 = info3;
344 info4 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_4);
345 W_ERROR_HAVE_NO_MEMORY(info4);
347 info4->trusted_dc_name = dc_name;
348 info4->trusted_domain_name = r->in.data->domain;
350 r->out.query->info4 = info4;
353 return WERR_UNKNOWN_LEVEL;
356 if (lp_server_role() == ROLE_DOMAIN_BDC) {
363 /*************************************************************************
364 _netr_NetrEnumerateTrustedDomains
365 *************************************************************************/
367 WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
368 struct netr_NetrEnumerateTrustedDomains *r)
372 struct trustdom_info **domains;
373 uint32_t num_domains;
374 const char **trusted_domains;
377 DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
379 /* set up the Trusted Domain List response */
382 status = pdb_enum_trusteddoms(p->mem_ctx, &num_domains, &domains);
385 if (!NT_STATUS_IS_OK(status)) {
386 return ntstatus_to_werror(status);
389 trusted_domains = talloc_zero_array(p->mem_ctx, const char *, num_domains + 1);
390 if (!trusted_domains) {
394 for (i = 0; i < num_domains; i++) {
395 trusted_domains[i] = talloc_strdup(trusted_domains, domains[i]->name);
396 if (!trusted_domains[i]) {
397 TALLOC_FREE(trusted_domains);
402 if (!push_reg_multi_sz(trusted_domains, &blob, trusted_domains)) {
403 TALLOC_FREE(trusted_domains);
407 r->out.trusted_domains_blob->data = blob.data;
408 r->out.trusted_domains_blob->length = blob.length;
410 DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
415 /******************************************************************
416 gets a machine password entry. checks access rights of the host.
417 ******************************************************************/
419 static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
420 enum netr_SchannelType sec_chan_type, struct dom_sid *sid)
422 struct samu *sampass = NULL;
428 char addr[INET6_ADDRSTRLEN];
431 * Currently this code is redundent as we already have a filter
432 * by hostname list. What this code really needs to do is to
433 * get a hosts allowed/hosts denied list from the SAM database
434 * on a per user basis, and make the access decision there.
435 * I will leave this code here for now as a reminder to implement
436 * this at a later date. JRA.
439 if (!allow_access(lp_domain_hostsdeny(), lp_domain_hostsallow(),
440 client_name(get_client_fd()),
441 client_addr(get_client_fd(),addr,sizeof(addr)))) {
442 DEBUG(0,("get_md4pw: Workstation %s denied access to domain\n", mach_acct));
447 if ( !(sampass = samu_new( NULL )) ) {
448 return NT_STATUS_NO_MEMORY;
451 /* JRA. This is ok as it is only used for generating the challenge. */
453 ret = pdb_getsampwnam(sampass, mach_acct);
457 DEBUG(0,("get_md4pw: Workstation %s: no account in domain\n", mach_acct));
458 TALLOC_FREE(sampass);
459 return NT_STATUS_ACCESS_DENIED;
462 acct_ctrl = pdb_get_acct_ctrl(sampass);
463 if (acct_ctrl & ACB_DISABLED) {
464 DEBUG(0,("get_md4pw: Workstation %s: account is disabled\n", mach_acct));
465 TALLOC_FREE(sampass);
466 return NT_STATUS_ACCOUNT_DISABLED;
469 if (!(acct_ctrl & ACB_SVRTRUST) &&
470 !(acct_ctrl & ACB_WSTRUST) &&
471 !(acct_ctrl & ACB_DOMTRUST))
473 DEBUG(0,("get_md4pw: Workstation %s: account is not a trust account\n", mach_acct));
474 TALLOC_FREE(sampass);
475 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
478 switch (sec_chan_type) {
480 if (!(acct_ctrl & ACB_SVRTRUST)) {
481 DEBUG(0,("get_md4pw: Workstation %s: BDC secure channel requested "
482 "but not a server trust account\n", mach_acct));
483 TALLOC_FREE(sampass);
484 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
488 if (!(acct_ctrl & ACB_WSTRUST)) {
489 DEBUG(0,("get_md4pw: Workstation %s: WORKSTATION secure channel requested "
490 "but not a workstation trust account\n", mach_acct));
491 TALLOC_FREE(sampass);
492 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
495 case SEC_CHAN_DOMAIN:
496 if (!(acct_ctrl & ACB_DOMTRUST)) {
497 DEBUG(0,("get_md4pw: Workstation %s: DOMAIN secure channel requested "
498 "but not a interdomain trust account\n", mach_acct));
499 TALLOC_FREE(sampass);
500 return NT_STATUS_NO_TRUST_SAM_ACCOUNT;
507 if ((pass = pdb_get_nt_passwd(sampass)) == NULL) {
508 DEBUG(0,("get_md4pw: Workstation %s: account does not have a password\n", mach_acct));
509 TALLOC_FREE(sampass);
510 return NT_STATUS_LOGON_FAILURE;
513 memcpy(md4pw->hash, pass, 16);
514 dump_data(5, md4pw->hash, 16);
516 sid_copy(sid, pdb_get_user_sid(sampass));
518 TALLOC_FREE(sampass);
525 /*************************************************************************
526 _netr_ServerReqChallenge
527 *************************************************************************/
529 NTSTATUS _netr_ServerReqChallenge(pipes_struct *p,
530 struct netr_ServerReqChallenge *r)
532 struct netlogon_server_pipe_state *pipe_state =
533 talloc_get_type(p->private_data, struct netlogon_server_pipe_state);
536 DEBUG(10,("_netr_ServerReqChallenge: new challenge requested. Clearing old state.\n"));
537 talloc_free(pipe_state);
538 p->private_data = NULL;
541 pipe_state = talloc(p, struct netlogon_server_pipe_state);
542 NT_STATUS_HAVE_NO_MEMORY(pipe_state);
544 pipe_state->client_challenge = *r->in.credentials;
546 generate_random_buffer(pipe_state->server_challenge.data,
547 sizeof(pipe_state->server_challenge.data));
549 *r->out.return_credentials = pipe_state->server_challenge;
551 p->private_data = pipe_state;
556 /*************************************************************************
557 _netr_ServerAuthenticate
558 Create the initial credentials.
559 *************************************************************************/
561 NTSTATUS _netr_ServerAuthenticate(pipes_struct *p,
562 struct netr_ServerAuthenticate *r)
564 struct netr_ServerAuthenticate3 a;
565 uint32_t negotiate_flags = 0;
568 a.in.server_name = r->in.server_name;
569 a.in.account_name = r->in.account_name;
570 a.in.secure_channel_type = r->in.secure_channel_type;
571 a.in.computer_name = r->in.computer_name;
572 a.in.credentials = r->in.credentials;
573 a.in.negotiate_flags = &negotiate_flags;
575 a.out.return_credentials = r->out.return_credentials;
577 a.out.negotiate_flags = &negotiate_flags;
579 return _netr_ServerAuthenticate3(p, &a);
583 /*************************************************************************
584 _netr_ServerAuthenticate3
585 *************************************************************************/
587 NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
588 struct netr_ServerAuthenticate3 *r)
592 /* r->in.negotiate_flags is an aliased pointer to r->out.negotiate_flags,
593 * so use a copy to avoid destroying the client values. */
594 uint32_t in_neg_flags = *r->in.negotiate_flags;
597 struct samr_Password mach_pwd;
598 struct netlogon_creds_CredentialState *creds;
599 struct netlogon_server_pipe_state *pipe_state =
600 talloc_get_type(p->private_data, struct netlogon_server_pipe_state);
602 /* According to Microsoft (see bugid #6099)
603 * Windows 7 looks at the negotiate_flags
604 * returned in this structure *even if the
605 * call fails with access denied* ! So in order
606 * to allow Win7 to connect to a Samba NT style
607 * PDC we set the flags before we know if it's
612 srv_flgs = NETLOGON_NEG_ACCOUNT_LOCKOUT |
613 NETLOGON_NEG_PERSISTENT_SAMREPL |
614 NETLOGON_NEG_ARCFOUR |
615 NETLOGON_NEG_PROMOTION_COUNT |
616 NETLOGON_NEG_CHANGELOG_BDC |
617 NETLOGON_NEG_FULL_SYNC_REPL |
618 NETLOGON_NEG_MULTIPLE_SIDS |
620 NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL |
621 NETLOGON_NEG_PASSWORD_SET2;
623 /* Ensure we support strong (128-bit) keys. */
624 if (in_neg_flags & NETLOGON_NEG_STRONG_KEYS) {
625 srv_flgs |= NETLOGON_NEG_STRONG_KEYS;
628 if (lp_server_schannel() != false) {
629 srv_flgs |= NETLOGON_NEG_SCHANNEL;
632 switch (p->hdr_req.opnum) {
633 case NDR_NETR_SERVERAUTHENTICATE:
634 fn = "_netr_ServerAuthenticate";
636 case NDR_NETR_SERVERAUTHENTICATE2:
637 fn = "_netr_ServerAuthenticate2";
639 case NDR_NETR_SERVERAUTHENTICATE3:
640 fn = "_netr_ServerAuthenticate3";
643 return NT_STATUS_INTERNAL_ERROR;
646 /* We use this as the key to store the creds: */
647 /* r->in.computer_name */
650 DEBUG(0,("%s: no challenge sent to client %s\n", fn,
651 r->in.computer_name));
652 status = NT_STATUS_ACCESS_DENIED;
656 if ( (lp_server_schannel() == true) &&
657 ((in_neg_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
659 /* schannel must be used, but client did not offer it. */
660 DEBUG(0,("%s: schannel required but client failed "
661 "to offer it. Client was %s\n",
662 fn, r->in.account_name));
663 status = NT_STATUS_ACCESS_DENIED;
667 status = get_md4pw(&mach_pwd,
669 r->in.secure_channel_type,
671 if (!NT_STATUS_IS_OK(status)) {
672 DEBUG(0,("%s: failed to get machine password for "
674 fn, r->in.account_name, nt_errstr(status) ));
675 /* always return NT_STATUS_ACCESS_DENIED */
676 status = NT_STATUS_ACCESS_DENIED;
680 /* From the client / server challenges and md4 password, generate sess key */
681 /* Check client credentials are valid. */
682 creds = netlogon_creds_server_init(p->mem_ctx,
685 r->in.secure_channel_type,
686 &pipe_state->client_challenge,
687 &pipe_state->server_challenge,
690 r->out.return_credentials,
691 *r->in.negotiate_flags);
693 DEBUG(0,("%s: netlogon_creds_server_check failed. Rejecting auth "
694 "request from client %s machine account %s\n",
695 fn, r->in.computer_name,
696 r->in.account_name));
697 status = NT_STATUS_ACCESS_DENIED;
701 creds->sid = sid_dup_talloc(creds, &sid);
703 status = NT_STATUS_NO_MEMORY;
707 /* Store off the state so we can continue after client disconnect. */
709 status = schannel_store_session_key(p->mem_ctx, creds);
712 if (!NT_STATUS_IS_OK(status)) {
716 sid_peek_rid(&sid, r->out.rid);
718 status = NT_STATUS_OK;
722 *r->out.negotiate_flags = srv_flgs;
726 /*************************************************************************
727 _netr_ServerAuthenticate2
728 *************************************************************************/
730 NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p,
731 struct netr_ServerAuthenticate2 *r)
733 struct netr_ServerAuthenticate3 a;
736 a.in.server_name = r->in.server_name;
737 a.in.account_name = r->in.account_name;
738 a.in.secure_channel_type = r->in.secure_channel_type;
739 a.in.computer_name = r->in.computer_name;
740 a.in.credentials = r->in.credentials;
741 a.in.negotiate_flags = r->in.negotiate_flags;
743 a.out.return_credentials = r->out.return_credentials;
745 a.out.negotiate_flags = r->out.negotiate_flags;
747 return _netr_ServerAuthenticate3(p, &a);
750 /*************************************************************************
751 *************************************************************************/
753 static NTSTATUS netr_creds_server_step_check(pipes_struct *p,
755 const char *computer_name,
756 struct netr_Authenticator *received_authenticator,
757 struct netr_Authenticator *return_authenticator,
758 struct netlogon_creds_CredentialState **creds_out)
761 struct tdb_context *tdb;
762 bool schannel_global_required = (lp_server_schannel() == true) ? true:false;
763 bool schannel_in_use = (p->auth.auth_type == PIPE_AUTH_TYPE_SCHANNEL) ? true:false; /* &&
764 (p->auth.auth_level == DCERPC_AUTH_LEVEL_INTEGRITY ||
765 p->auth.auth_level == DCERPC_AUTH_LEVEL_PRIVACY); */
767 tdb = open_schannel_session_store(mem_ctx);
769 return NT_STATUS_ACCESS_DENIED;
772 status = schannel_creds_server_step_check_tdb(tdb, mem_ctx,
774 schannel_global_required,
776 received_authenticator,
777 return_authenticator,
784 /*************************************************************************
785 *************************************************************************/
787 static NTSTATUS netr_find_machine_account(TALLOC_CTX *mem_ctx,
788 const char *account_name,
789 struct samu **sampassp)
791 struct samu *sampass;
795 sampass = samu_new(mem_ctx);
797 return NT_STATUS_NO_MEMORY;
801 ret = pdb_getsampwnam(sampass, account_name);
805 TALLOC_FREE(sampass);
806 return NT_STATUS_ACCESS_DENIED;
809 /* Ensure the account exists and is a machine account. */
811 acct_ctrl = pdb_get_acct_ctrl(sampass);
813 if (!(acct_ctrl & ACB_WSTRUST ||
814 acct_ctrl & ACB_SVRTRUST ||
815 acct_ctrl & ACB_DOMTRUST)) {
816 TALLOC_FREE(sampass);
817 return NT_STATUS_NO_SUCH_USER;
820 if (acct_ctrl & ACB_DISABLED) {
821 TALLOC_FREE(sampass);
822 return NT_STATUS_ACCOUNT_DISABLED;
830 /*************************************************************************
831 *************************************************************************/
833 static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
834 struct samu *sampass,
835 DATA_BLOB *plaintext_blob,
836 struct samr_Password *nt_hash,
837 struct samr_Password *lm_hash)
841 const char *plaintext = NULL;
842 size_t plaintext_len;
843 struct samr_Password nt_hash_local;
846 return NT_STATUS_INVALID_PARAMETER;
849 if (plaintext_blob) {
850 if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
851 plaintext_blob->data, plaintext_blob->length,
852 &plaintext, &plaintext_len, false))
855 mdfour(nt_hash_local.hash, plaintext_blob->data, plaintext_blob->length);
856 nt_hash = &nt_hash_local;
861 if (!pdb_set_plaintext_passwd(sampass, plaintext)) {
862 return NT_STATUS_ACCESS_DENIED;
869 old_pw = pdb_get_nt_passwd(sampass);
871 if (old_pw && memcmp(nt_hash->hash, old_pw, 16) == 0) {
872 /* Avoid backend modificiations and other fun if the
873 client changed the password to the *same thing* */
875 /* LM password should be NULL for machines */
876 if (!pdb_set_lanman_passwd(sampass, NULL, PDB_CHANGED)) {
877 return NT_STATUS_NO_MEMORY;
879 if (!pdb_set_nt_passwd(sampass, nt_hash->hash, PDB_CHANGED)) {
880 return NT_STATUS_NO_MEMORY;
883 if (!pdb_set_pass_last_set_time(sampass, time(NULL), PDB_CHANGED)) {
884 /* Not quite sure what this one qualifies as, but this will do */
885 return NT_STATUS_UNSUCCESSFUL;
892 status = pdb_update_sam_account(sampass);
898 /*************************************************************************
899 _netr_ServerPasswordSet
900 *************************************************************************/
902 NTSTATUS _netr_ServerPasswordSet(pipes_struct *p,
903 struct netr_ServerPasswordSet *r)
905 NTSTATUS status = NT_STATUS_OK;
906 struct samu *sampass=NULL;
908 struct netlogon_creds_CredentialState *creds;
910 DEBUG(5,("_netr_ServerPasswordSet: %d\n", __LINE__));
913 status = netr_creds_server_step_check(p, p->mem_ctx,
916 r->out.return_authenticator,
920 if (!NT_STATUS_IS_OK(status)) {
921 DEBUG(2,("_netr_ServerPasswordSet: netlogon_creds_server_step failed. Rejecting auth "
922 "request from client %s machine account %s\n",
923 r->in.computer_name, creds->computer_name));
928 DEBUG(3,("_netr_ServerPasswordSet: Server Password Set by remote machine:[%s] on account [%s]\n",
929 r->in.computer_name, creds->computer_name));
931 netlogon_creds_des_decrypt(creds, r->in.new_password);
933 DEBUG(100,("_netr_ServerPasswordSet: new given value was :\n"));
934 for(i = 0; i < sizeof(r->in.new_password->hash); i++)
935 DEBUG(100,("%02X ", r->in.new_password->hash[i]));
938 status = netr_find_machine_account(p->mem_ctx,
941 if (!NT_STATUS_IS_OK(status)) {
945 status = netr_set_machine_account_password(sampass,
950 TALLOC_FREE(sampass);
954 /****************************************************************
955 _netr_ServerPasswordSet2
956 ****************************************************************/
958 NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
959 struct netr_ServerPasswordSet2 *r)
962 struct netlogon_creds_CredentialState *creds;
963 struct samu *sampass;
965 struct samr_CryptPassword password_buf;
966 struct samr_Password nt_hash;
969 status = netr_creds_server_step_check(p, p->mem_ctx,
972 r->out.return_authenticator,
976 if (!NT_STATUS_IS_OK(status)) {
977 DEBUG(2,("_netr_ServerPasswordSet2: netlogon_creds_server_step "
978 "failed. Rejecting auth request from client %s machine account %s\n",
979 r->in.computer_name, creds->computer_name));
984 memcpy(password_buf.data, r->in.new_password->data, 512);
985 SIVAL(password_buf.data, 512, r->in.new_password->length);
986 netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
988 if (!extract_pw_from_buffer(p->mem_ctx, password_buf.data, &plaintext)) {
989 return NT_STATUS_WRONG_PASSWORD;
992 mdfour(nt_hash.hash, plaintext.data, plaintext.length);
994 status = netr_find_machine_account(p->mem_ctx,
997 if (!NT_STATUS_IS_OK(status)) {
1001 status = netr_set_machine_account_password(sampass,
1006 TALLOC_FREE(sampass);
1010 /*************************************************************************
1011 _netr_LogonSamLogoff
1012 *************************************************************************/
1014 NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
1015 struct netr_LogonSamLogoff *r)
1018 struct netlogon_creds_CredentialState *creds;
1021 status = netr_creds_server_step_check(p, p->mem_ctx,
1022 r->in.computer_name,
1024 r->out.return_authenticator,
1031 /*************************************************************************
1032 _netr_LogonSamLogon_base
1033 *************************************************************************/
1035 static NTSTATUS _netr_LogonSamLogon_base(pipes_struct *p,
1036 struct netr_LogonSamLogonEx *r,
1037 struct netlogon_creds_CredentialState *creds)
1039 NTSTATUS status = NT_STATUS_OK;
1040 union netr_LogonLevel *logon = r->in.logon;
1041 const char *nt_username, *nt_domain, *nt_workstation;
1042 auth_usersupplied_info *user_info = NULL;
1043 auth_serversupplied_info *server_info = NULL;
1044 struct auth_context *auth_context = NULL;
1045 uint8_t pipe_session_key[16];
1046 bool process_creds = true;
1049 switch (p->hdr_req.opnum) {
1050 case NDR_NETR_LOGONSAMLOGON:
1051 process_creds = true;
1052 fn = "_netr_LogonSamLogon";
1054 case NDR_NETR_LOGONSAMLOGONWITHFLAGS:
1055 process_creds = true;
1056 fn = "_netr_LogonSamLogonWithFlags";
1058 case NDR_NETR_LOGONSAMLOGONEX:
1059 process_creds = false;
1060 fn = "_netr_LogonSamLogonEx";
1063 return NT_STATUS_INTERNAL_ERROR;
1066 *r->out.authoritative = true; /* authoritative response */
1068 switch (r->in.validation_level) {
1070 r->out.validation->sam2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo2);
1071 if (!r->out.validation->sam2) {
1072 return NT_STATUS_NO_MEMORY;
1076 r->out.validation->sam3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo3);
1077 if (!r->out.validation->sam3) {
1078 return NT_STATUS_NO_MEMORY;
1082 r->out.validation->sam6 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo6);
1083 if (!r->out.validation->sam6) {
1084 return NT_STATUS_NO_MEMORY;
1088 DEBUG(0,("%s: bad validation_level value %d.\n",
1089 fn, (int)r->in.validation_level));
1090 return NT_STATUS_INVALID_INFO_CLASS;
1093 switch (r->in.logon_level) {
1094 case NetlogonInteractiveInformation:
1095 case NetlogonServiceInformation:
1096 case NetlogonInteractiveTransitiveInformation:
1097 case NetlogonServiceTransitiveInformation:
1098 nt_username = logon->password->identity_info.account_name.string;
1099 nt_domain = logon->password->identity_info.domain_name.string;
1100 nt_workstation = logon->password->identity_info.workstation.string;
1102 DEBUG(3,("SAM Logon (Interactive). Domain:[%s]. ", lp_workgroup()));
1104 case NetlogonNetworkInformation:
1105 case NetlogonNetworkTransitiveInformation:
1106 nt_username = logon->network->identity_info.account_name.string;
1107 nt_domain = logon->network->identity_info.domain_name.string;
1108 nt_workstation = logon->network->identity_info.workstation.string;
1110 DEBUG(3,("SAM Logon (Network). Domain:[%s]. ", lp_workgroup()));
1113 DEBUG(2,("SAM Logon: unsupported switch value\n"));
1114 return NT_STATUS_INVALID_INFO_CLASS;
1117 DEBUG(3,("User:[%s@%s] Requested Domain:[%s]\n", nt_username, nt_workstation, nt_domain));
1118 fstrcpy(current_user_info.smb_name, nt_username);
1119 sub_set_smb_name(nt_username);
1121 DEBUG(5,("Attempting validation level %d for unmapped username %s.\n",
1122 r->in.validation_level, nt_username));
1124 status = NT_STATUS_OK;
1126 switch (r->in.logon_level) {
1127 case NetlogonNetworkInformation:
1128 case NetlogonNetworkTransitiveInformation:
1130 const char *wksname = nt_workstation;
1132 status = make_auth_context_fixed(&auth_context,
1133 logon->network->challenge);
1134 if (!NT_STATUS_IS_OK(status)) {
1138 /* For a network logon, the workstation name comes in with two
1139 * backslashes in the front. Strip them if they are there. */
1141 if (*wksname == '\\') wksname++;
1142 if (*wksname == '\\') wksname++;
1144 /* Standard challenge/response authenticaion */
1145 if (!make_user_info_netlogon_network(&user_info,
1146 nt_username, nt_domain,
1148 logon->network->identity_info.parameter_control,
1149 logon->network->lm.data,
1150 logon->network->lm.length,
1151 logon->network->nt.data,
1152 logon->network->nt.length)) {
1153 status = NT_STATUS_NO_MEMORY;
1157 case NetlogonInteractiveInformation:
1158 case NetlogonServiceInformation:
1159 case NetlogonInteractiveTransitiveInformation:
1160 case NetlogonServiceTransitiveInformation:
1162 /* 'Interactive' authentication, supplies the password in its
1163 MD4 form, encrypted with the session key. We will convert
1164 this to challenge/response for the auth subsystem to chew
1169 if (!NT_STATUS_IS_OK(status = make_auth_context_subsystem(&auth_context))) {
1173 auth_context->get_ntlm_challenge(auth_context, chal);
1175 if (!make_user_info_netlogon_interactive(&user_info,
1176 nt_username, nt_domain,
1178 logon->password->identity_info.parameter_control,
1180 logon->password->lmpassword.hash,
1181 logon->password->ntpassword.hash,
1182 creds->session_key)) {
1183 status = NT_STATUS_NO_MEMORY;
1188 DEBUG(2,("SAM Logon: unsupported switch value\n"));
1189 return NT_STATUS_INVALID_INFO_CLASS;
1192 if ( NT_STATUS_IS_OK(status) ) {
1193 status = auth_context->check_ntlm_password(auth_context,
1194 user_info, &server_info);
1197 (auth_context->free)(&auth_context);
1198 free_user_info(&user_info);
1200 DEBUG(5,("%s: check_password returned status %s\n",
1201 fn, nt_errstr(status)));
1203 /* Check account and password */
1205 if (!NT_STATUS_IS_OK(status)) {
1206 /* If we don't know what this domain is, we need to
1207 indicate that we are not authoritative. This
1208 allows the client to decide if it needs to try
1209 a local user. Fix by jpjanosi@us.ibm.com, #2976 */
1210 if ( NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)
1211 && !strequal(nt_domain, get_global_sam_name())
1212 && !is_trusted_domain(nt_domain) )
1213 *r->out.authoritative = false; /* We are not authoritative */
1215 TALLOC_FREE(server_info);
1219 if (server_info->guest) {
1220 /* We don't like guest domain logons... */
1221 DEBUG(5,("%s: Attempted domain logon as GUEST "
1223 TALLOC_FREE(server_info);
1224 return NT_STATUS_LOGON_FAILURE;
1227 /* This is the point at which, if the login was successful, that
1228 the SAM Local Security Authority should record that the user is
1229 logged in to the domain. */
1231 if (process_creds) {
1232 /* Get the pipe session key from the creds. */
1233 memcpy(pipe_session_key, creds->session_key, 16);
1235 /* Get the pipe session key from the schannel. */
1236 if ((p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL)
1237 || (p->auth.a_u.schannel_auth == NULL)) {
1238 return NT_STATUS_INVALID_HANDLE;
1240 memcpy(pipe_session_key, p->auth.a_u.schannel_auth->creds->session_key, 16);
1243 switch (r->in.validation_level) {
1245 status = serverinfo_to_SamInfo2(server_info, pipe_session_key, 16,
1246 r->out.validation->sam2);
1249 status = serverinfo_to_SamInfo3(server_info, pipe_session_key, 16,
1250 r->out.validation->sam3);
1253 status = serverinfo_to_SamInfo6(server_info, pipe_session_key, 16,
1254 r->out.validation->sam6);
1258 TALLOC_FREE(server_info);
1263 /****************************************************************
1264 _netr_LogonSamLogonWithFlags
1265 ****************************************************************/
1267 NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p,
1268 struct netr_LogonSamLogonWithFlags *r)
1271 struct netlogon_creds_CredentialState *creds;
1272 struct netr_LogonSamLogonEx r2;
1273 struct netr_Authenticator return_authenticator;
1276 status = netr_creds_server_step_check(p, p->mem_ctx,
1277 r->in.computer_name,
1279 &return_authenticator,
1282 if (!NT_STATUS_IS_OK(status)) {
1286 r2.in.server_name = r->in.server_name;
1287 r2.in.computer_name = r->in.computer_name;
1288 r2.in.logon_level = r->in.logon_level;
1289 r2.in.logon = r->in.logon;
1290 r2.in.validation_level = r->in.validation_level;
1291 r2.in.flags = r->in.flags;
1292 r2.out.validation = r->out.validation;
1293 r2.out.authoritative = r->out.authoritative;
1294 r2.out.flags = r->out.flags;
1296 status = _netr_LogonSamLogon_base(p, &r2, creds);
1298 *r->out.return_authenticator = return_authenticator;
1303 /*************************************************************************
1305 *************************************************************************/
1307 NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
1308 struct netr_LogonSamLogon *r)
1311 struct netr_LogonSamLogonWithFlags r2;
1314 r2.in.server_name = r->in.server_name;
1315 r2.in.computer_name = r->in.computer_name;
1316 r2.in.credential = r->in.credential;
1317 r2.in.logon_level = r->in.logon_level;
1318 r2.in.logon = r->in.logon;
1319 r2.in.validation_level = r->in.validation_level;
1320 r2.in.return_authenticator = r->in.return_authenticator;
1321 r2.in.flags = &flags;
1322 r2.out.validation = r->out.validation;
1323 r2.out.authoritative = r->out.authoritative;
1324 r2.out.flags = &flags;
1325 r2.out.return_authenticator = r->out.return_authenticator;
1327 status = _netr_LogonSamLogonWithFlags(p, &r2);
1332 /*************************************************************************
1333 _netr_LogonSamLogonEx
1334 - no credential chaining. Map into net sam logon.
1335 *************************************************************************/
1337 NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p,
1338 struct netr_LogonSamLogonEx *r)
1341 struct netlogon_creds_CredentialState *creds = NULL;
1344 status = schannel_fetch_session_key(p->mem_ctx, r->in.computer_name, &creds);
1346 if (!NT_STATUS_IS_OK(status)) {
1350 /* Only allow this if the pipe is protected. */
1351 if (p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
1352 DEBUG(0,("_netr_LogonSamLogonEx: client %s not using schannel for netlogon\n",
1353 get_remote_machine_name() ));
1354 return NT_STATUS_INVALID_PARAMETER;
1357 status = _netr_LogonSamLogon_base(p, r, creds);
1363 /*************************************************************************
1365 *************************************************************************/
1366 #if 0 /* JERRY -- not correct */
1367 NTSTATUS _ds_enum_dom_trusts(pipes_struct *p, DS_Q_ENUM_DOM_TRUSTS *q_u,
1368 DS_R_ENUM_DOM_TRUSTS *r_u)
1370 NTSTATUS status = NT_STATUS_OK;
1372 /* TODO: According to MSDN, the can only be executed against a
1373 DC or domain member running Windows 2000 or later. Need
1374 to test against a standalone 2k server and see what it
1375 does. A windows 2000 DC includes its own domain in the
1383 /****************************************************************
1384 ****************************************************************/
1386 WERROR _netr_LogonUasLogon(pipes_struct *p,
1387 struct netr_LogonUasLogon *r)
1389 p->rng_fault_state = true;
1390 return WERR_NOT_SUPPORTED;
1393 /****************************************************************
1394 ****************************************************************/
1396 WERROR _netr_LogonUasLogoff(pipes_struct *p,
1397 struct netr_LogonUasLogoff *r)
1399 p->rng_fault_state = true;
1400 return WERR_NOT_SUPPORTED;
1403 /****************************************************************
1404 ****************************************************************/
1406 NTSTATUS _netr_DatabaseDeltas(pipes_struct *p,
1407 struct netr_DatabaseDeltas *r)
1409 p->rng_fault_state = true;
1410 return NT_STATUS_NOT_IMPLEMENTED;
1413 /****************************************************************
1414 ****************************************************************/
1416 NTSTATUS _netr_DatabaseSync(pipes_struct *p,
1417 struct netr_DatabaseSync *r)
1419 p->rng_fault_state = true;
1420 return NT_STATUS_NOT_IMPLEMENTED;
1423 /****************************************************************
1424 ****************************************************************/
1426 NTSTATUS _netr_AccountDeltas(pipes_struct *p,
1427 struct netr_AccountDeltas *r)
1429 p->rng_fault_state = true;
1430 return NT_STATUS_NOT_IMPLEMENTED;
1433 /****************************************************************
1434 ****************************************************************/
1436 NTSTATUS _netr_AccountSync(pipes_struct *p,
1437 struct netr_AccountSync *r)
1439 p->rng_fault_state = true;
1440 return NT_STATUS_NOT_IMPLEMENTED;
1443 /****************************************************************
1444 ****************************************************************/
1446 static bool wb_getdcname(TALLOC_CTX *mem_ctx,
1448 const char **dcname,
1453 struct wbcDomainControllerInfo *dc_info = NULL;
1455 result = wbcLookupDomainController(domain,
1459 case WBC_ERR_SUCCESS:
1461 case WBC_ERR_WINBIND_NOT_AVAILABLE:
1463 case WBC_ERR_DOMAIN_NOT_FOUND:
1464 *werr = WERR_NO_SUCH_DOMAIN;
1467 *werr = WERR_DOMAIN_CONTROLLER_NOT_FOUND;
1471 *dcname = talloc_strdup(mem_ctx, dc_info->dc_name);
1472 wbcFreeMemory(dc_info);
1483 /****************************************************************
1485 ****************************************************************/
1487 WERROR _netr_GetDcName(pipes_struct *p,
1488 struct netr_GetDcName *r)
1493 struct netr_DsRGetDCNameInfo *info;
1496 ret = wb_getdcname(p->mem_ctx,
1499 WBC_LOOKUP_DC_IS_FLAT_NAME |
1500 WBC_LOOKUP_DC_RETURN_FLAT_NAME |
1501 WBC_LOOKUP_DC_PDC_REQUIRED,
1507 flags = DS_PDC_REQUIRED | DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME;
1509 status = dsgetdcname(p->mem_ctx,
1510 smbd_messaging_context(),
1516 if (!NT_STATUS_IS_OK(status)) {
1517 return ntstatus_to_werror(status);
1520 *r->out.dcname = talloc_strdup(p->mem_ctx, info->dc_unc);
1522 if (!*r->out.dcname) {
1529 /****************************************************************
1531 ****************************************************************/
1533 WERROR _netr_GetAnyDCName(pipes_struct *p,
1534 struct netr_GetAnyDCName *r)
1539 struct netr_DsRGetDCNameInfo *info;
1542 ret = wb_getdcname(p->mem_ctx,
1545 WBC_LOOKUP_DC_IS_FLAT_NAME |
1546 WBC_LOOKUP_DC_RETURN_FLAT_NAME,
1552 flags = DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME;
1554 status = dsgetdcname(p->mem_ctx,
1555 smbd_messaging_context(),
1561 if (!NT_STATUS_IS_OK(status)) {
1562 return ntstatus_to_werror(status);
1565 *r->out.dcname = talloc_strdup(p->mem_ctx, info->dc_unc);
1567 if (!*r->out.dcname) {
1574 /****************************************************************
1575 ****************************************************************/
1577 NTSTATUS _netr_DatabaseSync2(pipes_struct *p,
1578 struct netr_DatabaseSync2 *r)
1580 p->rng_fault_state = true;
1581 return NT_STATUS_NOT_IMPLEMENTED;
1584 /****************************************************************
1585 ****************************************************************/
1587 NTSTATUS _netr_DatabaseRedo(pipes_struct *p,
1588 struct netr_DatabaseRedo *r)
1590 p->rng_fault_state = true;
1591 return NT_STATUS_NOT_IMPLEMENTED;
1594 /****************************************************************
1595 ****************************************************************/
1597 WERROR _netr_DsRGetDCName(pipes_struct *p,
1598 struct netr_DsRGetDCName *r)
1600 p->rng_fault_state = true;
1601 return WERR_NOT_SUPPORTED;
1604 /****************************************************************
1605 ****************************************************************/
1607 NTSTATUS _netr_LogonGetCapabilities(pipes_struct *p,
1608 struct netr_LogonGetCapabilities *r)
1610 return NT_STATUS_NOT_IMPLEMENTED;
1613 /****************************************************************
1614 ****************************************************************/
1616 WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p,
1617 struct netr_NETRLOGONSETSERVICEBITS *r)
1619 p->rng_fault_state = true;
1620 return WERR_NOT_SUPPORTED;
1623 /****************************************************************
1624 ****************************************************************/
1626 WERROR _netr_LogonGetTrustRid(pipes_struct *p,
1627 struct netr_LogonGetTrustRid *r)
1629 p->rng_fault_state = true;
1630 return WERR_NOT_SUPPORTED;
1633 /****************************************************************
1634 ****************************************************************/
1636 WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p,
1637 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
1639 p->rng_fault_state = true;
1640 return WERR_NOT_SUPPORTED;
1643 /****************************************************************
1644 ****************************************************************/
1646 WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p,
1647 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
1649 p->rng_fault_state = true;
1650 return WERR_NOT_SUPPORTED;
1653 /****************************************************************
1654 ****************************************************************/
1656 WERROR _netr_DsRGetDCNameEx(pipes_struct *p,
1657 struct netr_DsRGetDCNameEx *r)
1659 p->rng_fault_state = true;
1660 return WERR_NOT_SUPPORTED;
1663 /****************************************************************
1664 ****************************************************************/
1666 WERROR _netr_DsRGetSiteName(pipes_struct *p,
1667 struct netr_DsRGetSiteName *r)
1669 p->rng_fault_state = true;
1670 return WERR_NOT_SUPPORTED;
1673 /****************************************************************
1674 ****************************************************************/
1676 NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p,
1677 struct netr_LogonGetDomainInfo *r)
1679 p->rng_fault_state = true;
1680 return NT_STATUS_NOT_IMPLEMENTED;
1683 /****************************************************************
1684 ****************************************************************/
1686 WERROR _netr_ServerPasswordGet(pipes_struct *p,
1687 struct netr_ServerPasswordGet *r)
1689 p->rng_fault_state = true;
1690 return WERR_NOT_SUPPORTED;
1693 /****************************************************************
1694 ****************************************************************/
1696 WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p,
1697 struct netr_NETRLOGONSENDTOSAM *r)
1699 p->rng_fault_state = true;
1700 return WERR_NOT_SUPPORTED;
1703 /****************************************************************
1704 ****************************************************************/
1706 WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p,
1707 struct netr_DsRAddressToSitenamesW *r)
1709 p->rng_fault_state = true;
1710 return WERR_NOT_SUPPORTED;
1713 /****************************************************************
1714 ****************************************************************/
1716 WERROR _netr_DsRGetDCNameEx2(pipes_struct *p,
1717 struct netr_DsRGetDCNameEx2 *r)
1719 p->rng_fault_state = true;
1720 return WERR_NOT_SUPPORTED;
1723 /****************************************************************
1724 ****************************************************************/
1726 WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p,
1727 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
1729 p->rng_fault_state = true;
1730 return WERR_NOT_SUPPORTED;
1733 /****************************************************************
1734 ****************************************************************/
1736 WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p,
1737 struct netr_NetrEnumerateTrustedDomainsEx *r)
1739 p->rng_fault_state = true;
1740 return WERR_NOT_SUPPORTED;
1743 /****************************************************************
1744 ****************************************************************/
1746 WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p,
1747 struct netr_DsRAddressToSitenamesExW *r)
1749 p->rng_fault_state = true;
1750 return WERR_NOT_SUPPORTED;
1753 /****************************************************************
1754 ****************************************************************/
1756 WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p,
1757 struct netr_DsrGetDcSiteCoverageW *r)
1759 p->rng_fault_state = true;
1760 return WERR_NOT_SUPPORTED;
1763 /****************************************************************
1764 ****************************************************************/
1766 WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p,
1767 struct netr_DsrEnumerateDomainTrusts *r)
1769 p->rng_fault_state = true;
1770 return WERR_NOT_SUPPORTED;
1773 /****************************************************************
1774 ****************************************************************/
1776 WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p,
1777 struct netr_DsrDeregisterDNSHostRecords *r)
1779 p->rng_fault_state = true;
1780 return WERR_NOT_SUPPORTED;
1783 /****************************************************************
1784 ****************************************************************/
1786 NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p,
1787 struct netr_ServerTrustPasswordsGet *r)
1789 p->rng_fault_state = true;
1790 return NT_STATUS_NOT_IMPLEMENTED;
1793 /****************************************************************
1794 ****************************************************************/
1796 WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p,
1797 struct netr_DsRGetForestTrustInformation *r)
1799 p->rng_fault_state = true;
1800 return WERR_NOT_SUPPORTED;
1803 /****************************************************************
1804 ****************************************************************/
1806 WERROR _netr_GetForestTrustInformation(pipes_struct *p,
1807 struct netr_GetForestTrustInformation *r)
1809 p->rng_fault_state = true;
1810 return WERR_NOT_SUPPORTED;
1813 /****************************************************************
1814 ****************************************************************/
1816 NTSTATUS _netr_ServerGetTrustInfo(pipes_struct *p,
1817 struct netr_ServerGetTrustInfo *r)
1819 p->rng_fault_state = true;
1820 return NT_STATUS_NOT_IMPLEMENTED;