qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] vnc: avoid deprecation warnings for SASL on OS X


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] vnc: avoid deprecation warnings for SASL on OS X
Date: Fri, 4 Jun 2021 15:07:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 6/4/21 2:09 PM, Paolo Bonzini wrote:
> Apple has deprecated sasl.h functions in OS X 10.11.  Therefore,
> all files that use SASL API need to disable -Wdeprecated-declarations.
> Remove the only use that is outside vnc-auth-sasl.c and add the
> relevant #pragma GCC diagnostic there.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  ui/vnc-auth-sasl.c | 20 ++++++++++++++++++++
>  ui/vnc-auth-sasl.h |  1 +
>  ui/vnc.c           | 10 ++--------
>  3 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c
> index df7dc08e9f..cf65a0b161 100644
> --- a/ui/vnc-auth-sasl.c
> +++ b/ui/vnc-auth-sasl.c
> @@ -28,10 +28,30 @@
>  #include "vnc.h"
>  #include "trace.h"
>  
> +/*
> + * Apple has deprecated sasl.h functions in OS X 10.11.  Therefore,
> + * files that use SASL API need to disable -Wdeprecated-declarations.
> + */
> +#ifdef CONFIG_DARWIN
> +#pragma GCC diagnostic warning "-Wdeprecated-declarations"
> +#endif
> +
>  /* Max amount of data we send/recv for SASL steps to prevent DOS */
>  #define SASL_DATA_MAX_LEN (1024 * 1024)
>  
>  
> +bool vnc_sasl_server_init(Error **errp)
> +{
> +    int saslErr = sasl_server_init(NULL, "qemu");

What is the plan once these functions are removed for the
distribution? Is there a replacement or should we start warning
the users here and in docs/system/deprecated.rst VNC/SASL will
go away soon?

> +    if (saslErr != SASL_OK) {
> +        error_setg(errp, "Failed to initialize SASL auth: %s",
> +                   sasl_errstring(saslErr, NULL, NULL));
> +        return false;
> +    }
> +    return true;
> +}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]