| From: | Ajit Awekar <ajitpostgres(at)gmail(dot)com> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Hannu Krosing <hannuk(at)google(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Dave Cramer <davecramer(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Subject: | Re: Periodic authorization expiration checks using GoAway message |
| Date: | 2026-01-27 08:19:34 |
| Message-ID: | CAER375NXhqSeH3ShxG67x82ZN0dtZiUmN_iMu0SxZbscDTP31g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Zsolt,
Thanks a lot for your review comments.
>After one more look at this, shouldn't we refresh the cache if
AuthCheckNeeded, regardless of the valid until timestamp value? (for
example by moving the >0 condition to the inner if)
Done. I agree and I handled the scenario in the updated patch.
>I missed this in my previos review, the error
message should start with a lowercase character
Done.
>if the user was dropped, but the connection is still
active, the patch silently ignores it. That matches the current
behavior of postgres, but is that the expected behavior in the context
of this patch?
Thanks a lot for this use case. I agree that this patch should handle that
scenario more explicitly. I have updated the logic in the attached version
to address this use case.
I have attached an updated patch. Request a review.
Thanks & Best Regards,
Ajit
On Thu, 22 Jan 2026 at 13:10, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
wrote:
> Hello!
>
> > Done. I have modified the condition check so as it will not impact users
> > having rolvaliduntil to NULL.
>
> Thanks! After one more look at this, shouldn't we refresh the cache if
> AuthCheckNeeded, regardless of the valid until timestamp value? (for
> example by moving the >0 condition to the inner if)
>
> Consider the following scenario:
>
> 1. user logs in, without a valid until date set
> 2. valid until is set to something
> 3. existing session started in 1 will never be terminated
>
>
> postgres.c:5368 - I missed this in my previos review, the error
> message should start with a lowercase character.
>
>
> > This patch introduces a mechanism to address the security issue of stale,
> > authorized connections persisting beyond their validity period. .
>
> postgres.c:5326 - if the user was dropped, but the connection is still
> active, the patch silently ignores it. That matches the current
> behavior of postgres, but is that the expected behavior in the context
> of this patch?
>
| Attachment | Content-Type | Size |
|---|---|---|
| password_expiration_enforcement_V2.diff | application/octet-stream | 10.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | jian he | 2026-01-27 08:27:03 | could not find replacement targetlist entry for attno -6 |
| Previous Message | Corey Huinker | 2026-01-27 08:04:52 | Re: Import Statistics in postgres_fdw before resorting to sampling. |