mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
add smb_load_modules() to load a list of modules - does this function look ok ?
This commit is contained in:
parent
54115fd16f
commit
a82dbb3c22
@ -53,6 +53,22 @@ NTSTATUS smb_load_module(const char *module_name)
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
/* Load all modules in list and return number of
|
||||
* modules that has been successfully loaded */
|
||||
int smb_load_modules(const char **modules)
|
||||
{
|
||||
int i;
|
||||
int success = 0;
|
||||
|
||||
for(i = 0; modules[i]; i++){
|
||||
if(NT_STATUS_IS_OK(smb_load_module(modules[i]))) {
|
||||
success++;
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
#else /* HAVE_DLOPEN */
|
||||
|
||||
NTSTATUS smb_load_module(const char *module_name)
|
||||
@ -61,4 +77,10 @@ NTSTATUS smb_load_module(const char *module_name)
|
||||
return NT_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
int smb_load_modules(const char **modules)
|
||||
{
|
||||
DEBUG(0,("This samba executable has not been build with plugin support"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* HAVE_DLOPEN */
|
||||
|
Loading…
Reference in New Issue
Block a user