[pgpool-hackers: 3645] Re: 答复: error of LDAP authentication from [pgpool-hackers:3538]

Takuma Hoshiai hoshiai at sraoss.co.jp
Thu Jun 11 15:53:21 JST 2020


On Wed, 10 Jun 2020 08:37:07 +0000
周建身 <zhoujianshen at highgo.com> wrote:

> Hello Takuma Hoshiai,
>     I did the patch of pgpool_ldap_auth_v2.patch you send  in this email.then I tried to do ldap authentication as I did with postgresql. But I got a segmentation fault.
> I tried to find out why this happened. I find that postgresql has Macro definition of HAVE_LDAP_INITIALIZE,but pgpool does not have.I think there may be still two problem remains.
> 1、do config
> ./configure --prefix=/opt/pgpool --with-pgsql=/opt/PG12 --with-ldap
> --with-ldap parameter do not enable precompilation of #ifdef HAVE_LDAP_INITIALIZE
> 
> 2、there is a spelling error in program.
> ldap_dn2domain(frontdend->pool_hba->ldapbasedn, &domain) should be 
> ldap_dn2domain(frontend->pool_hba->ldapbasedn, &domain) 

Thank you for testing this patch.
I will add its precomplication in configure.ac, and fix this typo.

> after defining HAVE_LDAP_INITIALIZE manually in program and correct spelling error,then I can connect to pgpool through ldap authentication.

That's great!

> can you review this problem?

Sure.
I will check it.


Best Regards,
Takuma Hoshiai

> Thanks
> Best regards
> Zhoujianshen
> zhoujianshen at highgo.com
> ________________________________________
> 发件人: Takuma Hoshiai <hoshiai at sraoss.co.jp>
> 发送时间: 2020年4月21日 16:31
> 收件人: 周建身
> 抄送: pgpool-hackers; Muhammad; 吕昊凌
> 主题: Re: error of LDAP authentication from [pgpool-hackers:3538]
> 
> Hello
> 
> Thank you for letting me know.
> After checking, I find out this problem. It happend when --with-ldap and
> --with-pam options were not used together.
> 
> I have attached fixed patch for this problem.
> Please try again with this patch.
> 
> Best Regards,
> Takuma Hoshiai
> 
> On Tue, 21 Apr 2020 02:17:39 +0000
> 周建身 <zhoujianshen at highgo.com> wrote:
> 
> > Hello
> >
> >
> >     Under the directory of pgpool,I did the patch of LDAP authentication from [pgpool-hackers:3538].
> >
> > The patched command which I used is,patch -p1 < pgpool_ldap_auth.patch.I got pgpool_ldap_auth.patch from [pgpool-hackers:3538].
> >
> >
> >
> > The patched results are as follows
> >
> >
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file configure.ac
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file doc.ja/src/sgml/client-auth.sgml
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file doc/src/sgml/client-auth.sgml
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file src/auth/pool_auth.c
> >
> > (Stripping trailing ?CRs from patch; use --binary to disable.)
> >
> > patching file src/auth/pool_hba.c
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file src/include/auth/pool_hba.h
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file src/include/config.h.in
> >
> > (Stripping trailing CRs from patch; use --binary to disable.)
> >
> > patching file src/pgpool.spec
> >
> > patch unexpectedly ends in middle of line
> >
> > Hunk #1 succeeded at 103 with fuzz 1.
> >
> >
> >
> > I follow the guidelines to do next operation.
> >
> >
> >
> >  $ autoheader
> >
> >  $ aclocal
> >
> >  $ automake -a -c
> >
> >  $ autoconf
> >
> >
> >
> > Then,I did the configure.
> >
> >
> >
> > ./configure --prefix=/opt/pgpool_3 --with-pgsql=/opt/PG12
> >
> >
> >
> > Then I did the make operation which result in errors.
> >
> >
> >
> > auth/pool_hba.c:758:33: error: 'uaLDAP' undeclared (first use in this function); did you mean 'uaMD5'?
> >
> >   if (parsedline->auth_method == uaLDAP)
> >
> >                                  ^~~~~~
> >
> >                                  uaMD5
> >
> > auth/pool_hba.c:758:33: note: each undeclared identifier is reported only once for each function it appears in
> >
> > auth/pool_hba.c: In function 'parse_hba_auth_opt':
> >
> > auth/pool_hba.c:895:23: error: 'uaLDAP' undeclared (first use in this function); did you mean 'uaMD5'?
> >
> >    REQUIRE_AUTH_OPTION(uaLDAP, "ldapurl", "ldap");
> >
> >                        ^
> >
> > auth/pool_hba.c:320:30: note: in definition of macro 'REQUIRE_AUTH_OPTION'
> >
> >   if (hbaline->auth_method != methodval) \
> >
> >                               ^~~~~~~~~
> >
> > Makefile:800: recipe for target 'auth/pool_hba.o' failed
> >
> >
> >
> >
> >
> > I also did another configure.
> >
> >  ./configure --prefix=/opt/pgpool_3 --with-pgsql=/opt/PG12 --with-ldap
> >
> >
> >
> > Then I did the make operation which result in other errors.
> >
> >
> >
> > auth/pool_hba.o: In function `CheckLDAPAuth':
> >
> > /auth/pool_hba.c:2623: undefined reference to `recv_password_packet'
> >
> > collect2: error: ld returned 1 exit status
> >
> > Makefile:777: recipe for target 'pgpool' failed
> >
> > make[2]: *** [pgpool] Error 1
> >
> > make[2]: Leaving directory '/home/zhoujianshen/pgpool-II-4.1.1/src'
> >
> > Makefile:866: recipe for target 'all-recursive' failed
> >
> > make[1]: *** [all-recursive] Error 1
> >
> > make[1]: Leaving directory '/home/zhoujianshen/pgpool-II-4.1.1/src'
> >
> > Makefile:410: recipe for target 'all-recursive' failed
> >
> > make: *** [all-recursive] Error 1
> >
> >
> >
> > Could you please help me checkout what result these errors,thanks.
> >
> >
> >
> > Thanks
> > Best regards
> > Jianshen Zhou
> >
> 
> 
> --
> Takuma Hoshiai <hoshiai at sraoss.co.jp>


-- 
Takuma Hoshiai <hoshiai at sraoss.co.jp>



More information about the pgpool-hackers mailing list