]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpcclient: Fix ncacn_ip_tcp:<ip-address>
authorVolker Lendecke <vl@samba.org>
Sun, 9 Jan 2022 12:38:37 +0000 (13:38 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 10 Jan 2022 11:47:34 +0000 (11:47 +0000)
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

selftest/knownfail.d/rpcclient_ncacn_ip_tcp [deleted file]
source3/rpcclient/rpcclient.c

diff --git a/selftest/knownfail.d/rpcclient_ncacn_ip_tcp b/selftest/knownfail.d/rpcclient_ncacn_ip_tcp
deleted file mode 100644 (file)
index 42aecda..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.*samba3.blackbox.rpcclient.*ncacn_ip_tcp.*
index b89534f22254e4156de176f1e26b58cc34c6d0e1..4042d0d60beae6981d1f39ba5c9274f7fabbe51d 100644 (file)
@@ -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;
                        }
                }
        }