mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
rpcclient: Fix ncacn_ip_tcp:<ip-address>
inet_pton expects "struct in_addr" or "struct in6_addr" as destination pointer. It does not fill in a struct sockaddr_storage. interpret_string_addr() takes care of this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jan 10 11:47:34 UTC 2022 on sn-devel-184
This commit is contained in:
parent
03734be1d6
commit
b5e56a30df
@ -1 +0,0 @@
|
||||
.*samba3.blackbox.rpcclient.*ncacn_ip_tcp.*
|
@ -897,23 +897,10 @@ static NTSTATUS do_cmd(struct cli_state *cli,
|
||||
binding, "target_hostname");
|
||||
|
||||
if (remote_host != NULL) {
|
||||
int af = AF_UNSPEC;
|
||||
|
||||
if (remote_name == NULL) {
|
||||
remote_name = dcerpc_binding_get_string_option(
|
||||
binding, "host");
|
||||
}
|
||||
|
||||
if (is_ipaddress_v4(remote_host)) {
|
||||
af = AF_INET;
|
||||
} else if (is_ipaddress_v6(remote_host)) {
|
||||
af = AF_INET6;
|
||||
}
|
||||
if (af != AF_UNSPEC) {
|
||||
int ok = inet_pton(af, remote_host, &remote_ss);
|
||||
if (ok) {
|
||||
remote_sockaddr = &remote_ss;
|
||||
}
|
||||
bool ok = interpret_string_addr(
|
||||
&remote_ss, remote_host, 0);
|
||||
if (ok) {
|
||||
remote_sockaddr = &remote_ss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user