From: hubert depesz lubaczewski <depesz@depesz.com>
To: Wiwwo Staff <wiwwo@wiwwo.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Disallow execution of shell commands from psql
Date: Wed, 11 Jan 2023 13:54:03 +0100
Message-ID: <Y76xa0OKm7y5xZ0w@depesz.com> (raw)
In-Reply-To: <CAFe70G6=XkdZKwdGOQA-Ccr9QYAS9_G+FULAO08yTy_7Z9=xDA@mail.gmail.com>
References: <CAFe70G6=XkdZKwdGOQA-Ccr9QYAS9_G+FULAO08yTy_7Z9=xDA@mail.gmail.com>
On Tue, Jan 10, 2023 at 07:01:24PM +0100, Wiwwo Staff wrote:
> Hi!
> Happy new (gregorian calendar) year!
>
> Somehow related to the proposal of having a `psql --idle` option, is there
> a way to disallow the command `\!` (and anything of the likes in psql?
>
> Sure, I can set the SHELL env var at run-time, but I still want to have
> postgres user to be a normal user, with its shell etc, which means it can
> change this SHELL setting somewhere.
As far as I know, it's not possible. Why is that a problem though?
\! will run command as the user that ran psql. So it's not a security
issue. What's the problem then?
Best regards,
depesz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: depesz@depesz.com, wiwwo@wiwwo.com
Subject: Re: Disallow execution of shell commands from psql
In-Reply-To: <Y76xa0OKm7y5xZ0w@depesz.com>
References: <CAFe70G6=XkdZKwdGOQA-Ccr9QYAS9_G+FULAO08yTy_7Z9=xDA@mail.gmail.com> <Y76xa0OKm7y5xZ0w@depesz.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox