Re: Portability: common-src/glib-util.c

Jean-Louis Martineau <[email protected]>
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
Eric,

Thanks for the patch, I committed it.

Jean-Louis

On 02/01/17 02:45 PM, Eric Schnoebelen wrote:
> Issue: Attempting to use libcurl macros when libcurl was not
> configured on the system in common-src/glib-util.c
>
> Solution: Make sure to use the feature test macro for LIBCURL
> before trying to use either the GNUTLS or OPENSSL feature test
> macros.
>
> patch included in line and as an attachment
>
>
> $NetBSD$
>
> confirm we HAVE_LIBCURL before using LIBCURL_USE_OPENSSL, as the latter
> is defined if curl is found on the system, but libcurl was not
> configured.
>
> --- common-src/glib-util.c.orig	2016-09-29 16:18:52.000000000 +0000
> +++ common-src/glib-util.c
> @@ -36,7 +36,7 @@
>   #include <curl/curl.h>
>   #endif
>   
> -#if defined LIBCURL_USE_OPENSSL || defined SSL_SECURITY
> +#if (defined HAVE_LIBCURL && defined LIBCURL_USE_OPENSSL) || defined SSL_SECURITY
>   #include <openssl/crypto.h>
>   #include <openssl/ssl.h>
>   #if OPENSSL_VERSION_NUMBER < 0x10100000L
> @@ -74,7 +74,7 @@ init_openssl(void)
>   
>   #endif /* LIBCURL_USE_OPENSSL */
>   
> -#if defined LIBCURL_USE_GNUTLS_GCRYPT
> +#if defined HAVE_LIBCURL && defined LIBCURL_USE_GNUTLS_GCRYPT
>   
>   #include <gcrypt.h>
>   #include <errno.h>
> @@ -97,10 +97,10 @@ static void
>   init_ssl(void)
>   {
>   
> -#if defined LIBCURL_USE_OPENSSL || defined SSL_SECURITY
> +#if (defined HAVE_LIBCURL && defined LIBCURL_USE_OPENSSL) || defined SSL_SECURITY
>       init_openssl();
>   #endif
> -#if defined LIBCURL_USE_GNUTLS_GCRYPT
> +#if defined HAVE_LIBCURL && defined LIBCURL_USE_GNUTLS_GCRYPT
>       init_gnutls_gcrypt();
>   #endif
>   }
>

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.