]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
End connection on KDC_ERR_SVC_UNAVAILABLE
authorGreg Hudson <ghudson@mit.edu>
Fri, 27 Oct 2023 04:44:53 +0000 (00:44 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 30 Oct 2023 21:49:07 +0000 (17:49 -0400)
In sendto_kdc.c:service_fds(), if a message handler indicates that a
message should be discarded, kill the connection so we don't continue
waiting on it for more data.

ticket: 7899

src/lib/krb5/os/sendto_kdc.c

index b1dc66a70fdc8c10e3c7aa74b2e0e4c3b1d09b62..0f198c398769d1b3756faf4f2c612ea5b1b47f0c 100644 (file)
@@ -1442,7 +1442,10 @@ service_fds(krb5_context context, struct select_state *selstate,
                 if (msg_handler != NULL) {
                     krb5_data reply = make_data(state->in.buf, state->in.pos);
 
-                    stop = (msg_handler(context, &reply, msg_handler_data) != 0);
+                    if (!msg_handler(context, &reply, msg_handler_data)) {
+                        kill_conn(context, state, selstate);
+                        stop = 0;
+                    }
                 }
 
                 if (stop) {