[PATCH] Moving the VFS to struct smb_filename.

Jeremy Allison jra at samba.org
Tue May 30 20:25:17 UTC 2017


On Tue, May 30, 2017 at 09:59:36AM +0200, Ralph Böhme wrote:
> On Mon, May 29, 2017 at 09:47:13PM +0200, Ralph Böhme wrote:
> > On Fri, May 26, 2017 at 04:05:22PM -0700, Jeremy Allison wrote:
> > > Hi all,
> > > 
> > > As promised, this is the first set of patches
> > > that will be migrating *ALL* VFS calls from
> > > 'const char *' -> 'const struct smb_filename *'
> > > for Samba 4.7 (or Samba-5, whatever we decide :-).
> > > 
> > > This first set changes the low-level sys_acl_XXXX()
> > > calls, followed by the XXXattr() calls.
> > > 
> > > It actually cleans up quite a bit of the internal
> > > code now we can simply pass const struct smb_filename
> > > pointers around rather than converting to and
> > > from char * -> struct * and back all the time,
> > > so for each hunk you might see some modification
> > > of some of the calling functions to change from
> > > const char *' -> 'const struct smb_filename * also
> > > if it makes them cleaner.
> > > 
> > > The patch is split into one hunk per VFS
> > > call, so there are currently 8 of them covering:
> > > 
> > > 1). SMB_VFS_SYS_ACL_DELETE_DEF_FILE
> > > 2). SMB_VFS_SYS_ACL_GET_FILE
> > > 3). SMB_VFS_SYS_ACL_BLOB_GET_FILE
> > > 4). SMB_VFS_SYS_ACL_SET_FILE
> > > 5). SMB_VFS_LISTXATTR
> > > 6). SMB_VFS_REMOVEXATTR
> > > 7). SMB_VFS_SETXATTR
> > > 8). SMB_VFS_GETXATTR
> > > 
> > > in turn. Passes local make test. Please
> > > review and push if happy ! Once these
> > > are in I'll start making my way up to
> > > the more complex calls.
> > 
> > processing...
> 
> found a few issues, all fixed in the attached patchset:
> 
> sys_acl_set_file_tdb: not freeing smb_fname from talloc_tos
> solarisacl_sys_acl_set_file: struct smb_filename smb_fname not declared as pointer variable
> vxfs_remove_xattr: missing declaration of struct smb_filename *smb_fname
> vxfs_remove_xattr: use after free of smb_fname when calling vxfs_removexattr_path
> vxfs_set_xattr: use after free of smb_fname when calling SMB_VFS_NEXT_REMOVEXATTR
> vfs_gluster_setxattr: calling glfs_setxattr with smb_fname instead of smb_fname->base_name
> vxfs_set_xattr: call to vxfs_setxattr_path still uses path instead of smb_fname_in->base_name
> 
> Please push if you're happy with the changes.

FYI, I'm happy with your changes, but I need to do one more
go-around before we push these. There's a subtlety I need
to address w.r.t. stripping out the stream_name when doing
cp_smb_filename with a file name that may contain a stream
component when passing to a VFS_SYS_ACL or VFS_XX_XATTR call
which must ignore the stream name (you can't store ACLs or
XATTRS on a stream, they only belong to the main file).

I'll send out an updated patchset once I'm done.

Cheers,

	Jeremy.



More information about the samba-technical mailing list