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

From Andrew Gierth
Subject Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution (exec.c)
Date
Msg-id 87efkih4gi.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution (exec.c)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> On systems with openat(), would it not be possible to resolve
 >> symlinks without ever needing chdir?

 Tom> Um ... AFAICS, openat() just opens a file, it doesn't give back a
 Tom> resolved path. Did you mean readlinkat()?

No, what I meant was that if you have openat() (and fstatat() and
fdopendir()), you can do what getcwd does except starting with some
arbitrary directory other than the current one. So the current logic of
"chdir through all symlinks, then do getcwd to find where we landed"
would not be necessary.

-- 
Andrew (irc:RhodiumToad)


pgsql-bugs by date:

Previous
From: Petar Bogdanovic
Date:
Subject: Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c)
Next
From: Christoph Berg
Date:
Subject: Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c)