[PATCH] Remove redundant protocol dialect check

Jeremy Allison jra at samba.org
Tue Jun 12 22:38:45 UTC 2018


On Tue, Jun 12, 2018 at 03:00:55PM +0530, Anoop C S via samba-technical wrote:
> Hi,
> 
> Please find the attached patch which removes a duplicate check inside cli_smb2_rmdir().
> 
> Reviews are appreciated.

All of the functions of the form cli_smb2_XXX() perform this
check, as they are externally visible outside this module and
can be called from different places.

I'd prefer to keep the existing check here just to keep them
internally consistent.

Jeremy.

> From ca76a89187ea9c68940359d7029874f74db8be67 Mon Sep 17 00:00:00 2001
> From: Anoop C S <anoopcs at redhat.com>
> Date: Tue, 12 Jun 2018 12:21:36 +0530
> Subject: [PATCH] s3/libsmb: Remove redundant protocol dialect check
> 
> cli_smb2_rmdir() is only invoked from cli_rmdir() after making sure that
> the protocol dialect is >= PROTOCOL_SMB2_02. Thus a similar check inside
> cli_smb2_rmdir() is redundant.
> 
> Signed-off-by: Anoop C S <anoopcs at redhat.com>
> ---
>  source3/libsmb/cli_smb2_fnum.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
> index 1eb1bea7a72..36a1b8d7cef 100644
> --- a/source3/libsmb/cli_smb2_fnum.c
> +++ b/source3/libsmb/cli_smb2_fnum.c
> @@ -671,10 +671,6 @@ NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dname)
>  		return NT_STATUS_INVALID_PARAMETER;
>  	}
>  
> -	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
> -		return NT_STATUS_INVALID_PARAMETER;
> -	}
> -
>  	status = cli_smb2_create_fnum(cli,
>  			dname,
>  			0,			/* create_flags */
> -- 
> 2.17.1
> 




More information about the samba-technical mailing list