• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/samba-3.0.13/source/nsswitch/

Lines Matching refs:domain

25    We need to manage connections to domain controllers without having to
29 - make connections to domain controllers and cache them
31 - centralise the policy on connection timeouts, domain controller
70 fstring domain;
79 static NTSTATUS get_connection_from_cache(struct winbindd_domain *domain,
88 Caller to free() result in domain, username, password
91 static void cm_get_ipc_userpass(char **username, char **domain, char **password)
94 *domain = secrets_fetch(SECRETS_AUTH_DOMAIN, NULL);
99 if (!*domain || !**domain)
100 *domain = smb_xstrdup(lp_workgroup());
106 *domain, *username));
111 *domain = smb_xstrdup("");
119 static NTSTATUS setup_schannel( struct cli_state *cli, const char *domain )
127 /* use the domain trust password if we're on a DC
128 and this is not our domain */
130 if ( IS_DC && !strequal(domain, lp_workgroup()) ) {
133 if ( !secrets_fetch_trusted_domain_password( domain,
157 static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain,
171 if (domain->primary)
184 result = cli_netlogon_getdcname(conn->cli, mem_ctx, domain->name, tmp);
209 static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
379 if (domain->primary || IS_DC) {
380 NTSTATUS status = setup_schannel( *cli, domain->name );
387 /* set the domain if empty; needed for schannel connections */
388 if ( !*(*cli)->domain )
389 fstrcpy( (*cli)->domain, domain->name );
417 add_failed_connection_entry(domain->name, controller, result);
511 Retreive a list of IP address for domain controllers. Fill in
515 static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain,
526 is_our_domain = strequal(domain->name, lp_workgroup());
529 && get_dc_name_via_netlogon(domain, dcname, &ip)
530 && add_one_dc_unique(mem_ctx, domain->name, dcname, ip, dcs, num_dcs) )
536 && must_use_pdc(domain->name)
537 && get_pdc_ip(domain->name, &ip))
539 if (add_one_dc_unique(mem_ctx, domain->name, inet_ntoa(ip), ip, dcs, num_dcs))
545 get_sorted_dc_list(domain->name, &ip_list, &iplist_size, False);
550 get_sorted_dc_list(domain->alt_name, &ip_list, &iplist_size, True);
557 add_one_dc_unique(mem_ctx, domain->name, inet_ntoa(ip_list[i].ip),
567 const struct winbindd_domain *domain,
581 if (!get_dcs(mem_ctx, domain, &dcs, &num_dcs) || (num_dcs == 0))
603 add_failed_connection_entry(domain->name,
615 dcip_to_name( domain->name, domain->alt_name, addr->sin_addr, dcname );
622 static NTSTATUS cm_open_connection(struct winbindd_domain *domain,
641 if ((strlen(domain->dcname) > 0) &&
642 NT_STATUS_IS_OK(check_negative_conn_cache(domain->name,
643 domain->dcname))) {
645 if (!open_any_socket_out(&domain->dcaddr, 1, 10000,
652 !find_new_dc(mem_ctx, domain, domain->dcname,
653 &domain->dcaddr, &fd))
658 result = cm_prepare_connection(domain, fd, pipe_index,
659 domain->dcname,
663 fstrcpy(new_conn->domain, domain->name);
683 NTSTATUS cm_fresh_connection(struct winbindd_domain *domain, const int pipe_index,
689 result = cm_open_connection( domain, pipe_index, &conn );
707 DEBUG(3, ("Connection to %s for domain %s (pipe %s) has NULL conn->cli!\n",
708 conn->controller, conn->domain, conn->pipe_name));
713 DEBUG(3, ("Connection to %s for domain %s (pipe %s) was never initialised!\n",
714 conn->controller, conn->domain, conn->pipe_name));
719 DEBUG(3, ("Connection to %s for domain %s (pipe %s) has died or was never started (fd == -1)\n",
720 conn->controller, conn->domain, conn->pipe_name));
730 static void find_cm_connection(struct winbindd_domain *domain, const char *pipe_name,
736 if (strequal(conn->domain, domain->name) &&
759 static NTSTATUS new_cm_connection(struct winbindd_domain *domain, const char *pipe_name,
770 if (!NT_STATUS_IS_OK(result = cm_open_connection(domain, get_pipe_index(pipe_name), conn))) {
772 domain->name, pipe_name, nt_errstr(result)));
784 static NTSTATUS get_connection_from_cache(struct winbindd_domain *domain, const char *pipe_name,
787 find_cm_connection(domain, pipe_name, conn_out);
792 return new_cm_connection(domain, pipe_name, conn_out);
802 void set_dc_type_and_flags( struct winbindd_domain *domain )
812 domain->native_mode = False;
813 domain->active_directory = False;
815 if (domain->internal) {
816 domain->initialized = True;
820 if ( !NT_STATUS_IS_OK(result = cm_open_connection(domain, PI_LSARPC_DS, &conn)) ) {
822 domain->name, nt_errstr(result)));
823 domain->initialized = True;
836 domain->native_mode = True;
847 mem_ctx = talloc_init("set_dc_type_and_flags on domain %s\n", domain->name);
869 fstrcpy(domain->name, domain_name);
872 fstrcpy(domain->alt_name, dns_name);
875 sid_copy(&domain->sid, dom_sid);
877 domain->active_directory = True;
893 fstrcpy(domain->name, domain_name);
896 sid_copy(&domain->sid, dom_sid);
903 DEBUG(3,("add_trusted_domain: %s is an %s %s domain\n", domain->name,
904 domain->active_directory ? "ADS" : "NT4",
905 domain->native_mode ? "native mode" :
906 ((domain->active_directory && !domain->native_mode) ? "mixed mode" : "")));
909 on reestablishing the domain list --jerry */
916 domain->initialized = True;
923 /* Return a LSA policy handle on a domain */
925 NTSTATUS cm_get_lsa_handle(struct winbindd_domain *domain, CLI_POLICY_HND **return_hnd)
934 if (!NT_STATUS_IS_OK(result = get_connection_from_cache(domain, PIPE_LSARPC, &conn)))
953 if (!NT_STATUS_IS_OK(result = get_connection_from_cache(domain, PIPE_LSARPC, &conn)))
976 /* Return a SAM policy handle on a domain */
978 NTSTATUS cm_get_sam_handle(struct winbindd_domain *domain, CLI_POLICY_HND **return_hnd)
987 if (!NT_STATUS_IS_OK(result = get_connection_from_cache(domain, PIPE_SAMR, &conn)))
1008 if (!NT_STATUS_IS_OK(result = get_connection_from_cache(domain, PIPE_SAMR, &conn)))
1036 NTSTATUS cm_get_netlogon_cli(struct winbindd_domain *domain,
1052 find_cm_connection(domain, PIPE_NETLOGON, &conn);
1061 find_cm_connection(domain, PIPE_NETLOGON, &conn);
1073 result = new_cm_connection(domain, PIPE_NETLOGON, &conn);
1087 /* This must be the remote domain (not ours) for schannel */
1089 fstrcpy( conn->cli->domain, domain->name);
1121 if (asprintf(&msg, "\t%-15s %-15s %-16s", con->domain, con->controller, con->pipe_name) < 0) {