[lxc-devel] [PATCH] ensure gnutls is initialized before use

Stéphane Graber stgraber at ubuntu.com
Tue Oct 8 16:47:24 UTC 2013


On Tue, Oct 08, 2013 at 12:22:57PM -0400, Dwight Engen wrote:
> Section 7.1.2 of the gnutls info manual states that it must be
> initialized with a call to gnutls_global_init before use. This
> fixes the syslog warning I was seeing:
> 
>   lxc-create: Libgcrypt warning: missing initialization -
>               please fix the application
> 
> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/utils.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/lxc/utils.c b/src/lxc/utils.c
> index dc94a3c..12ed454 100644
> --- a/src/lxc/utils.c
> +++ b/src/lxc/utils.c
> @@ -426,6 +426,13 @@ static inline int lock_fclose(FILE *f)
>  #if HAVE_LIBGNUTLS
>  #include <gnutls/gnutls.h>
>  #include <gnutls/crypto.h>
> +
> +__attribute__((constructor))
> +static void gnutls_lxc_init(void)
> +{
> +	gnutls_global_init();
> +}
> +
>  int sha1sum_file(char *fnam, unsigned char *digest)
>  {
>  	char *buf;
> -- 
> 1.8.1.4
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131008/8565f821/attachment.pgp>


More information about the lxc-devel mailing list