Skip to contentSkip to conversation

autofs-5.1.9 - fix ldap_parse_page_control() check

PATCH In review David Disseldorp 3 participants 6 messages Mar 20, 2024 – Apr 17, 2024 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autofs-5.1.9 - fix ldap_parse_page_control() check

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((

---
 aclocal.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
aclocal.m4 +1 -1
index 1046d72..fa18eb1 100644
@@ -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); ]])],
Signature · 1 line
2.35.3
maintainer
#1 lore raw
Quoted 28 lines · 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((

---
  aclocal.m4 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
aclocal.m4 +0 -0
index 1046d72..fa18eb1 100644

aclocal.m4 AC_LINK_IFELSE( · line 430

Quoted 8 lines
aclocal.m4 +1 -1
@@ -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); ]])],

Thanks David, looks ok to me, will have a closer look and (I expect) will apply it.

Ian

#2 lore raw
Quoted 1 line · Ian Kent

On 20/3/24 08:59, David Disseldorp wrote:

...

Quoted 9 lines

aclocal.m4 AC_LINK_IFELSE( · line 430

Quoted 5 lines
aclocal.m4 +1 -1
-      struct berval *c;
+      struct berval **c;
        int ret;
        LDAPControl **clp;
        ret = ldap_parse_page_control(ld,clp,ct,c); ]])],  

Thanks David, looks ok to me, will have a closer look and (I expect) will apply it.

Thanks for the feedback Ian. Is there anything holding this one up from being merged?

Cheers, David

maintainer
#3 lore raw
Quoted 10 lines · David Disseldorp
Quoted 1 line · Ian Kent

On 20/3/24 08:59, David Disseldorp wrote:

...

Quoted 6 lines
Quoted 5 lines
aclocal.m4 +1 -1
-      struct berval *c;
+      struct berval **c;
         int ret;
         LDAPControl **clp;
         ret = ldap_parse_page_control(ld,clp,ct,c); ]])],
Quoted 4 lines
Quoted 2 lines

Thanks David, looks ok to me, will have a closer look and (I expect) will apply it.

Thanks for the feedback Ian. Is there anything holding this one up from being merged?

No, only me, actually I want to do a release but (just a couple of days ago) I was thinking I need

to push this and a couple of other patches to the repo. before I start the round of testing.

I have a bit to do (unrelated to this) before I get to it so sorry for the hold up.

Ian

Reviewed-by on v1 1/1
#4 lore raw
In reply to David Disseldorp

Dear David,

Thank you for your patch.

Am 20.03.24 um 01:59 schrieb David Disseldorp:

Quoted 14 lines

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:
Quoted 3 lines

/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

Quoted 10 lines
---
  aclocal.m4 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
aclocal.m4 +0 -0
index 1046d72..fa18eb1 100644

aclocal.m4 AC_LINK_IFELSE( · line 430

Quoted 8 lines
aclocal.m4 +1 -1
@@ -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); ]])],

Kind regards,

Paul

#5 lore raw

Hi Paul,

On Wed, 20 Mar 2024 08:51:30 +0100, Paul Menzel wrote:

...

Quoted 8 lines
Quoted 3 lines

/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

I'm fine with it either way, but I think the commit summary should indicate that it's the config-time ldap_parse_page_control() call that's problematic, not the modules/lookup_ldap.c invocation.
@Ian: feel free to update the commit message as you see fit.

...

Quoted 1 line

Thanks for the review!

David