Re: How to make PostreSQL utilities honor home directories?

Поиск
Список
Период
Сортировка
От Jeffrey Walton
Тема Re: How to make PostreSQL utilities honor home directories?
Дата
Msg-id CAH8yC8=Y6wgEj47_n--eCKbEYMFP7H7LKACofVAQfM1JjTX3oQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to make PostreSQL utilities honor home directories?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to make PostreSQL utilities honor home directories?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Thu, Sep 1, 2022 at 8:51 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Peter J. Holzer" <hjp-pgsql@hjp.at> writes:
> > However, the symlink doesn't seem to be the culprit. If I run
> > % sudo -u postgres -H /usr/lib/postgresql/13/bin/psql
> > (which is not a symlink)
> > I get the same behaviour. So it seems that psql changes to its basedir
> > and then can't change back again.
>
> Ah --- looking closer at that code, it will chdir *before* checking
> whether the target file is a symlink, which is probably unnecessarily
> stupid.  I'm wondering whether we could drop that logic altogether [1],
> but that won't help you today.
>
> I concur with the other person asking why you want to sudo to postgres
> at all, though.  It's generally safest if the client side isn't running
> as the same user as the server.

The use case is an install of DefectDojo [2]. I _think_ they are
taking advantage of the fact that as root, you don't need to
authenticate because of postgresql's use of domain sockets. (Hat tip
for that, by the way). The installer code will install packages, setup
the database, install the DefectDojo programs, etc.

Jeff

> [1] https://www.postgresql.org/message-id/797232.1662075573%40sss.pgh.pa.us
[2] https://github.com/DefectDojo/godojo



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to make PostreSQL utilities honor home directories?
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: How to make PostreSQL utilities honor home directories?