s3:cli_netlogon: make sure rpccli_connect_netlogon only returns NT_STATUS_OK on success
authorStefan Metzmacher <metze@samba.org>
Wed, 18 Oct 2017 11:36:59 +0000 (13:36 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 20 Oct 2017 02:05:20 +0000 (04:05 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/cli_netlogon.c

index 616523ec371a4aa3cf71aa3d2f60649a9aaaf191..469d348f6b9c6cebd04a9df0d9ea6dd13862de64 100644 (file)
@@ -354,15 +354,16 @@ again:
                status = cli_rpc_pipe_open_bind_schannel(
                        cli, &ndr_table_netlogon, transport, creds_ctx,
                        &rpccli);
-               if (!NT_STATUS_IS_OK(status)) {
-                       DBG_DEBUG("cli_rpc_pipe_open_bind_schannel "
-                                 "failed: %s\n", nt_errstr(status));
-               }
                if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
                        DBG_DEBUG("Retrying with serverauthenticate\n");
                        TALLOC_FREE(lck);
                        goto again;
                }
+               if (!NT_STATUS_IS_OK(status)) {
+                       DBG_DEBUG("cli_rpc_pipe_open_bind_schannel "
+                                 "failed: %s\n", nt_errstr(status));
+                       goto fail;
+               }
                goto done;
        }
 
@@ -399,6 +400,7 @@ again:
                if (!NT_STATUS_IS_OK(status)) {
                        DBG_DEBUG("cli_rpc_pipe_open_noauth_transport "
                                  "failed: %s\n", nt_errstr(status));
+                       goto fail;
                }
                goto done;
        }
@@ -434,6 +436,7 @@ again:
                if (!NT_STATUS_IS_OK(status)) {
                        DBG_DEBUG("cli_rpc_pipe_open_noauth_transport "
                                  "failed: %s\n", nt_errstr(status));
+                       goto fail;
                }
                goto done;
        }