No luck with VFS module examples

Christian Jaeger christian.jaeger at sl.ethz.ch
Fri Oct 12 10:22:08 GMT 2001


Hello Tim and all

As I've already told you, there has been a prototype conflict
(examples/VFS/audit.c vs. source/includes/proto.h). I've `resolved' it
by changing audit.c to:

BOOL vfs_init(connection_struct *conn)
{
	openlog("smbd_audit", LOG_PID, SYSLOG_FACILITY);
	syslog(SYSLOG_PRIORITY, "VFS_INIT: &audit_ops: 0x%8.8x\n", 
	       &audit_ops);
	conn->vfs_ops= audit_ops;
	return TRUE;
}

This did make it compile. Then at first on trying to load the .so smbd
told me about `undefined symbol: default_vfs_ops'. Well I've managed to
find out that the debian/rules file from the debian package did not
configure --with-vfs, so I changed this, as well as put the necessary
-rdynamic flags into the Makefile (:-( don't even know how to let
debian/rules set this flag - shouldn't it be set by --with-vfs?). Now
smbd loads the .so, but gives:

Oct 12 17:56:29 pflanze smbd_audit[2999]: VFS_INIT: &audit_ops:
0x401733a0 
Oct 12 17:56:29 pflanze smbd_audit[2999]: [2001/10/12 17:56:29, 0]
smbd/vfs.c:vfs_init_custom(143) 
Oct 12 17:56:29 pflanze smbd_audit[2999]:   vfs_init returned wrong
interface version info (was -1, should be 1) 
Oct 12 17:56:29 pflanze smbd_audit[2999]: [2001/10/12 17:56:29, 0]
smbd/vfs.c:vfs_init(277) 
Oct 12 17:56:29 pflanze smbd_audit[2999]:   vfs_init: vfs_init_custom
failed 
Oct 12 17:56:29 pflanze smbd_audit[2999]: [2001/10/12 17:56:29, 0]
smbd/service.c:make_connection(529) 
Oct 12 17:56:29 pflanze smbd_audit[2999]:   vfs_init failed for service
audit

Looking at source/smbd/vfs.c I see the following in vfs_init_custom():

	int vfs_version = -1;
    ...
	
	init_fptr = (struct vfs_ops *(*)(int *))sys_dlsym(conn->dl_handle,
"vfs_init");

	...
	
    if ((ops = init_fptr(&vfs_version)) == NULL) {
        DEBUG(0, ("vfs_init function from %s failed\n",
lp_vfsobj(SNUM(conn))));
		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 ));
	..

so it seems that vfs.c is using the definition that audit.c originally
used...

I should really be able to write my vfs module soon (within the next few
days..).
Hmm, haven't looked at CVS yet. 
(Time passes)

Well, vfs.c rev 1.16.2.23 (SAMBA_2_2) is still the same.
And audit.c rev 1.3.4.2 has the following code:

BOOL vfs_init(connection_struct *conn)
{
	openlog("smbd_audit", LOG_PID, SYSLOG_FACILITY);
	syslog(SYSLOG_PRIORITY, "VFS_INIT: vfs_ops loaded\n");
	return True;
}

And the cvs commit has the comment `at least they build now'. Well yes,
that's where I stand, too :).

Could you give me some hints? Which prototype is supposed to be the
right one? Will it stay that way?

Thanks,
Christian.




More information about the samba-technical mailing list