Re: contrib: auth_delay module

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>, Stephen Frost <sfrost(at)snowman(dot)net>, Jan Urbański <wulczer(at)wulczer(dot)org>, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, PostgreSQL-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: contrib: auth_delay module
Date: 2010-11-26 02:35:47
Message-ID: AANLkTimLvpwdz-9Bjz=W2h_N8yNLoi2HiH-AMn8AYkK3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 25, 2010 at 3:18 PM, KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:
> The attached patch is revised version.
>
> - Logging part within auth_delay was removed. This module now focuses on
>  injection of a few seconds delay on authentication failed.
> - Documentation parts were added like any other contrib modules.

Something like the following is not required? Though I'm not sure
if there is the case where auth_delay is unload.

----------------------------
void
_PG_fini(void)
{
/* Uninstall hooks. */
ClientAuthentication_hook = original_client_auth_hook;
}
----------------------------

+ if (status != STATUS_OK)
+ {
+ sleep(auth_delay_seconds);
+ }

We should use pg_usleep rather than sleep?

+ DefineCustomIntVariable("auth_delay.seconds",
+ "Seconds to be delayed on authentication failed",
+ NULL,
+ &auth_delay_seconds,
+ 2,
+ 0, INT_MAX,
+ PGC_POSTMASTER,
+ GUC_UNIT_S,
+ NULL,
+ NULL);

Can we relax the context from PGC_POSTMASTER to PGC_SIGHUP?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2010-11-26 02:40:09 Re: SQL/MED - file_fdw
Previous Message Joshua Tolley 2010-11-26 02:31:11 Re: pg_execute_from_file review