[PATCH] Re: Implict declaration issue with asan options.

Alexander Bokovoy ab at samba.org
Wed Apr 18 16:30:50 UTC 2018


On ke, 18 huhti 2018, William Brown via samba-technical wrote:
> On Wed, 2018-04-18 at 19:00 +1000, William Brown via samba-technical
> wrote:
> > Hi,
> > 
> > I noticed that my fresh checkout on f27 stopped working with:
> > 
> ...
> > At this point I was quite suspicious - I have eventually worked out
> > the
> > root cause is '--address-sanitizer'. Addition of this option will
> > cause
> > compilation to fail, however I don't understand why.
> > 
> > I have done a make clean, reconfigure, build with and without, and
> > the
> > cause is always --address-sanitizer
> > 
> > Any advice on what could be going on here would be great, as I'm not
> > yet very familiar with waf.
> 
> The attached trivial patch does resolve the issue. 
Could you please split the changes into two commits? They are unrelated
to each other.

Otherwise RB+

> 
> > 
> > Thank you!
> > 
> > William

> From 99237883621b7a7954d0fe4e3364fb8b5d270051 Mon Sep 17 00:00:00 2001
> From: William Brown <william at blackhats.net.au>
> Date: Wed, 18 Apr 2018 19:18:23 +1000
> Subject: [PATCH] ldb_wrap.c missing header, s3/security.c undefined value
> 
> ldb_wrap.c was missing unistd.h causing implicit symbol declaration and error
> during compilation.
> 
> s3/security.c had an NTSTATUS status that was undefined and with the configure
> option --address-sanitizer this caused uninitialised value error.
> 
> Signed-off-by: William Brown <william at blackhats.net.au>
> ---
>  lib/ldb-samba/ldb_wrap.c        | 1 +
>  source3/libgpo/gpext/security.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/ldb-samba/ldb_wrap.c b/lib/ldb-samba/ldb_wrap.c
> index 143e128d5d7..3d3eb8b0cef 100644
> --- a/lib/ldb-samba/ldb_wrap.c
> +++ b/lib/ldb-samba/ldb_wrap.c
> @@ -37,6 +37,7 @@
>  #include "../lib/util/dlinklist.h"
>  #include "lib/util/util_paths.h"
>  #include <tdb.h>
> +#include <unistd.h>
>  
>  #undef DBGC_CLASS
>  #define DBGC_CLASS DBGC_LDB
> diff --git a/source3/libgpo/gpext/security.c b/source3/libgpo/gpext/security.c
> index 29e7bb7c31e..b6b7ca08e62 100644
> --- a/source3/libgpo/gpext/security.c
> +++ b/source3/libgpo/gpext/security.c
> @@ -150,7 +150,7 @@ static NTSTATUS security_process_group_policy(TALLOC_CTX *mem_ctx,
>  					      const struct GROUP_POLICY_OBJECT *deleted_gpo_list,
>  					      const struct GROUP_POLICY_OBJECT *changed_gpo_list)
>  {
> -	NTSTATUS status;
> +	NTSTATUS status = NT_STATUS_OK;
>  	char *unix_path = NULL;
>  	struct gp_inifile_context *ini_ctx = NULL;
>  	const struct GROUP_POLICY_OBJECT *gpo;
> -- 
> 2.14.3
> 


-- 
/ Alexander Bokovoy



More information about the samba-technical mailing list