summaryrefslogtreecommitdiff
path: root/lib/util/modules.c
AgeCommit message (Collapse)AuthorFilesLines
2025-09-01lib: Re-add dlclose(handle) when module initialization failedVolker Lendecke1-1/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Sep 1 17:04:27 UTC 2025 on atb-devel-224
2025-08-15lib:util: Fix resourse leak CID#1412633Vinit Agnihotri1-3/+1
Stop using un-needed variable 'handle', this variable is not used anywhere later. Also load_module() internally allocates and uses handle, which suffice for its operation. This fixes resource leak issue reported by coverity #1412633 Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Fri Aug 15 06:19:51 UTC 2025 on atb-devel-224
2023-04-14lib:util: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2017-06-24lib: Give util_paths.c its own headerVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06lib:util: Make loading of modules more secureAndreas Schneider1-59/+42
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06lib:util: Make probing of modules more secureAndreas Schneider1-1/+65
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06lib:util: Rename smb_load_modules()Andreas Schneider1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06lib:util: Add new function to load modules from absolute pathAndreas Schneider1-2/+40
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-22lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison1-3/+3
XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
2017-02-22Correct "occured" typos.Chris Lamb1-1/+1
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-06-18s3: smbd: Codenomicon crash in do_smb_load_module().Jeremy Allison1-0/+5
Inside api_pipe_bind_req() we look for a pipe module name using dcerpc_default_transport_endpoint(pkt, NCACN_NP, table) which returns NULL when given invalid pkt data from the Codenomicon fuzzer. This gets passed directly to smb_probe_module(), which then calls do_smb_load_module() which tries to deref the (NULL) module name. https://bugzilla.samba.org/show_bug.cgi?id=11342 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 18 22:14:01 CEST 2015 on sn-devel-104
2013-05-28lib/util/modules.c: Remove #if SAMBA_BUILD_ == 3 now we only have the waf buildAndrew Bartlett1-8/+0
Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2012-07-18lib/util/modules.c: fix stackframe leak.Rusty Russell1-1/+2
do_smb_load_module() doesn't free its stackframe on success. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-04-03lib/util: charset modules do not exist any moreAndrew Bartlett1-4/+0
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Apr 3 08:07:42 CEST 2012 on sn-devel-104
2012-04-03lib/util: Add smb_load_module that returns DEBUG(0) errors on failureAndrew Bartlett1-38/+38
These errors are very important when trying to work out why a module does not load, and this rework allows them to be shown when loading vfs modules. Andrew Bartlett
2011-12-03Revert making public of the samba-module library.Jelmer Vernooij1-0/+240
This library was tiny - containing just two public functions than were themselves trivial. The amount of overhead this causes isn't really worth the benefits of sharing the code with other projects like OpenChange. In addition, this code isn't really generically useful anyway, as it can only load from the module path set for Samba at configure time. Adding a new library was breaking the API/ABI anyway, so OpenChange had to be updated to cope with the new situation one way or another. I've added a simpler (compatible) routine for loading modules to OpenChange, which is less than 100 lines of code. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Dec 3 08:36:33 CET 2011 on sn-devel-104
2011-10-28lib/util Split samba-modules library into public and private partsAndrew Bartlett1-240/+0
This will allow OpenChange to get at the symbols it needs, without exposing any more of this as a public API than we must. Andrew Bartlett
2011-10-28lib/util Rename load_samba_modules -> samba_modules_loadAndrew Bartlett1-1/+1
This is to provide a cleaner namespace in the public samba plugin functions. Andrew Bartlett
2011-10-28lib/util Rename run_init_functions -> samba_init_module_fns_runAndrew Bartlett1-1/+1
This is to provide a cleaner namespace in the public samba plugin functions. Andrew Bartlett
2011-10-28lib/util Rename init_module_fn to samba_init_module_fnAndrew Bartlett1-10/+10
This prepares for making the samba_module.h header public again, for OpenChange. I am keen to avoid too much API namespace pollution if we can.
2011-10-06lib/util: consolidate module loadingAndrew Bartlett1-30/+32
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Oct 6 08:52:30 CEST 2011 on sn-devel-104
2011-10-06modules: standardise on samba_init_module as the hook symbol to resolveAndrew Bartlett1-3/+3
2011-10-06lib/util: Use only init_module_fn typedef in module loadingAndrew Bartlett1-2/+2
2011-10-06lib/util: Remove unused module loading functionsAndrew Bartlett1-7/+2
2011-10-06lib/util: consolidate module loading into common codeAndrew Bartlett1-0/+243
This creates a samba-modules private libary that handles the details. Andrew Bartlett