Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c) - Mailing list pgsql-bugs

From Petar Bogdanovic
Subject Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c)
Date
Msg-id 20180317205544.GA3507@pintail.NGC068
Whole thread Raw
In response to Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c)  (Christoph Berg <myon@debian.org>)
List pgsql-bugs
On Sat, Mar 17, 2018 at 09:40:51PM +0100, Christoph Berg wrote:
> $ chmod 700 .
> $ sudo -u postgres psql
> could not change directory to "/home/cbe": Permission denied
> 
> I never observed any negative side effects of it, though. (Except for
> the obvious fact that "\i somethinginmyhome.sql" won't work.)


At least on NetBSD, shutting down the system with sudo while being in a
0700 directory will make the pgsql rc-script fail (because it relies on
pg_ctl), i.e. pull the plug on a running pgsql instance.

One could argue that the NetBSD /etc/rc script should, in general, chdir
before doing anything but relying on getcwd/chdir still seems suboptimal.


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution (exec.c)
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15116: pg_recvlogical always fails