FAILS!!! why??? libcli/nbt: avoid talloc_reference() in nbt_name_*_send()
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Aug 2013 16:11:23 +0000 (18:11 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 10 Apr 2018 08:14:14 +0000 (10:14 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
FAILS: TDB_NO_FSYNC=1 buildnice make -j test FAIL_IMMEDIATELY=1 TESTS=member

[73/95 in 2m6s] samba4.blackbox.smbclient(s4member:local)
Connection to \\s4member\tmp failed - NT_STATUS_OBJECT_NAME_NOT_FOUND
UNEXPECTED(failure): samba4.blackbox.smbclient(s4member:local).Test login with --machine-pass and kerberos(s4member:local)
REASON: _StringException: _StringException: No reason specified

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)

A summary with detailed information can be found in:
  /data/tmp/samba-master4-test/summary
Traceback (most recent call last):
  File "/home/metze/devel/samba/4.0/master4-test/selftest/filter-subunit", line 93, in <module>
    ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
  File "/home/metze/devel/samba/4.0/master4-test/selftest/subunithelper.py", line 55, in parse_results
    msg_ops.startTest(test)
  File "/home/metze/devel/samba/4.0/master4-test/selftest/subunithelper.py", line 270, in startTest
    self._ops.startTest(test)
  File "/home/metze/devel/samba/4.0/master4-test/selftest/../lib/subunit/python/subunit/__init__.py", line 762, in startTest
    self._stream.write(_b("test: ") + self._test_id(test) + _b("\n"))
IOError: [Errno 32] Broken pipe
Exiting early because of SIGPIPE.

libcli/nbt/nbtsocket.c

index 711e39cbdc5a08c7714eda137dd8a2f5eb8d3b25..92bd86aebb9dfd4cda92afc4a26252b9e0545ea5 100644 (file)
@@ -386,8 +386,8 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
        req->is_reply               = false;
        req->timeout                = timeout;
        req->num_retries            = retries;
-       req->dest                   = dest;
-       if (talloc_reference(req, dest) == NULL) goto failed;
+       req->dest                   = socket_address_copy(req, dest);
+       if (req->dest == NULL) goto failed;
 
        /* we select a random transaction id unless the user supplied one */
        if (request->name_trn_id == 0) {
@@ -445,8 +445,8 @@ _PUBLIC_ NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
        NT_STATUS_HAVE_NO_MEMORY(req);
 
        req->nbtsock   = nbtsock;
-       req->dest = dest;
-       if (talloc_reference(req, dest) == NULL) goto failed;
+       req->dest = socket_address_copy(req, dest);
+       if (req>dest == NULL) goto failed;
        req->state     = NBT_REQUEST_SEND;
        req->is_reply = true;