if (!err) {
if (stat (filepath, &statbuf) < 0) {
- Tprintf ("stat(%s): %s\n", filepath, strerror (errno));
err = errno;
+ Tprintf ("stat(%s): %s\n", filepath, strerror (err));
+ krb5int_set_error(ep, err, "unable to find plugin [%s]: %s",
+ filepath, strerror(err));
}
}
#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
#endif
if (!err) {
- handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS);
+ handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS | RTLD_NODELETE);
if (handle == NULL) {
const char *e = dlerror();
if (e == NULL)
e = "unknown failure";
Tprintf ("dlopen(%s): %s\n", filepath, e);
err = ENOENT; /* XXX */
- krb5int_set_error (ep, err, "%s", e);
+ krb5int_set_error(ep, err, "unable to load plugin [%s]: %s",
+ filepath, e);
}
}
if (handle == NULL) {
Tprintf ("Unable to load dll: %s\n", filepath);
err = ENOENT; /* XXX */
- krb5int_set_error (ep, err, "%s", "unable to load dll");
+ krb5int_set_error (ep, err, "unable to load DLL [%s]", filepath);
}
if (!err) {
if (!err && !got_plugin) {
err = ENOENT; /* no plugin or no way to load plugins */
+ krb5int_set_error (ep, err, "plugin unavailable: %s", strerror(err));
}
if (!err) {