diff options
-rw-r--r-- | source3/lib/system.c | 9 | ||||
-rw-r--r-- | source3/passdb/passdb.c | 4 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index 0799a855e8..185c1daa82 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -977,3 +977,12 @@ int sys_dlclose (void *handle) return 0; #endif } + +const char *sys_dlerror(void) +{ +#ifdef HAVE_LIBDL + return dlerror(); +#else + return NULL; +#endif +} diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 3bb49091e6..640be5b108 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -63,7 +63,7 @@ BOOL initialize_password_db(BOOL reload) if ((pdb_handle=sys_dlopen (modulename, RTLD_LAZY)) == NULL) { DEBUG(0,("initialize_password_db: ERROR - Unable to open passdb module \"%s\"!\n%s\n", - modulename, dlerror())); + modulename, sys_dlerror())); } else DEBUG(1,("initialize_password_db: passdb module \"%s\" loaded successfully\n", modulename)); @@ -76,7 +76,7 @@ BOOL initialize_password_db(BOOL reload) if ((pdb_handle=sys_dlopen ("libpdbfile.so", RTLD_LAZY)) == NULL) { DEBUG(0,("initialize_password_db: ERROR - Unable to open \"libpdbfile.so\" passdb module! No user authentication possible!\n%s\n", - dlerror())); + sys_dlerror())); return False; } else diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 71ebf9b506..50361564a5 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -117,7 +117,7 @@ static BOOL vfs_init_custom(connection_struct *conn) /* Open object file */ if ((conn->dl_handle = sys_dlopen(lp_vfsobj(SNUM(conn)), RTLD_NOW | RTLD_GLOBAL)) == NULL) { - DEBUG(0, ("Error opening %s: %s\n", lp_vfsobj(SNUM(conn)), dlerror())); + DEBUG(0, ("Error opening %s: %s\n", lp_vfsobj(SNUM(conn)), sys_dlerror())); return False; } |