VFS module in HEAD

Michael H Buselli busellim at pprd.abbott.com
Thu Aug 2 22:18:24 GMT 2001


REYNAUD Jean-Samuel said:

> But the compilation don't work:
> $ make skel.so
> libtool gcc  -I../../source -I../../source/include -I../../source/ubiqx
> -I../../source/smbwrapper -Wall -g -c skel.c
> gcc -I../../source -I../../source/include -I../../source/ubiqx
> -I../../source/smbwrapper -Wall -g -c skel.c  -fPIC -DPIC -o
> .libs/skel.o
> skel.c:154: conflicting types for `vfs_init'
> ../../source/include/proto.h:4483: previous declaration of `vfs_init'
> make: *** [skel.lo] Erreur 1
> 
> the module's vfs_init prototype conflict with the proto.h's vfs_init
> prototype.
> 
> In fact, the smbd/vfs.c's vfs_init function had the prototype:
> BOOL vfs_init(connection_struct *conn)
> 
> Perhaps, the solution is to change the vfs_init function name for
> modules (example : vfs_init_module...)

I would prefer changing the name of the vfs_init function inside
smbd/vfs.c to vfs_init_internal because if we do it the way you propose
then when we have a version mismatch on VFS modules the error message
will indicate a missing symbol in the VFS module, not a simple version
mismatch.

> So the vfs.c's loading become:
> init_fptr = (struct vfs_ops *(*)(int *, struct vfs_ops
> *))sys_dlsym(conn->dl_handle, "vfs_init_module");

Or we can do it your way and add special error handling code:

=======
    init_fptr = (struct vfs_ops *(*)(int *, struct vfs_ops*))sys_dlsym(conn->dl_handle, "vfs_init_module");

    /* To catch old versions of VFS modules so we have appropriate error
     * messages.
     */
    if (init_fptr == NULL) {
        init_fptr = (struct vfs_ops *(*)(int *, struct vfs_ops*))sys_dlsym(conn->dl_handle, "vfs_init");
    }

    /* Still NULL?  Must not be a correct VFS module. */
    if (init_fptr == NULL) {
        DEBUG(0, ("No vfs_init_module() symbol found in %s\n",
          lp_vfsobj(SNUM(conn))));
        return False;
    }
=======

Just my $0.025.  I mention this as a preference, and not something that
I feel hard-core about.

--
Michael H. Buselli
Senior Network Systems Specialist            Abbott Laboratories
Email: busellim at pprd.abbott.com              D472/AP9A-L20
Phone: 847-935-4624                          100 Abbott Park Road
Fax: 847-935-0142                            Abbott Park, IL  60064-3500




More information about the samba-technical mailing list