Changeset 342 for branches/samba-3.3.x/source/winbindd/winbindd_cm.c
- Timestamp:
- Oct 30, 2009, 9:39:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/winbindd/winbindd_cm.c
r223 r342 858 858 machine_password, 859 859 lp_workgroup(), 860 domain-> name);860 domain->alt_name); 861 861 862 862 if (!ADS_ERR_OK(ads_status)) { … … 1543 1543 } 1544 1544 1545 if (conn->lsa_pipe_tcp != NULL) { 1546 TALLOC_FREE(conn->lsa_pipe_tcp); 1547 /* Ok, it must be dead. Drop timeout to 0.5 sec. */ 1548 if (conn->cli) { 1549 cli_set_timeout(conn->cli, 500); 1550 } 1551 } 1552 1545 1553 if (conn->netlogon_pipe != NULL) { 1546 1554 TALLOC_FREE(conn->netlogon_pipe); … … 1917 1925 domain->name, domain->active_directory ? "" : "NOT ")); 1918 1926 1927 domain->can_do_ncacn_ip_tcp = domain->active_directory; 1928 1919 1929 TALLOC_FREE(cli); 1920 1930 … … 2039 2049 result = cli_rpc_pipe_open_spnego_ntlmssp(conn->cli, 2040 2050 &ndr_table_samr.syntax_id, 2051 NCACN_NP, 2041 2052 PIPE_AUTH_LEVEL_PRIVACY, 2042 2053 domain_name, … … 2082 2093 } 2083 2094 result = cli_rpc_pipe_open_schannel_with_key 2084 (conn->cli, &ndr_table_samr.syntax_id, PIPE_AUTH_LEVEL_PRIVACY, 2095 (conn->cli, &ndr_table_samr.syntax_id, NCACN_NP, 2096 PIPE_AUTH_LEVEL_PRIVACY, 2085 2097 domain->name, p_dcinfo, &conn->samr_pipe); 2086 2098 … … 2137 2149 done: 2138 2150 2139 if (!NT_STATUS_IS_OK(result)) { 2151 if (NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED)) { 2152 /* 2153 * if we got access denied, we might just have no access rights 2154 * to talk to the remote samr server server (e.g. when we are a 2155 * PDC and we are connecting a w2k8 pdc via an interdomain 2156 * trust). In that case do not invalidate the whole connection 2157 * stack 2158 */ 2159 TALLOC_FREE(conn->samr_pipe); 2160 ZERO_STRUCT(conn->sam_domain_handle); 2161 return result; 2162 } else if (!NT_STATUS_IS_OK(result)) { 2140 2163 invalidate_cm_connection(conn); 2141 2164 return result; … … 2147 2170 SAFE_FREE(machine_account); 2148 2171 return result; 2172 } 2173 2174 /********************************************************************** 2175 open an schanneld ncacn_ip_tcp connection to LSA 2176 ***********************************************************************/ 2177 2178 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain, 2179 TALLOC_CTX *mem_ctx, 2180 struct rpc_pipe_client **cli) 2181 { 2182 struct winbindd_cm_conn *conn; 2183 NTSTATUS status; 2184 2185 DEBUG(10,("cm_connect_lsa_tcp\n")); 2186 2187 status = init_dc_connection(domain); 2188 if (!NT_STATUS_IS_OK(status)) { 2189 return status; 2190 } 2191 2192 conn = &domain->conn; 2193 2194 if (conn->lsa_pipe_tcp && 2195 conn->lsa_pipe_tcp->transport_type == NCACN_IP_TCP && 2196 conn->lsa_pipe_tcp->auth->auth_level == PIPE_AUTH_LEVEL_PRIVACY) { 2197 goto done; 2198 } 2199 2200 TALLOC_FREE(conn->lsa_pipe_tcp); 2201 2202 status = cli_rpc_pipe_open_schannel(conn->cli, 2203 &ndr_table_lsarpc.syntax_id, 2204 NCACN_IP_TCP, 2205 PIPE_AUTH_LEVEL_PRIVACY, 2206 domain->name, 2207 &conn->lsa_pipe_tcp); 2208 if (!NT_STATUS_IS_OK(status)) { 2209 DEBUG(10,("cli_rpc_pipe_open_schannel failed: %s\n", 2210 nt_errstr(status))); 2211 goto done; 2212 } 2213 2214 done: 2215 if (!NT_STATUS_IS_OK(status)) { 2216 TALLOC_FREE(conn->lsa_pipe_tcp); 2217 return status; 2218 } 2219 2220 *cli = conn->lsa_pipe_tcp; 2221 2222 return status; 2149 2223 } 2150 2224 … … 2179 2253 * authenticated LSA pipe with sign & seal. */ 2180 2254 result = cli_rpc_pipe_open_spnego_ntlmssp 2181 (conn->cli, &ndr_table_lsarpc.syntax_id, 2255 (conn->cli, &ndr_table_lsarpc.syntax_id, NCACN_NP, 2182 2256 PIPE_AUTH_LEVEL_PRIVACY, 2183 2257 conn->cli->domain, conn->cli->user_name, conn_pwd, … … 2220 2294 } 2221 2295 result = cli_rpc_pipe_open_schannel_with_key 2222 (conn->cli, &ndr_table_lsarpc.syntax_id, 2296 (conn->cli, &ndr_table_lsarpc.syntax_id, NCACN_NP, 2223 2297 PIPE_AUTH_LEVEL_PRIVACY, 2224 2298 domain->name, p_dcinfo, &conn->lsa_pipe); … … 2367 2441 2368 2442 result = cli_rpc_pipe_open_schannel_with_key( 2369 conn->cli, &ndr_table_netlogon.syntax_id, 2443 conn->cli, &ndr_table_netlogon.syntax_id, NCACN_NP, 2370 2444 PIPE_AUTH_LEVEL_PRIVACY, domain->name, netlogon_pipe->dc, 2371 2445 &conn->netlogon_pipe);
Note:
See TracChangeset
for help on using the changeset viewer.