Re: [v9.1] Add security hook on initialization of instance

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [v9.1] Add security hook on initialization of instance
Date: 2010-06-15 00:22:12
Message-ID: AANLkTinHhKXDrpso94GT6XC-48yZ5ws3xuFd5NLTR94_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/6/14 KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>:
> On the hook, I'd like to obtain security context of the client process
> which connected to the PostgreSQL instance. It is not available at the
> _PG_init() phase, because clients don't connect yet.

Can't you just call getpeercon() the first time you need the context
and cache it in a backend-local variable? Then you don't need a hook
at all.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-06-15 00:41:32 Re: [v9.1] Add security hook on initialization of instance
Previous Message KaiGai Kohei 2010-06-15 00:09:51 Re: ExecutorCheckPerms() hook