Skip Menu |
 

To: <krb5-bugs@mit.edu>
From: Michael Aldridge <michael.aldridge@utdallas.edu>
Subject: Confusing error text for unset default_realm
Date: Thu, 30 Jun 2016 14:00:46 -0500
Greetings,

After many hours of troubleshooting a fresh set of eyes determined that
the error text I was seeing was not indicative of the problem. Here is
what happened and the solution:

I was installing a new site with a KDC whose database is stored on an
LDAP server. The kdc.conf file did not specify a default realm and for
reasons not directly related to this report, there was no krb5.conf on
the machine in question. When trying to run the following command, I
received an error related to the lib handle, not the root cause which
was the unset default_realm.

Command: kdb5_ldap_util -D "cn=krbAdmService,dc=collegiumv,dc=org"
stashsrvpw -f /var/krb5kdc/ldap.keyfile
"cn=krbAdmService,dc=collegiumv,dc=org"

Error: kdb5_ldap_util: Unable to find requested database type while
setting up lib handle


As the solution was to set the default realm, it would have been nice if
the error message actually implied that was the error.

Good luck and happy bug hunting!

--Michael

--
Michael Aldridge
Network Administrator
Collegium V Honors College
The University of Texas at Dallas
The culprit functions here are kdb_get_library_name() and its caller
krb5_db_setup_lib_handle(). kdb_get_library_name() returns a string
pointer or NULL, and if it fails (which should usually only happen on a
failure to get the default realm), krb5_db_setup_lib_handle() returns
KRB5_KDB_DBTYPE_NOTFOUND with no extended message.
From: ghudson@mit.edu
Subject: git commit

Improve kdb5 error when default realm is unset

When the default realm name is unspecified, and none was set in the
krb5_context object, return KRB5_CONFIG_NODEFREALM from libkdb5
instead of the confusing KRB5_KDB_DBTYPE_NOTFOUND. To accomplish
this, make kdb_get_library_name() return a krb5_error_code.

https://github.com/krb5/krb5/commit/4131988dec0199287765e1875fe0bbd375656a62
Author: Greg Hudson <ghudson@mit.edu>
Commit: 4131988dec0199287765e1875fe0bbd375656a62
Branch: master
src/lib/kdb/kdb5.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
From: tlyu@mit.edu
Subject: git commit

Improve kdb5 error when default realm is unset

When the default realm name is unspecified, and none was set in the
krb5_context object, return KRB5_CONFIG_NODEFREALM from libkdb5
instead of the confusing KRB5_KDB_DBTYPE_NOTFOUND. To accomplish
this, make kdb_get_library_name() return a krb5_error_code.

(cherry picked from commit 4131988dec0199287765e1875fe0bbd375656a62)

https://github.com/krb5/krb5/commit/dcc8b9541947024386905d73a966f458e94ac3d5
Author: Greg Hudson <ghudson@mit.edu>
Committer: Tom Yu <tlyu@mit.edu>
Commit: dcc8b9541947024386905d73a966f458e94ac3d5
Branch: krb5-1.14
src/lib/kdb/kdb5.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)