vfs_init() symbol conflicts in HEAD and SAMBA_2.2 branches

Pieter Hollants pieter at hollants.com
Sun Aug 12 22:47:50 GMT 2001

The Samba VFS interface, defined in source/smbd/vfs.c, looks for a symbol
"vfs_init" in VFS modules which are loaded using the vfs_init_custom()
function call (if HAVE_LIBDL is defined). Accordingly, examples/VFS/audit.c
has been carrying a function vfs_init() since its very beginning. The whole
stuff compiled, because the generated prototypes file,
source/include/proto.h, never contained a prototype for vfs_init().

On Fri Jun 29 22:32:24 2001 UTC, "jra" commited version 1.33 of
source/smbd/vfs.c in the main branch, which brought a new function -- called
vfs_init(), serving as sort of a wrapper for the previous vfs_init_default()
and vfs_init_custom() calls. The problem: "make proto" since then found the
function in source/smbd/vfs.c and accordinly exported a prototype for
vfs_init() into source/include/proto.h. Now examples/VFS/audit.c was
confronted with a not-muching prototype:

 source/include/proto.h said: "BOOL vfs_init(connection_struct *conn)"  (=
the "new" function in source/smbd/vfs.c)
 examples/VFS/audit.c had:    "struct vfs_ops *vfs_init(void)"

This change in source/smbd/vfs.c was ported to the SAMBA_2_2 branch in
version and to the SAMBA_2_2_RELEASE branch in version It is therefore present in the current release

On Wed Aug 1 02:44:50 2001 UTC, "jerry" commited version of
examples/VFS/audit.c with a modified function prototype: "at least these
build now.  Have not tested to see how well they work yet.". As reported
last Wednesday by "Nik Thirty-Nine" this fix didn't work.

We have these two conflicting function prototypes since "jra" commited the
vfs_init() routine in source/smbd/vfs.c. The problem is present in all
current versions/branches of both sources/smbd/vfs.c and

Two possible solutions:
a.) rename vfs_init() to vfs_module_init() or whatever in examples/VFS/* and
change sources/smbd/vfs.c to look for the new symbol
b.) rename vfs_init() in sources/smbd/vfs.c and fix all references (in
source/smbd/service.c and source/msdfs/msdfs.c)

I would suggest to go the a.) route. I have a patch prepared and will post
it after testing it.

More information about the samba-technical mailing list