Inconsistency in calls to SMB_VFS_STAT ...

Jeremy Allison jra at samba.org
Tue Apr 14 10:58:23 MDT 2015


On Tue, Apr 14, 2015 at 09:52:20AM -0700, Richard Sharpe wrote:
> Hi folks,
> 
> When helping someone who is doing a VFS module recently, I noticed an
> inconsistency in the what that SMB_VFS_STAT is called:
> 
> 1. When a share is first connected to, Samba calls SMB_VFS_STAT on the
> absolute path that the share is declared to be at.
> 
> 2. On all other cases (I believe) it is called with a pathname that
> relative to the root of the share.
> 
> I can document this in the VFS documentation, but it would be nice,
> perhaps to have a flag passed to stat that tells the module writer if
> the current call is for Samba's internal purposes (absolute path name)
> or for a user request (relative path name ).
> 
> Does anyone have any strong feelings about this either way?

That's a bug. We should chdir() to the share root, then
call SMB_VFS_STAT on the relative path.

We should *never* be calling SMB_VFS_STAT on an absolute
path.


More information about the samba-technical mailing list