Changeset 590 for trunk/server/source3/winbindd/winbindd_cm.c
- Timestamp:
- Jul 1, 2011, 8:40:10 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/winbindd/winbindd_cm.c
r480 r590 2017 2017 ***********************************************************************/ 2018 2018 2019 static boolcm_get_schannel_creds(struct winbindd_domain *domain,2019 static NTSTATUS cm_get_schannel_creds(struct winbindd_domain *domain, 2020 2020 struct netlogon_creds_CredentialState **ppdc) 2021 2021 { 2022 NTSTATUS result ;2022 NTSTATUS result = NT_STATUS_UNSUCCESSFUL; 2023 2023 struct rpc_pipe_client *netlogon_pipe; 2024 2024 2025 2025 if (lp_client_schannel() == False) { 2026 return False;2026 return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;; 2027 2027 } 2028 2028 2029 2029 result = cm_connect_netlogon(domain, &netlogon_pipe); 2030 2030 if (!NT_STATUS_IS_OK(result)) { 2031 return False;2031 return result; 2032 2032 } 2033 2033 … … 2036 2036 2037 2037 if (!domain->conn.netlogon_pipe->dc) { 2038 return false;2038 return NT_STATUS_INTERNAL_ERROR; /* This shouldn't happen. */ 2039 2039 } 2040 2040 2041 2041 *ppdc = domain->conn.netlogon_pipe->dc; 2042 return True;2042 return NT_STATUS_OK; 2043 2043 } 2044 2044 … … 2137 2137 /* Fall back to schannel if it's a W2K pre-SP1 box. */ 2138 2138 2139 if (!cm_get_schannel_creds(domain, &p_creds)) { 2139 result = cm_get_schannel_creds(domain, &p_creds); 2140 if (!NT_STATUS_IS_OK(result)) { 2140 2141 /* If this call fails - conn->cli can now be NULL ! */ 2141 2142 DEBUG(10, ("cm_connect_sam: Could not get schannel auth info " 2142 "for domain %s, trying anon\n", domain->name)); 2143 "for domain %s (error %s), trying anon\n", 2144 domain->name, 2145 nt_errstr(result) )); 2143 2146 goto anonymous; 2144 2147 } … … 2232 2235 { 2233 2236 struct winbindd_cm_conn *conn; 2237 struct netlogon_creds_CredentialState *creds; 2234 2238 NTSTATUS status; 2235 2239 … … 2252 2256 TALLOC_FREE(conn->lsa_pipe_tcp); 2253 2257 2254 status = cli_rpc_pipe_open_schannel(conn->cli, 2255 &ndr_table_lsarpc.syntax_id, 2256 NCACN_IP_TCP, 2257 DCERPC_AUTH_LEVEL_PRIVACY, 2258 domain->name, 2259 &conn->lsa_pipe_tcp); 2258 status = cm_get_schannel_creds(domain, &creds); 2260 2259 if (!NT_STATUS_IS_OK(status)) { 2261 DEBUG(10,("cli_rpc_pipe_open_schannel failed: %s\n", 2260 goto done; 2261 } 2262 2263 status = cli_rpc_pipe_open_schannel_with_key(conn->cli, 2264 &ndr_table_lsarpc.syntax_id, 2265 NCACN_IP_TCP, 2266 DCERPC_AUTH_LEVEL_PRIVACY, 2267 domain->name, 2268 &creds, 2269 &conn->lsa_pipe_tcp); 2270 if (!NT_STATUS_IS_OK(status)) { 2271 DEBUG(10,("cli_rpc_pipe_open_schannel_with_key failed: %s\n", 2262 2272 nt_errstr(status))); 2263 2273 goto done; … … 2339 2349 /* Fall back to schannel if it's a W2K pre-SP1 box. */ 2340 2350 2341 if (!cm_get_schannel_creds(domain, &p_creds)) { 2351 result = cm_get_schannel_creds(domain, &p_creds); 2352 if (!NT_STATUS_IS_OK(result)) { 2342 2353 /* If this call fails - conn->cli can now be NULL ! */ 2343 2354 DEBUG(10, ("cm_connect_lsa: Could not get schannel auth info " 2344 "for domain %s, trying anon\n", domain->name)); 2355 "for domain %s (error %s), trying anon\n", 2356 domain->name, 2357 nt_errstr(result) )); 2345 2358 goto anonymous; 2346 2359 }
Note:
See TracChangeset
for help on using the changeset viewer.