[PATCH] First step in changing VFS interfaces from const char * to const struct smb_filename *

Jeremy Allison jra at samba.org
Tue Feb 16 16:37:54 UTC 2016


On Sun, Feb 14, 2016 at 09:40:16PM +0100, Ralph Boehme wrote:
> On Sat, Feb 13, 2016 at 08:42:46AM +0100, Ralph Boehme wrote:
> > On Fri, Feb 12, 2016 at 01:20:36PM -0800, Jeremy Allison wrote:
> > > Works fine here in testing. Please review and
> > > push if happy. Once this is in I'll post follow-ups
> > > for the other 'const char *' VFS interfaces.
> > 
> > pushed!
> 
> autobuild failed in vfs_snapper. Fixup for the original patch
> attached. Feel free to fixup and push with my reviewed-by.

Thanks Ralph, that one didn't get built on my system so
I missed it. I said it was one of the most complicated
interfaces :-).

Cheers and thanks, I'll push today !

> 
> -- 
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de,mailto:kontakt@sernet.de

> From 16ada2777b12966cd55f265b615b590ae8ae6a5e Mon Sep 17 00:00:00 2001
> From: Ralph Boehme <slow at samba.org>
> Date: Sun, 14 Feb 2016 21:36:15 +0100
> Subject: [PATCH] FIXUP: s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const
>  struct smb_filename *
> 
> Signed-off-by: Ralph Boehme <slow at samba.org>
> ---
>  source3/modules/vfs_snapper.c | 33 +++++++++++++++++++++++++++------
>  1 file changed, 27 insertions(+), 6 deletions(-)
> 
> diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
> index cd7904c..970373c 100644
> --- a/source3/modules/vfs_snapper.c
> +++ b/source3/modules/vfs_snapper.c
> @@ -2415,6 +2415,7 @@ static NTSTATUS snapper_gmt_fget_nt_acl(vfs_handle_struct *handle,
>  	char *stripped;
>  	NTSTATUS status;
>  	char *conv;
> +	struct smb_filename *smb_fname = NULL;
>  
>  	if (!snapper_gmt_strip_snapshot(talloc_tos(), handle,
>  					fsp->fsp_name->base_name,
> @@ -2431,14 +2432,24 @@ static NTSTATUS snapper_gmt_fget_nt_acl(vfs_handle_struct *handle,
>  	if (conv == NULL) {
>  		return map_nt_error_from_unix(errno);
>  	}
> -	status = SMB_VFS_NEXT_GET_NT_ACL(handle, conv, security_info,
> -					 mem_ctx, ppdesc);
> +
> +	smb_fname = synthetic_smb_fname(talloc_tos(),
> +					conv,
> +					NULL,
> +					NULL);
>  	TALLOC_FREE(conv);
> +	if (smb_fname == NULL) {
> +		return NT_STATUS_NO_MEMORY;
> +	}
> +
> +	status = SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info,
> +					 mem_ctx, ppdesc);
> +	TALLOC_FREE(smb_fname);
>  	return status;
>  }
>  
>  static NTSTATUS snapper_gmt_get_nt_acl(vfs_handle_struct *handle,
> -				       const char *fname,
> +				       const struct smb_filename *fname,
>  				       uint32_t security_info,
>  				       TALLOC_CTX *mem_ctx,
>  				       struct security_descriptor **ppdesc)
> @@ -2447,8 +2458,9 @@ static NTSTATUS snapper_gmt_get_nt_acl(vfs_handle_struct *handle,
>  	char *stripped;
>  	NTSTATUS status;
>  	char *conv;
> +	struct smb_filename *smb_fname = NULL;
>  
> -	if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname,
> +	if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname->base_name,
>  					&timestamp, &stripped)) {
>  		return map_nt_error_from_unix(errno);
>  	}
> @@ -2461,9 +2473,18 @@ static NTSTATUS snapper_gmt_get_nt_acl(vfs_handle_struct *handle,
>  	if (conv == NULL) {
>  		return map_nt_error_from_unix(errno);
>  	}
> -	status = SMB_VFS_NEXT_GET_NT_ACL(handle, conv, security_info,
> -					 mem_ctx, ppdesc);
> +	smb_fname = synthetic_smb_fname(talloc_tos(),
> +					conv,
> +					NULL,
> +					NULL);
>  	TALLOC_FREE(conv);
> +	if (smb_fname == NULL) {
> +		return NT_STATUS_NO_MEMORY;
> +	}
> +
> +	status = SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info,
> +					 mem_ctx, ppdesc);
> +	TALLOC_FREE(smb_fname);
>  	return status;
>  }
>  
> -- 
> 2.5.0
> 




More information about the samba-technical mailing list