[PATCH 11/12] build: Removed duplicated code form s3/torture

Andrew Bartlett abartlet at samba.org
Tue Oct 9 15:24:56 MDT 2012


On Tue, 2012-10-09 at 22:59 +0200, Andrzej Hajda wrote:
> Signed-off-by: Andrzej Hajda <andrzej.hajda at wp.pl>
> ---
>  source3/torture/torture.c |   32 --------------------------------
>  source3/wscript_build     |    1 +
>  2 files changed, 1 insertion(+), 32 deletions(-)
> 
> diff --git a/source3/torture/torture.c b/source3/torture/torture.c
> index 0cca680..f952301 100644
> --- a/source3/torture/torture.c
> +++ b/source3/torture/torture.c
> @@ -298,38 +298,6 @@ terminate_path_at_separator(char * path)
>  	return NULL;
>  }
>  
> -/*
> -  parse a //server/share type UNC name
> -*/
> -bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
> -		      char **hostname, char **sharename)
> -{
> -	char *p;
> -
> -	*hostname = *sharename = NULL;
> -
> -	if (strncmp(unc_name, "\\\\", 2) &&
> -	    strncmp(unc_name, "//", 2)) {
> -		return False;
> -	}
> -
> -	*hostname = talloc_strdup(mem_ctx, &unc_name[2]);
> -	p = terminate_path_at_separator(*hostname);
> -
> -	if (p && *p) {
> -		*sharename = talloc_strdup(mem_ctx, p);
> -		terminate_path_at_separator(*sharename);
> -	}
> -
> -	if (*hostname && *sharename) {
> -		return True;
> -	}
> -
> -	TALLOC_FREE(*hostname);
> -	TALLOC_FREE(*sharename);
> -	return False;
> -}
> -
>  static bool torture_open_connection_share(struct cli_state **c,
>  				   const char *hostname, 
>  				   const char *sharename)
> diff --git a/source3/wscript_build b/source3/wscript_build
> index c4cb3c1..4b20cb9 100755
> --- a/source3/wscript_build
> +++ b/source3/wscript_build
> @@ -1441,6 +1441,7 @@ bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3,
>  		 NDR_OPEN_FILES
>  		 idmap
>                   UTIL_LSARPC
> +                 LIBCLI_SMB
>                   ''',
>                   vars=locals())

This looks reasonable at first glance, until you notice that LIBCLI_SMB
is declared in source4/libcli/wscript_build and if there was a header
declaration for this function, it would conflict with the static
declaration you just removed.

Did this really build without any more errors?

Additionally, it clearly wouldn't build in autoconf.  You need to ensure
the build under source3 also passes for all these changes, and either
propose skipping some binaries there (this would need discussion) or fix
it.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list