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 1t2uec-008Tk0-1f for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2024 15:49:10 +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 1t2ueZ-008enw-S2 for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2024 15:49:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2ueZ-008enj-I2 for pgsql-bugs@lists.postgresql.org; Mon, 21 Oct 2024 15:49:07 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2ueX-0021tB-8y for pgsql-bugs@lists.postgresql.org; Mon, 21 Oct 2024 15:49:06 +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 49LFn3o81565683; Mon, 21 Oct 2024 11:49:03 -0400 From: Tom Lane To: "David G. Johnston" cc: Alexey Shishkin , "pgsql-bugs@lists.postgresql.org" Subject: Re: pg_ident.conf + regular expressions issue In-reply-to: References: <1556449.1729522277@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Mon, 21 Oct 2024 08:09:02 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1565681.1729525743.1@sss.pgh.pa.us> Date: Mon, 21 Oct 2024 11:49:03 -0400 Message-ID: <1565682.1729525743@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > The OP never said they were using the ident auth-method. The test involves > peer authentication with a user name mapping file, pg_ident.conf. Not > specifically the ident authentication type (which devolves to peer anyway > if the connection is local). Ah, right, -ENOCAFFEINE: I'd forgotten that "ident" is automatically converted to "peer" for a Unix-socket connection. So that explains the phrasing of the error message. Given that, I don't see anything wrong with the behavior of test05. The OS user name SMOKEYBEAR successfully matches the rule, sure, and then the \1 says that that user can log in as role SMOKEYBEAR. But the request is to log in as smokeybear (lower case), so it fails. The "(?i)" option only makes the regex able to match different casings of the OS name, it doesn't make matching of the \1 result to the requested role name be case-insensitive. test11 seems to be the same thing, only with actual ident auth. regards, tom lane