summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-23 23:20:27 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-26 13:19:01 +0100
commitb0aba1753820aa735d594f75b8ee01fa349297e3 (patch)
treee344922553e455a99e76a0208cc91a0ff23e33c1
parent22d8d277c63e13f1e44221829fc3538f63526aa2 (diff)
downloadsamba-b0aba1753820aa735d594f75b8ee01fa349297e3.tar.gz
samba-b0aba1753820aa735d594f75b8ee01fa349297e3.tar.bz2
samba-b0aba1753820aa735d594f75b8ee01fa349297e3.zip
nss_wrapper: Fix a segfault when libnss_winbind.so is not loadable
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Feb 26 13:19:01 CET 2011 on sn-devel-104
-rw-r--r--lib/nss_wrapper/nss_wrapper.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c
index 78c51823fd..cfa5a68712 100644
--- a/lib/nss_wrapper/nss_wrapper.c
+++ b/lib/nss_wrapper/nss_wrapper.c
@@ -479,8 +479,17 @@ static bool nwrap_module_init(const char *name,
b->name = name;
b->ops = ops;
b->so_path = so_path;
- b->so_handle = nwrap_load_module(so_path);
- b->fns = nwrap_load_module_fns(b);
+
+ if (so_path != NULL) {
+ b->so_handle = nwrap_load_module(so_path);
+ b->fns = nwrap_load_module_fns(b);
+ if (b->fns == NULL) {
+ return false;
+ }
+ } else {
+ b->so_handle = NULL;
+ b->fns = NULL;
+ }
(*num_backends)++;