Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qNymb-006URQ-EB for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Jul 2023 16:51:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qNymZ-00BtwG-TV for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Jul 2023 16:51:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qNymZ-00Bttu-KS for pgsql-bugs@lists.postgresql.org; Mon, 24 Jul 2023 16:51:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qNymX-0003Y0-9U for pgsql-bugs@lists.postgresql.org; Mon, 24 Jul 2023 16:51:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 36OGpZHQ1567991; Mon, 24 Jul 2023 12:51:35 -0400 From: Tom Lane To: "Zechman, Derek S" cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: pg_hba.conf "authentication file token too long, skipping" In-reply-to: References: Comments: In-reply-to "Zechman, Derek S" message dated "Mon, 24 Jul 2023 15:05:15 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1567989.1690217495.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Jul 2023 12:51:35 -0400 Message-ID: <1567990.1690217495@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Zechman, Derek S" writes: > hostssl all +fnc_personal_account_rl XXX.XX.X.X/16 ldap ldapserver=3Dxxx= x-xxxx-xx-xx.mydomainname.com ldapbasedn=3D"OU=3DUsers,OU=3DPrimary,OU=3DA= ll,DC=3Dmydomainname,DC=3Dcom" ldapbinddn=3D"CN=3Dabc_postgres_sa,OU=3DT1-= ServiceAccounts,OU=3DTier1,OU=3DAdmin,OU=3DAll,DC=3Dmydomainname,DC=3Dcom"= ldapbindpasswd=3D"30characterpassword" ldapsearchfilter=3D"(&(objectClass= =3Duser)(sAMAccountName=3D$username)(|(memberof=3DCN=3Dxxx,OU=3DGroups,OU=3D= Primary,OU=3DAll,DC=3Dmydomainname,DC=3Dcom)(memberof=3DCN=3DXxxxxxXXXx,OU= =3DGroups,OU=3DPrimary,OU=3DAll,DC=3Dmydomainname,DC=3Dcom)(memberof=3DCN=3D= xxxxxxxxxxxxxx,OU=3DGroups,OU=3DPrimary,OU=3DAll,DC=3Dmydomainname,DC=3Dco= m)))" Yeah, your ldapsearchfilter option is hitting the 256-byte MAX_TOKEN limit in hba.c. A one-line improvement would be to increase that constant, but it doesn't look very much harder to get rid of that fixed-size buffer altogether in favor of a StringInfo. regards, tom lane