Re: [PATCH] autofs-5.1.9 - fix ldap_parse_page_control() check

Paul Menzel <[email protected]>
Newsgroups org.kernel.vger.autofs
Message-ID <[email protected]>
Dear David,


Thank you for your patch.

Am 20.03.24 um 01:59 schrieb David Disseldorp:
> The final @cookie parameter should be a struct berval ** type. The
> check currently fails when -Werror=incompatible-pointer-types is set:
> 
> conftest.c: In function 'main':
> conftest.c:54:47: error: passing argument 4 of 'ldap_parse_page_control'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>     54 |       ret = ldap_parse_page_control(ld,clp,ct,c);
>        |                                               ^
>        |                                               |
>        |                                               struct berval *
> In file included from /usr/include/lber_types.h:24,
>                   from /usr/include/lber.h:29,
>                   from /usr/include/ldap.h:30,
>                   from conftest.c:45:
> /usr/include/ldap.h:2155:25: note: expected 'struct berval **' but
> argument is of type 'struct berval *'
>   2155 | ldap_parse_page_control LDAP_P((

I wouldn’t wrap the lines of the pasted parts, and use a more specific 
commit message summary instead of just *fix … check*. Maybe:

     ldap_parse_page_control(): Use correct type for @cookie

> Signed-off-by: David Disseldorp <[email protected]>
> ---
>   aclocal.m4 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index 1046d72..fa18eb1 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -424,7 +424,7 @@ AC_LINK_IFELSE(
>         #include <ldap.h> ]],
>      [[ LDAP *ld;
>         ber_int_t *ct;
> -      struct berval *c;
> +      struct berval **c;
>         int ret;
>         LDAPControl **clp;
>         ret = ldap_parse_page_control(ld,clp,ct,c); ]])],

Reviewed-by: Paul Menzel <[email protected]>


Kind regards,

Paul
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.