summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-06 21:44:33 +0000
committerJeremy Allison <jra@samba.org>2000-11-06 21:44:33 +0000
commit6d36edaf437a9d109fe3bfff26c9f6a3b584aaf6 (patch)
treececea73e47e68eafd505e13ad31ed4805f0236f4 /source3/smbd/vfs.c
parentaae30b679981e019aa36d83beff83d30b937a16d (diff)
downloadsamba-6d36edaf437a9d109fe3bfff26c9f6a3b584aaf6.tar.gz
samba-6d36edaf437a9d109fe3bfff26c9f6a3b584aaf6.tar.bz2
samba-6d36edaf437a9d109fe3bfff26c9f6a3b584aaf6.zip
Added a VFS version return to init call. Allows smbd to fail an init if
versions don't match. Jeremy. (This used to be commit d0fbb4f5d999abade8930cc6fff231a2af6cccfb)
Diffstat (limited to 'source3/smbd/vfs.c')
-rw-r--r--source3/smbd/vfs.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 2f984aee4f..99c8e26fa8 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -94,7 +94,8 @@ int vfs_init_default(connection_struct *conn)
#ifdef HAVE_LIBDL
BOOL vfs_init_custom(connection_struct *conn)
{
- struct vfs_ops *ops, *(*fptr)(struct vfs_options *options);
+ int vfs_version = -1;
+ struct vfs_ops *ops, *(*init_fptr)(int *);
DEBUG(3, ("Initialising custom vfs hooks from %s\n",
lp_vfsobj(SNUM(conn))));
@@ -108,22 +109,27 @@ BOOL vfs_init_custom(connection_struct *conn)
/* Get handle on vfs_init() symbol */
- fptr = (struct vfs_ops *(*)(struct vfs_options *))
- dlsym(conn->dl_handle, "vfs_init");
+ init_fptr = (struct vfs_ops *(*)(int *))dlsym(conn->dl_handle, "vfs_init");
- if (fptr == NULL) {
- DEBUG(0, ("No vfs_init() symbol found in %s\n",
+ if (init_fptr == NULL) {
+ DEBUG(0, ("No vfs_init() symbol found in %s\n",
lp_vfsobj(SNUM(conn))));
- return False;
+ return False;
}
/* Initialise vfs_ops structure */
- if ((ops = fptr(NULL)) == NULL) {
+ if ((ops = init_fptr(&vfs_version)) == NULL) {
DEBUG(0, ("vfs_init function from %s failed\n", lp_vfsobj(SNUM(conn))));
- return False;
+ return False;
}
+ if (vfs_version != SMB_VFS_INTERFACE_VERSION) {
+ DEBUG(0, ("vfs_init returned wrong interface version info (was %d, should be %d)\n",
+ vfs_version, SMB_VFS_INTERFACE_VERSION ));
+ return False;
+ }
+
/* Fill in unused operations with default (disk based) ones.
There's probably a neater way to do this then a whole bunch of
if statements. */