krb5 commit: End connection on KDC_ERR_SVC_UNAVAILABLE

ghudson at mit.edu ghudson at mit.edu
Mon Oct 30 22:02:13 EDT 2023


https://github.com/krb5/krb5/commit/ca80f64c786341d5871ae1de18142e62af64f7b9
commit ca80f64c786341d5871ae1de18142e62af64f7b9
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Oct 27 00:44:53 2023 -0400

    End connection on KDC_ERR_SVC_UNAVAILABLE
    
    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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c
index b1dc66a70..0f198c398 100644
--- a/src/lib/krb5/os/sendto_kdc.c
+++ b/src/lib/krb5/os/sendto_kdc.c
@@ -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) {


More information about the cvs-krb5 mailing list