diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-24 14:16:54 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-10-24 14:16:54 -0700 |
commit | f88b7a076be74a29a3bf876b4e2705f4a1ecf42b (patch) | |
tree | 2d5167540fcbe1ad245fce697924b18216b2d142 /source3/auth | |
parent | e01cbcb28e63abb0f681a5a168fc2445744eec93 (diff) | |
download | samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.gz samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.bz2 samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.zip |
This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
(This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd)
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_domain.c | 20 | ||||
-rw-r--r-- | source3/auth/auth_server.c | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index 72bdbab182..7cddabbbbd 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -42,7 +42,7 @@ extern bool global_machine_password_needs_changing; static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, const char *domain, const char *dc_name, - struct in_addr dc_ip, + struct sockaddr_storage *dc_ss, struct rpc_pipe_client **pipe_ret, bool *retry) { @@ -73,7 +73,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, /* Attempt connection */ *retry = True; - result = cli_full_connection(cli, global_myname(), dc_name, &dc_ip, 0, + result = cli_full_connection(cli, global_myname(), dc_name, dc_ss, 0, "IPC$", "IPC", "", "", "", 0, Undefined, retry); if (!NT_STATUS_IS_OK(result)) { @@ -183,7 +183,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx, uchar chal[8], auth_serversupplied_info **server_info, const char *dc_name, - struct in_addr dc_ip) + struct sockaddr_storage *dc_ss) { NET_USER_INFO_3 info3; @@ -207,7 +207,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx, nt_status = connect_to_domain_password_server(&cli, domain, dc_name, - dc_ip, + dc_ss, &netlogon_pipe, &retry); } @@ -305,7 +305,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE; const char *domain = lp_workgroup(); fstring dc_name; - struct in_addr dc_ip; + struct sockaddr_storage dc_ss; if ( lp_server_role() != ROLE_DOMAIN_MEMBER ) { DEBUG(0,("check_ntdomain_security: Configuration error! Cannot use " @@ -331,7 +331,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, /* we need our DC to send the net_sam_logon() request to */ - if ( !get_dc_name(domain, NULL, dc_name, &dc_ip) ) { + if ( !get_dc_name(domain, NULL, dc_name, &dc_ss) ) { DEBUG(5,("check_ntdomain_security: unable to locate a DC for domain %s\n", user_info->domain)); return NT_STATUS_NO_LOGON_SERVERS; @@ -343,7 +343,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, (uchar *)auth_context->challenge.data, server_info, dc_name, - dc_ip); + &dc_ss); return nt_status; } @@ -377,7 +377,7 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte time_t last_change_time; DOM_SID sid; fstring dc_name; - struct in_addr dc_ip; + struct sockaddr_storage dc_ss; if (!user_info || !server_info || !auth_context) { DEBUG(1,("check_trustdomain_security: Critical variables not present. Failing.\n")); @@ -433,7 +433,7 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte /* use get_dc_name() for consistency even through we know that it will be a netbios name */ - if ( !get_dc_name(user_info->domain, NULL, dc_name, &dc_ip) ) { + if ( !get_dc_name(user_info->domain, NULL, dc_name, &dc_ss) ) { DEBUG(5,("check_trustdomain_security: unable to locate a DC for domain %s\n", user_info->domain)); return NT_STATUS_NO_LOGON_SERVERS; @@ -445,7 +445,7 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte (uchar *)auth_context->challenge.data, server_info, dc_name, - dc_ip); + &dc_ss); return nt_status; } diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 815c1193d1..8b10be93fc 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -33,7 +33,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx) { struct cli_state *cli = NULL; fstring desthost; - struct in_addr dest_ip; + struct sockaddr_storage dest_ss; const char *p; char *pserver; bool connected_ok = False; @@ -54,12 +54,12 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx) desthost, sizeof(desthost)); strupper_m(desthost); - if(!resolve_name( desthost, &dest_ip, 0x20)) { + if(!resolve_name( desthost, &dest_ss, 0x20)) { DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost)); continue; } - if (ismyip_v4(dest_ip)) { + if (ismyaddr(&dest_ss)) { DEBUG(1,("Password server loop - disabling password server %s\n",desthost)); continue; } @@ -73,7 +73,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx) return NULL; } - status = cli_connect(cli, desthost, &dest_ip); + status = cli_connect(cli, desthost, &dest_ss); if (NT_STATUS_IS_OK(status)) { DEBUG(3,("connected to password server %s\n",desthost)); connected_ok = True; @@ -91,7 +91,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx) } if (!attempt_netbios_session_request(&cli, global_myname(), - desthost, &dest_ip)) { + desthost, &dest_ss)) { release_server_mutex(); DEBUG(1,("password server fails session request\n")); cli_shutdown(cli); |