diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-01-06 06:15:34 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-01-06 06:15:34 +0000 |
commit | cfe7718e9a4a51cf13faf77016231b598b3c248c (patch) | |
tree | d5d63df3257e5204aa3e119cef03e95ba1e6a417 /source3/smbd/vfs.c | |
parent | 9bc442abeb62c0a9985b43cf8475027ced7ec777 (diff) | |
download | samba-cfe7718e9a4a51cf13faf77016231b598b3c248c.tar.gz samba-cfe7718e9a4a51cf13faf77016231b598b3c248c.tar.bz2 samba-cfe7718e9a4a51cf13faf77016231b598b3c248c.zip |
Fix a segfault when we don't correctly load a VFS module (don't keep it in
the loaded list on error). Also change some of the error returns, becouse
NT_STATUS_UNSUCCESSFUL gives a most useless error message on the client.
As for which error, my logic is that a share without a valid VFS module is
not a valid share, and therefore should return the same error as a non-existant
share.
Andrew Bartlett
(This used to be commit 41178afdbd2b3de94cf272ce32764a1947e73ea8)
Diffstat (limited to 'source3/smbd/vfs.c')
-rw-r--r-- | source3/smbd/vfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 7b8d9d7e9e..de7b90df72 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -164,6 +164,7 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object) if (init_fptr == NULL) { DEBUG(0, ("No vfs_init() symbol found in %s\n", vfs_object)); + sys_dlclose(conn->vfs_private->handle); return False; } @@ -171,12 +172,14 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object) if ((ops = init_fptr(&vfs_version, &conn->vfs_ops, conn->vfs_private)) == NULL) { DEBUG(0, ("vfs_init() function from %s failed\n", vfs_object)); + sys_dlclose(conn->vfs_private->handle); return False; } if ((vfs_version < SMB_VFS_INTERFACE_CASCADED)) { DEBUG(0, ("vfs_init() returned wrong interface version info (was %d, should be no less than %d)\n", vfs_version, SMB_VFS_INTERFACE_VERSION )); + sys_dlclose(conn->vfs_private->handle); return False; } @@ -184,6 +187,7 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object) DEBUG(0, ("Warning: vfs_init() states that module confirms interface version #%d, current interface version is #%d.\n\ Proceeding in compatibility mode, new operations (since version #%d) will fallback to default ones.\n", vfs_version, SMB_VFS_INTERFACE_VERSION, vfs_version )); + sys_dlclose(conn->vfs_private->handle); return False; } @@ -249,6 +253,8 @@ BOOL smbd_vfs_init(connection_struct *conn) DEBUG(0, ("smbd_vfs_init: vfs_init_custom failed for %s\n", vfs_module)); string_free(&vfsobj); SAFE_FREE(vfs_module); + DLIST_REMOVE(conn->vfs_private, handle); + SAFE_FREE(handle); return False; } SAFE_FREE(vfs_module); |