Upgrading old VFS modules

Paul Weaver paul.weaver at bbc.co.uk
Wed Apr 2 18:59:35 GMT 2008


Hi all,

I'm currently trying to update a few VFS modules to compile under a
later version of samba (3.0.26a, then on to 3.0.28a and 3.2 -- I dread
to consider samba 4 at this stage!). They were written for 3.0.23d, I
believe, expecting SMB_VFS_INTERFACE_VERSION 16. The latest interface,
as far as I can tell, is version 21  (unchanged since at least 3.0.26a)
(22 in 3.2)

These are transparent vfs modules. 

Now I'm happy about removing the connection_struct from each method
(v17), and move to using ntimes (v20), but I'm currently stuck on the
change that were brought in in version 18 -- the addition of a
file_struct to SMB_VFS_NEXT_OPEN

The simplest module basically renames a certain file name from "foo.txt"
to "foo_ip_user.txt", while presenting foo.txt to each client.

It does this by changing the "const char *path" in calls like NEXT_OPEN,
effectively :
if (is_a_bad_file($name)) =~ s/$name/$ip_$user_$name/;

It all seems to work when I pass through the files_struct and only
change the fname char, but I'm not 100% convinced that everything is
playing nice. Looking in smb.h, I can see a files_struct is a fairly
complicated struct, so changing it with fsp->fsp_name will probably
cause major problems. 

Is there a method to recreate a files_struct from an fname? Am I barking
up the wrong tree? 

(The modules are from http://ingex.sourceforge.net/MediaHarmony)

The simple module (media_harmony.c) simple presents a file per
machine/user, however there are more complex modules involving
files_struct structs, but before I tackle them I'd like to understand
the struct. Walk before running etc.

I hope this isn't a stupid or inappropriate question

Thanks


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					


More information about the samba-technical mailing list