mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
- Remove RTLD_GLOBAL
- make smb_load_module() return the return value of init_module()
(This used to be commit a8d2dd8d00
)
This commit is contained in:
parent
809f740166
commit
04d21551e1
@ -1698,6 +1698,6 @@ extern struct poptOption popt_common_debug[];
|
|||||||
extern struct poptOption popt_common_configfile[];
|
extern struct poptOption popt_common_configfile[];
|
||||||
|
|
||||||
/* Module support */
|
/* Module support */
|
||||||
typedef int (init_module_function) (void);
|
typedef NTSTATUS (init_module_function) (void);
|
||||||
|
|
||||||
#endif /* _SMB_H */
|
#endif /* _SMB_H */
|
||||||
|
@ -26,12 +26,13 @@ NTSTATUS smb_load_module(const char *module_name)
|
|||||||
{
|
{
|
||||||
void *handle;
|
void *handle;
|
||||||
init_module_function *init;
|
init_module_function *init;
|
||||||
|
NTSTATUS nt_status;
|
||||||
|
|
||||||
/* Always try to use LAZY symbol resolving; if the plugin has
|
/* Always try to use LAZY symbol resolving; if the plugin has
|
||||||
* backwards compatibility, there might be symbols in the
|
* backwards compatibility, there might be symbols in the
|
||||||
* plugin referencing to old (removed) functions
|
* plugin referencing to old (removed) functions
|
||||||
*/
|
*/
|
||||||
handle = dlopen(module_name, RTLD_LAZY | RTLD_GLOBAL);
|
handle = dlopen(module_name, RTLD_LAZY);
|
||||||
|
|
||||||
if(!handle) {
|
if(!handle) {
|
||||||
DEBUG(0, ("Error loading module '%s': %s\n", module_name, sys_dlerror()));
|
DEBUG(0, ("Error loading module '%s': %s\n", module_name, sys_dlerror()));
|
||||||
@ -45,11 +46,11 @@ NTSTATUS smb_load_module(const char *module_name)
|
|||||||
return NT_STATUS_UNSUCCESSFUL;
|
return NT_STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
nt_status = init();
|
||||||
|
|
||||||
DEBUG(2, ("Module '%s' loaded\n", module_name));
|
DEBUG(2, ("Module '%s' loaded\n", module_name));
|
||||||
|
|
||||||
return NT_STATUS_OK;
|
return nt_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* HAVE_DLOPEN */
|
#else /* HAVE_DLOPEN */
|
||||||
|
Loading…
Reference in New Issue
Block a user