#include "includes.h"
#ifdef HAVE_DLOPEN
-NTSTATUS smb_load_module(const char *module_name)
+int smb_load_module(const char *module_name)
{
void *handle;
init_module_function *init;
- NTSTATUS nt_status;
+ int status;
const char *error;
/* Always try to use LAZY symbol resolving; if the plugin has
if(!handle) {
DEBUG(0, ("Error loading module '%s': %s\n", module_name, sys_dlerror()));
- return NT_STATUS_UNSUCCESSFUL;
+ return False;
}
init = sys_dlsym(handle, "init_module");
error = sys_dlerror();
if (error) {
DEBUG(0, ("Error trying to resolve symbol 'init_module' in %s: %s\n", module_name, error));
- return NT_STATUS_UNSUCCESSFUL;
+ return False;
}
- nt_status = init();
+ status = init();
DEBUG(2, ("Module '%s' loaded\n", module_name));
- return nt_status;
+ return status;
}
/* Load all modules in list and return number of
int success = 0;
for(i = 0; modules[i]; i++){
- if(NT_STATUS_IS_OK(smb_load_module(modules[i]))) {
+ if(smb_load_module(modules[i])) {
success++;
}
}
#else /* HAVE_DLOPEN */
-NTSTATUS smb_load_module(const char *module_name)
+int smb_load_module(const char *module_name)
{
DEBUG(0,("This samba executable has not been build with plugin support"));
- return NT_STATUS_NOT_SUPPORTED;
+ return False;
}
int smb_load_modules(const char **modules)
/*******************************************************************
Register commands to an RPC pipe
*******************************************************************/
-NTSTATUS rpc_load_module(const char *module)
+int rpc_load_module(const char *module)
{
pstring full_path;
- NTSTATUS status;
+ int status;
pstrcpy(full_path, lib_path("rpc"));
pstrcat(full_path, "/librpc_");
pstrcat(full_path, ".");
pstrcat(full_path, shlib_ext());
- if (!NT_STATUS_IS_OK(status = smb_load_module(full_path))) {
+ if (!(status = smb_load_module(full_path))) {
DEBUG(0, ("Could not load requested pipe %s as %s\n",
module, full_path));
}
}
}
- if (!api_fd_commands[i].name && !NT_STATUS_IS_OK(rpc_load_module(p->name))) {
+ if (!api_fd_commands[i].name && !rpc_load_module(p->name)) {
DEBUG(3,("api_pipe_bind_req: Unknown pipe name %s in bind request.\n",
p->name ));
if(!setup_bind_nak(p))