On Thu, Aug 08, 2013 at 09:23:41AM +0200, Lukas Slebodnik wrote:
On (08/08/13 09:02), Ondrej Kos wrote:
>On 08/08/2013 02:02 AM, Simo Sorce wrote:
>>On Thu, 2013-08-08 at 00:15 +0200, Pavel Březina wrote:
>>>On 08/07/2013 03:40 PM, Ondrej Kos wrote:
>>>>Hi,
>>>>
>>>>While working on another issue, I noticed a warning in recently added
>>>>code (commit fb945a2c). On F18 the build works fine, but not on F19.
>>>>This is caused by the change of cyrus-sasl API, they changed the
>>>>*sasl_callback_t* callback member from
>>>>int (*proc)();
>>>>to
>>>>int (*proc)(void);
>>>>
>>>>Attached patch adds typedef for propper cast and fixes the issue.
>>>>
>>>>Ondra
>>>
>>>Hi,
>>>minor nack. Please append _t to the name to imply it's a #typedef and
>>>prefix it with sss_ to avoid possible conflict with future sasl API.
>>
>>Actually the _t suffix is now reserved and shouldn't be used.
>>I agree with the prefix.
>>
>>I would call it sss_sasl_gen_cb_fn, so make it clear it is a function.
>>
>>Simo.
>>
>Thanks for the notes, new patch is attached.
>
>Ondra
>
>--
>Ondrej Kos
>Associate Software Engineer
>Identity Management - SSSD
>Red Hat Czech
>From e1708a9155e2ea484d851ea8eabd4d487764a60c Mon Sep 17 00:00:00 2001
>From: Ondrej Kos <okos(a)redhat.com>
>Date: Wed, 7 Aug 2013 15:18:31 +0200
>Subject: [PATCH] AD: Cast SASL callbacks to propper type
>
>The initialization of ad_sasl_callbacks raised an incompatible pointer
>type warning. This was caused because the cyrus-sasl API hasa changed.
>The callback function list needs to be cast now.
>---
> src/providers/ad/ad_init.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
>index
ef39eaf747dccd8d22e147ad50383a780b5b0375..816d12f062f0331e6f69256d121ef6776eaa89c5 100644
>--- a/src/providers/ad/ad_init.c
>+++ b/src/providers/ad/ad_init.c
>@@ -88,8 +88,10 @@ static int ad_sasl_getopt(void *context, const char *plugin_name,
> return SASL_OK;
> }
>
>+typedef int (*sss_sasl_gen_cb_fn)(void);
>+
> static const sasl_callback_t ad_sasl_callbacks[] = {
>- { SASL_CB_GETOPT, ad_sasl_getopt, NULL },
>+ { SASL_CB_GETOPT, (sss_sasl_gen_cb_fn)ad_sasl_getopt, NULL },
> { SASL_CB_LIST_END, NULL, NULL }
> };
> /* This is quite a hack, we *try* to fool openldap libraries by initializing
>--
>1.8.1.4
>
I can compile sssd with -Werror. (fedora 19)
ACK
Pushed to master and sssd-1-10