summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-04-29 16:33:45 +0200
committerMichael Adam <obnox@samba.org>2009-04-29 16:48:22 +0200
commit8aa41bdeb21d087cba1ab20bd2a4bd69cd519881 (patch)
treeef8eeebf37203ad1119339d51e96b1b363edb26e /source3
parent3316ae9d75dfe6c7a960938c9503367880510079 (diff)
downloadsamba-8aa41bdeb21d087cba1ab20bd2a4bd69cd519881.tar.gz
samba-8aa41bdeb21d087cba1ab20bd2a4bd69cd519881.tar.bz2
samba-8aa41bdeb21d087cba1ab20bd2a4bd69cd519881.zip
s3:vfs: untangle logic for loading and probing modules in vfs_init_custom()
This is to be able to provide more specific error messages. Michael
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/vfs.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 426772889c..f219e5554c 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -161,18 +161,30 @@ bool vfs_init_custom(connection_struct *conn, const char *vfs_object)
}
/* First, try to load the module with the new module system */
- if((entry = vfs_find_backend_entry(module_name)) ||
- (NT_STATUS_IS_OK(smb_probe_module("vfs", module_path)) &&
- (entry = vfs_find_backend_entry(module_name)))) {
-
- DEBUGADD(5,("Successfully loaded vfs module [%s] with the new modules system\n", vfs_object));
-
- if ((ops = entry->vfs_op_tuples) == NULL) {
- DEBUG(0, ("entry->vfs_op_tuples==NULL for [%s] failed\n", vfs_object));
+ entry = vfs_find_backend_entry(module_name);
+ if (!entry) {
+ NTSTATUS status;
+
+ DEBUG(5, ("vfs module [%s] not loaded - trying to load...\n",
+ vfs_object));
+
+ status = smb_probe_module("vfs", module_path);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("error probing vfs module '%s': %s\n",
+ module_path, nt_errstr(status)));
+ goto fail;
+ }
+
+ entry = vfs_find_backend_entry(module_name);
+ if (!entry) {
+ DEBUG(0,("Can't find a vfs module [%s]\n",vfs_object));
goto fail;
- }
- } else {
- DEBUG(0,("Can't find a vfs module [%s]\n",vfs_object));
+ }
+ }
+
+ DEBUGADD(5,("Successfully loaded vfs module [%s] with the new modules system\n", vfs_object));
+ if ((ops = entry->vfs_op_tuples) == NULL) {
+ DEBUG(0, ("entry->vfs_op_tuples==NULL for [%s] failed\n", vfs_object));
goto fail;
}