Changing the pathname in a transparent VFS layer

Jeremy Allison jra at
Fri Sep 23 18:03:46 GMT 2005

On Fri, Sep 23, 2005 at 11:59:10AM -0600, Cam Macdonell wrote:
> Hi,
> I'm currently writing a VFS module that changes path name of a file. One
> problem I am having is that if I change the file name from 'foo' to 'bar' I
> can only read as much data that is equal to the size of 'foo'.
> To explain: If foo is 50 bytes and bar is 100 bytes and the pathname is
> changed in the module from 'foo' to 'bar' when the file is opened, an
> application can only read the first 50 bytes of bar.
> Logging shows the server reports the proper size of bar. Does anyone know
> why this could be happening? Is it a client issue?

I think you're going to have to also replace the stat() and fstat()
calls as well as open() to ensure that the correct file is accessed.

In fact all pathname calls will have to be hooked if you're wanting
to change names on the fly.


More information about the samba-technical mailing list