From: Tom Yu Date: Thu, 13 Sep 2007 23:48:42 +0000 (+0000) Subject: pull up r19456 from trunk (prereq for r19738) X-Git-Tag: krb5-1.6.3-beta1~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f705aa7fce6b7cb5edd00bee699af30b6fc5171;p=krb5.git pull up r19456 from trunk (prereq for r19738) r19456@cathode-dark-space: raeburn | 2007-04-13 01:44:38 -0400 Produce a more informative error message for KDC_UNREACH with KDC not responding. ticket: 3334 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19933 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index 764aafe18..7a0c8ccc7 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -383,7 +383,8 @@ krb5_sendto_kdc (krb5_context context, const krb5_data *message, if (addrs.naddrs > 0) { retval = krb5int_sendto (context, message, &addrs, 0, reply, 0, 0, 0, 0, &addr_used); - if (retval == 0) { + switch (retval) { + case 0: /* * Set use_master to 1 if we ended up talking to a master when * we didn't explicitly request to @@ -401,7 +402,15 @@ krb5_sendto_kdc (krb5_context context, const krb5_data *message, } krb5int_free_addrlist (&addrs); return 0; - } + default: + break; + /* Cases here are for constructing useful error messages. */ + case KRB5_KDC_UNREACH: + krb5_set_error_message(context, retval, + "Cannot contact any KDC for realm '%.*s'", + realm->length, realm->data); + break; + } krb5int_free_addrlist (&addrs); } return retval;