Getting error message with latest PG source on Windows.
Hi,
I am getting the following error message when trying to build latest
PG source on Windows,
Error 1 error C2065: 'LDAP_NO_ATTRS' : undeclared identifier
C:\Users\ashu\pgsql\src\backend\libpq\auth.c 2468
I think, it got introduced in the following git commit,
commit 83aaac41c66959a3ebaec7daadc4885b5f98f561
Author: Peter Eisentraut <peter_e@gmx.net>
Date: Tue Sep 12 09:46:14 2017 -0400
Allow custom search filters to be configured for LDAP auth.
Please ignore this email if this issue has already been reported.
--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Sep 13, 2017 at 8:58 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
I am getting the following error message when trying to build latest
PG source on Windows,Error 1 error C2065: 'LDAP_NO_ATTRS' : undeclared identifier
C:\Users\ashu\pgsql\src\backend\libpq\auth.c 2468I think, it got introduced in the following git commit,
commit 83aaac41c66959a3ebaec7daadc4885b5f98f561
Author: Peter Eisentraut <peter_e@gmx.net>
Date: Tue Sep 12 09:46:14 2017 -0400Allow custom search filters to be configured for LDAP auth.
Please ignore this email if this issue has already been reported.
Hmm. LDAP_NO_ATTRS was an addition to the patch discussed here:
/messages/by-id/7fcac549-0051-34c8-0d62-63b921029f20@2ndquadrant.com
Googling around I see some indications that the macro may not be
defined in all implementations and that some other projects test if
it's defined:
It looks like that's OK because it's required to have the value "1.1":
https://tools.ietf.org/html/rfc4511
3. A list containing only the OID "1.1" indicates that no
attributes are to be returned. If "1.1" is provided with other
attributeSelector values, the "1.1" attributeSelector is
ignored. This OID was chosen because it does not (and can not)
correspond to any attribute in use.
It seems like we need to do that.
--
Thomas Munro
http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Sep 13, 2017 at 9:11 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
On Wed, Sep 13, 2017 at 8:58 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
I am getting the following error message when trying to build latest
PG source on Windows,Error 1 error C2065: 'LDAP_NO_ATTRS' : undeclared identifier
C:\Users\ashu\pgsql\src\backend\libpq\auth.c 2468Googling around I see some indications that the macro may not be
defined in all implementations and that some other projects test if
it's defined:
Does this work for you Ashutosh?
--
Thomas Munro
http://www.enterprisedb.com
Attachments:
0001-Define-LDAP_NO_ATTRS-if-necessary.patchapplication/octet-stream; name=0001-Define-LDAP_NO_ATTRS-if-necessary.patchDownload
From 00c764a2ab60f46fd4b420e4486ed6dd3b1ed9df Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@enterprisedb.com>
Date: Wed, 13 Sep 2017 21:16:57 +1200
Subject: [PATCH] Define LDAP_NO_ATTRS if necessary.
Commit 83aaac41c66959a3ebaec7daadc4885b5f98f561 introduced the use of
LDAP_NO_ATTRS to avoid requesting a dummy attribute when doing search+bind
LDAP authentication. It turns out that not all LDAP implementations define
that macro, but its value is fixed by the protocol so we can define it
ourselves if it's missing.
Author: Thomas Munro
Reported-By: Ashutosh Sharma
Discussion: https://postgr.es/m/CAE9k0Pm6FKCfPCiAr26-L_SMGOA7dT_k0%2B3pEbB8%2B-oT39xRpw%40mail.gmail.com
---
src/backend/libpq/auth.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 62ff624dbd..39a57d4835 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -2398,6 +2398,11 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
#define LPH_USERNAME "$username"
#define LPH_USERNAME_LEN (sizeof(LPH_USERNAME) - 1)
+/* Not all LDAP implementations define this. */
+#ifndef LDAP_NO_ATTRS
+#define LDAP_NO_ATTRS "1.1"
+#endif
+
/*
* Return a newly allocated C string copied from "pattern" with all
* occurrences of the placeholder "$username" replaced with "user_name".
--
2.13.5
Hi Thomas,
On Wed, Sep 13, 2017 at 2:57 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
On Wed, Sep 13, 2017 at 9:11 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:On Wed, Sep 13, 2017 at 8:58 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
I am getting the following error message when trying to build latest
PG source on Windows,Error 1 error C2065: 'LDAP_NO_ATTRS' : undeclared identifier
C:\Users\ashu\pgsql\src\backend\libpq\auth.c 2468Googling around I see some indications that the macro may not be
defined in all implementations and that some other projects test if
it's defined:Does this work for you Ashutosh?
--
I am currently stuck with some other task on Windows. Is it okay if i
can let you know the results in another 30-40 mins. Thanks.
--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Hi,
On Wed, Sep 13, 2017 at 3:15 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
Hi Thomas,
On Wed, Sep 13, 2017 at 2:57 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:On Wed, Sep 13, 2017 at 9:11 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:On Wed, Sep 13, 2017 at 8:58 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
I am getting the following error message when trying to build latest
PG source on Windows,Error 1 error C2065: 'LDAP_NO_ATTRS' : undeclared identifier
C:\Users\ashu\pgsql\src\backend\libpq\auth.c 2468Googling around I see some indications that the macro may not be
defined in all implementations and that some other projects test if
it's defined:Does this work for you Ashutosh?
Thanks for the patch. Yes, it works for me.
--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 9/13/17 06:39, Ashutosh Sharma wrote:
Error 1 error C2065: 'LDAP_NO_ATTRS' : undeclared identifier
C:\Users\ashu\pgsql\src\backend\libpq\auth.c 2468Googling around I see some indications that the macro may not be
defined in all implementations and that some other projects test if
it's defined:Does this work for you Ashutosh?
Thanks for the patch. Yes, it works for me.
committed
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers