mirror of
https://github.com/samba-team/samba.git
synced 2025-12-13 16:23:50 +03:00
r26406: Make a copy to prevent modification of the loadparm configuration.
This commit is contained in:
committed by
Stefan Metzmacher
parent
5827b7460a
commit
c0f2775fd8
@@ -123,7 +123,7 @@ struct composite_context *socket_connect_send(struct socket_context *sock,
|
|||||||
|
|
||||||
set_blocking(socket_get_fd(sock), false);
|
set_blocking(socket_get_fd(sock), false);
|
||||||
|
|
||||||
if (resolve_ctx && server_address->addr && strcmp(sock->backend_name, "ipv4") == 0) {
|
if (resolve_ctx != NULL && server_address->addr && strcmp(sock->backend_name, "ipv4") == 0) {
|
||||||
struct nbt_name name;
|
struct nbt_name name;
|
||||||
struct composite_context *creq;
|
struct composite_context *creq;
|
||||||
make_nbt_name_client(&name, server_address->addr);
|
make_nbt_name_client(&name, server_address->addr);
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
|
|||||||
{
|
{
|
||||||
struct in_addr ip, nmask;
|
struct in_addr ip, nmask;
|
||||||
char *p;
|
char *p;
|
||||||
|
char *address;
|
||||||
int i, added=0;
|
int i, added=0;
|
||||||
|
|
||||||
ip.s_addr = 0;
|
ip.s_addr = 0;
|
||||||
@@ -154,10 +155,13 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
address = talloc_strdup(mem_ctx, token);
|
||||||
|
p = strchr_m(address,'/');
|
||||||
|
|
||||||
/* parse it into an IP address/netmasklength pair */
|
/* parse it into an IP address/netmasklength pair */
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
|
|
||||||
ip.s_addr = interpret_addr2(token).s_addr;
|
ip.s_addr = interpret_addr2(address).s_addr;
|
||||||
|
|
||||||
if (strlen(p) > 2) {
|
if (strlen(p) > 2) {
|
||||||
nmask.s_addr = interpret_addr2(p).s_addr;
|
nmask.s_addr = interpret_addr2(p).s_addr;
|
||||||
@@ -172,14 +176,17 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
|
|||||||
if (same_net(ip, probed_ifaces[i].ip, nmask)) {
|
if (same_net(ip, probed_ifaces[i].ip, nmask)) {
|
||||||
add_interface(mem_ctx, probed_ifaces[i].ip, nmask,
|
add_interface(mem_ctx, probed_ifaces[i].ip, nmask,
|
||||||
local_interfaces);
|
local_interfaces);
|
||||||
|
talloc_free(address);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEBUG(2,("Can't determine ip for broadcast address %s\n", token));
|
DEBUG(2,("Can't determine ip for broadcast address %s\n", address));
|
||||||
|
talloc_free(address);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_interface(mem_ctx, ip, nmask, local_interfaces);
|
add_interface(mem_ctx, ip, nmask, local_interfaces);
|
||||||
|
talloc_free(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user