winbind: Fix --ping-dc error handling
authorVolker Lendecke <vl@samba.org>
Mon, 26 Feb 2018 14:32:05 +0000 (15:32 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 1 Mar 2018 13:48:19 +0000 (14:48 +0100)
If the child dies at the wrong moment, we get an error in the "req" itself.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13309

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Mar  1 14:48:19 CET 2018 on sn-devel-144

source3/winbindd/winbindd_ping_dc.c

index a6cea79ee2a7de5f98d070b6b9f57bbfb65a54c2..c1a0a7b0ec691be7fcb3dc0a89519b0b801c2d14 100644 (file)
@@ -115,6 +115,11 @@ NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
 {
        struct winbindd_ping_dc_state *state = tevent_req_data(
                req, struct winbindd_ping_dc_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               return status;
+       }
 
        if (!NT_STATUS_IS_OK(state->result)) {
                set_auth_errors(presp, state->result);