+2006-01-27 Sam Hartman <hartmans@mit.edu>
+
+ * kdb5.c (kdb_load_library): New error codes for library load errors
+
2006-01-25 Ken Raeburn <raeburn@mit.edu>
* kdb5.h (struct _db_library): Delete all lock-related fields.
* or implied warranty.
*/
+/*This code was based on code donated to MIT by Novell for distribution under the MIT license.*/
+
/*
* Include files
*/
{
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;
}
/* 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;
}
}
} else {
- status = -1;
+ status = KRB5_KDB_DBTYPE_INIT;
krb5_set_err(kcontext, krb5_err_have_str, status, dlerror());
goto clean_n_exit;
}
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;
}
library = kdb_get_library_name(kcontext);
if (library == NULL) {
- status = -1;
+ status = KRB5_KDB_DBTYPE_NOTFOUND;
goto clean_n_exit;
}
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