From: Sam Hartman Date: Fri, 27 Jan 2006 21:21:48 +0000 (+0000) Subject: Define new error codes for errors loading dal plugins. X-Git-Tag: krb5-1.5-alpha1~197 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9f41e2c8138b4182b987e843ef3aebaf08f63d7d;p=krb5.git Define new error codes for errors loading dal plugins. Use these error codes to report plugin load errors. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17629 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index b1099aa24..6ba57fc81 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,7 @@ +2006-01-27 Sam Hartman + + * kdb5.c (kdb_load_library): New error codes for library load errors + 2006-01-25 Ken Raeburn * kdb5.h (struct _db_library): Delete all lock-related fields. diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index 8a4abe3b0..7efbd24e9 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -22,6 +22,8 @@ * or implied warranty. */ +/*This code was based on code donated to MIT by Novell for distribution under the MIT license.*/ + /* * Include files */ @@ -265,7 +267,7 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib) { sprintf(buf, "Program not built to support %s database type\n", lib_name); - status = -1; + status = KRB5_KDB_DBTYPE_NOSUP; krb5_db_set_err(kcontext, krb5_err_have_str, status, buf); goto clean_n_exit; } @@ -278,7 +280,7 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib) /* ERROR. library not initialized cleanly */ sprintf(buf, "%s library initialization failed, error code %ld\n", lib_name, status); - status = -1; + status = KRB5_KDB_DBTYPE_INIT; krb5_db_set_err(kcontext, krb5_err_have_str, status, buf); goto clean_n_exit; } @@ -372,7 +374,7 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib) } } else { - status = -1; + status = KRB5_KDB_DBTYPE_INIT; krb5_set_err(kcontext, krb5_err_have_str, status, dlerror()); goto clean_n_exit; } @@ -386,7 +388,7 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib) if (!(*lib)->dl_handle) { /* library not found in the given list. Error str is already set */ - status = -1; + status = KRB5_KDB_DBTYPE_NOTFOUND; krb5_set_err(kcontext, krb5_err_have_str, status, err_str); goto clean_n_exit; } @@ -522,7 +524,7 @@ kdb_setup_lib_handle(krb5_context kcontext) library = kdb_get_library_name(kcontext); if (library == NULL) { - status = -1; + status = KRB5_KDB_DBTYPE_NOTFOUND; goto clean_n_exit; } diff --git a/src/lib/krb5/error_tables/ChangeLog b/src/lib/krb5/error_tables/ChangeLog index 326106b5e..bb59895bf 100644 --- a/src/lib/krb5/error_tables/ChangeLog +++ b/src/lib/krb5/error_tables/ChangeLog @@ -1,3 +1,7 @@ +2006-01-27 Sam Hartman + + * kdb5_err.et: New error codes for plugin errors + 2004-10-13 Alexandra Ellwood * krb5_err.et: added KRB5_DELTAT_BADFORMAT for diff --git a/src/lib/krb5/error_tables/kdb5_err.et b/src/lib/krb5/error_tables/kdb5_err.et index aee3c4a6d..7c146e61e 100644 --- a/src/lib/krb5/error_tables/kdb5_err.et +++ b/src/lib/krb5/error_tables/kdb5_err.et @@ -68,4 +68,8 @@ ec KRB5_KDB_BAD_ENCTYPE, "Unsupported encryption type" ec KRB5_KDB_BAD_CREATEFLAGS, "Bad database creation flags" ec KRB5_KDB_NO_PERMITTED_KEY, "No matching key in entry having a permitted enctype" ec KRB5_KDB_NO_MATCHING_KEY, "No matching key in entry" +ec KRB5_KDB_DBTYPE_NOTFOUND, "Unable to find requested database type" +ec KRB5_KDB_DBTYPE_NOSUP, "Database type not supported" +ec KRB5_KDB_DBTYPE_INIT, "Database library failed to initialize" + end